Files
PowerShell/tests/test-getusername.cpp
T
Andrew Schwartzmeyer fc81606886 Remove icuuc entirely
While we no longer used it, we still linked to it and included its
header. This is now gone.
2015-12-19 11:52:30 -08:00

18 lines
422 B
C++

//! @file test-getusername.cpp
//! @author Andrew Schwartzmeyer <andschwa@microsoft.com>
//! @brief Unit tests for GetUserName
#include <string>
#include <vector>
#include <unistd.h>
#include <gtest/gtest.h>
#include <pwd.h>
#include "getusername.h"
TEST(GetUserName, Success)
{
char* expected = getpwuid(geteuid())->pw_name;
ASSERT_TRUE(expected != NULL);
ASSERT_EQ(GetUserName(), std::string(expected));
}