First public contribution.
5 #include "cppunit/cppunit_proxy.h"
7 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
14 class LexcmpTest : public CPPUNIT_NS::TestCase
16 CPPUNIT_TEST_SUITE(LexcmpTest);
17 CPPUNIT_TEST(lexcmp1);
18 CPPUNIT_TEST(lexcmp2);
19 CPPUNIT_TEST_SUITE_END();
26 CPPUNIT_TEST_SUITE_REGISTRATION(LexcmpTest);
29 // tests implementation
31 void LexcmpTest::lexcmp1()
33 const unsigned size = 6;
34 char n1[size] = "shoe";
35 char n2[size] = "shine";
37 bool before = lexicographical_compare(n1, n1 + size, n2, n2 + size);
38 CPPUNIT_ASSERT(!before);
40 void LexcmpTest::lexcmp2()
42 const unsigned size = 6;
43 char n1[size] = "shoe";
44 char n2[size] = "shine";
46 bool before = lexicographical_compare(n1, n1 + size, n2, n2 + size, greater<char>());
47 CPPUNIT_ASSERT(before);