Browse Source

- Fixed spaces in plstring docs

- Moved the CRT flag
- removed format tests as plString::format is deprecated.
Anne Marije v/d Meer 10 years ago
parent
commit
eeec4bac56
  1. 1
      Sources/Tests/CMakeLists.txt
  2. 18
      Sources/Tests/CoreTests/test_plString.cpp
  3. 2
      Sources/Tests/gtest-1.6.0/CMakeLists.txt

1
Sources/Tests/CMakeLists.txt

@ -1,3 +1,4 @@
set(gtest_force_shared_crt ON CACHE INTERNAL "don't link the CRT statically into gtest as we later link the test executable dynamically")
add_subdirectory(gtest-1.6.0) add_subdirectory(gtest-1.6.0)
add_subdirectory(CoreTests) add_subdirectory(CoreTests)

18
Sources/Tests/CoreTests/test_plString.cpp

@ -30,24 +30,6 @@ TEST(PlStringTest,ToIso8859_1)
EXPECT_STREQ(expected.GetData(),output.GetData()); EXPECT_STREQ(expected.GetData(),output.GetData());
} }
TEST(PlStringTest,Format)
{
//string <256 characters
plString expected1 = plString("abcd3");
plString output1 = plString::Format("a%c%s%d",'b',"cd",3);
EXPECT_EQ(expected1,output1);
//string == 256 characters
plString expected2 = plString("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi elit erat, ornare vitae dictum non, accumsan nec orci. Pellentesque vel lectus magna, nec fermentum leo. Vestibulum venenatis sapien sit amet diam luctus laoreet. Integer accumsan iaculis amet.");
plString output2 = plString::Format("Lorem %s dolor sit amet, consectetur adipiscing elit. %s elit erat, ornare vitae dictum non, accumsan nec orci. Pellentesque vel lectus magna, nec fermentum leo. Vestibulum venenatis sapien sit amet diam luctus laoreet. Integer accumsan %s amet.","ipsum","Morbi","iaculis");
EXPECT_EQ(expected2,output2);
//string >256 characters
plString expected3 = plString("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur blandit iaculis metus eu gravida. Nulla ut lorem et tortor aliquam varius. Maecenas sed metus turpis. Mauris molestie velit aliquam felis suscipit egestas. Duis id arcu eget velit facilisis varius vitae ac neque. Quisque dapibus sed.");
plString output3 = plString::Format("Lorem ipsum dolor sit amet, %s adipiscing elit. Curabitur blandit iaculis metus eu gravida. Nulla ut lorem et tortor aliquam varius. Maecenas sed metus turpis. Mauris molestie velit aliquam felis suscipit %s. %s","consectetur","egestas","Duis id arcu eget velit facilisis varius vitae ac neque. Quisque dapibus sed.");
EXPECT_EQ(expected3,output3);
}
TEST(PlStringTest,FindChar) TEST(PlStringTest,FindChar)
{ {
plString input = plString("abCdcBAeab"); plString input = plString("abCdcBAeab");

2
Sources/Tests/gtest-1.6.0/CMakeLists.txt

@ -14,7 +14,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
option( option(
gtest_force_shared_crt gtest_force_shared_crt
"Use shared (DLL) run-time lib even when Google Test is built as static lib." "Use shared (DLL) run-time lib even when Google Test is built as static lib."
ON) OFF)
option(gtest_build_tests "Build all of gtest's own tests." OFF) option(gtest_build_tests "Build all of gtest's own tests." OFF)

Loading…
Cancel
Save