Platform: Improve Windows wstring support

This commit is contained in:
David Rebbe
2025-02-06 18:43:51 +00:00
committed by Kyle Schwarz
parent c5ba2d8d32
commit f04cd16bee
7 changed files with 85 additions and 14 deletions
+23
View File
@@ -0,0 +1,23 @@
#include <gtest/gtest.h>
#include <icsneo/platform/windows/strings.h>
#include <string>
TEST(WindowsUtilTest, testConvertWideString) {
#ifdef WIN32
std::wstring wideString(L"Hello World!");
auto normalString = icsneo::convertWideString(wideString);
ASSERT_STREQ(normalString.c_str(), "Hello World!");
#endif
}
TEST(WindowsUtilTest, testConvertStringToWide) {
#ifdef WIN32
std::string normalString("Hello World!");
auto wideString = icsneo::convertStringToWide(normalString);
ASSERT_STREQ(wideString.c_str(), L"Hello World!");
#endif
}