mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 20:56:02 +00:00
28 lines
697 B
C++
28 lines
697 B
C++
//! @file test-getcomputername.cpp
|
|
//! @author George Fleming <v-geflem@microsoft.com>
|
|
//! @brief Unit tests for GetComputerName
|
|
|
|
#include <string>
|
|
#include <unistd.h>
|
|
#include <gtest/gtest.h>
|
|
#include "getcomputername.h"
|
|
|
|
//! Test fixture for GetComputerNameTest
|
|
class GetComputerNameTest : public ::testing::Test
|
|
{
|
|
protected:
|
|
char expectedComputerName[HOST_NAME_MAX];
|
|
|
|
//Get expected result from using linux call
|
|
GetComputerNameTest()
|
|
{
|
|
BOOL ret = gethostname(expectedComputerName, HOST_NAME_MAX);
|
|
EXPECT_EQ(0, ret);
|
|
}
|
|
};
|
|
|
|
TEST_F(GetComputerNameTest, ValidateLinuxGetHostnameSystemCall)
|
|
{
|
|
ASSERT_STREQ(GetComputerName(), expectedComputerName);
|
|
}
|