UnitTest: Switch to Assert::IsTrue for primitive datatypes
Visual Studio 2019 has issues compiling Assert::AreEqual<stdex::langid>. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -24,9 +24,9 @@ namespace UnitTests
|
||||
stdex::locale locale(stdex::create_locale(LC_ALL, "en_US.UTF-8"));
|
||||
|
||||
Assert::AreEqual(L"This is a test.", stdex::sprintf(L"This is %ls.", locale, L"a test").c_str());
|
||||
Assert::AreEqual<size_t>(15, stdex::sprintf(L"This is %ls.", locale, L"a test").size());
|
||||
Assert::IsTrue(stdex::sprintf(L"This is %ls.", locale, L"a test").size() == 15);
|
||||
Assert::AreEqual("This is a test.", stdex::sprintf("This is %s.", locale, "a test").c_str());
|
||||
Assert::AreEqual<size_t>(15, stdex::sprintf("This is %s.", locale, "a test").size());
|
||||
Assert::IsTrue(stdex::sprintf("This is %s.", locale, "a test").size() == 15);
|
||||
|
||||
Assert::AreEqual(L"This is a 🐔Test🐮.", stdex::sprintf(L"This is %ls.", locale, L"a 🐔Test🐮").c_str());
|
||||
Assert::AreEqual("This is a 🐔Test🐮.", stdex::sprintf("This is %s.", locale, "a 🐔Test🐮").c_str());
|
||||
@@ -38,9 +38,9 @@ namespace UnitTests
|
||||
str += "🐔Test🐮\r\n";
|
||||
}
|
||||
Assert::AreEqual(wstr.c_str(), stdex::sprintf(L"%ls", locale, wstr.data()).c_str());
|
||||
Assert::AreEqual(wstr.size(), stdex::sprintf(L"%ls", locale, wstr.data()).size());
|
||||
Assert::IsTrue(stdex::sprintf(L"%ls", locale, wstr.data()).size() == wstr.size());
|
||||
Assert::AreEqual(str.c_str(), stdex::sprintf("%s", locale, str.data()).c_str());
|
||||
Assert::AreEqual(str.size(), stdex::sprintf("%s", locale, str.data()).size());
|
||||
Assert::IsTrue(stdex::sprintf("%s", locale, str.data()).size() == str.size());
|
||||
}
|
||||
|
||||
void string::snprintf()
|
||||
|
||||
Reference in New Issue
Block a user