/* ==================================================================== * Copyright (c) 2003-2006, Martin Hauner * http://subcommander.tigris.org * * Subcommander is licensed as described in the file doc/COPYING, which * you should have received as part of this distribution. * ==================================================================== */ #include "StringUtilTest.h" // cppunit #include #include // sc #include "sublib/StringUtil.h" // qt #include StringUtilTest::StringUtilTest() : CppUnit::TestCase("StringUtilTest") { } StringUtilTest::~StringUtilTest() { } void StringUtilTest::setUp() { } void StringUtilTest::tearDown() { } CppUnit::Test *StringUtilTest::suite() { CppUnit::TestSuite *newSuite = new CppUnit::TestSuite("StringUtilTest"); newSuite->addTest(new CppUnit::TestCaller("testCompare",&StringUtilTest::testCompare) ); return newSuite; } void StringUtilTest::testCompare() { CPPUNIT_ASSERT( sc::compare( "2", "10" ) < 0 ); CPPUNIT_ASSERT( sc::compare( "aaa2", "aaa10" ) < 0 ); // crashes prior to r1385 CPPUNIT_ASSERT( sc::compare( "a-hallöle", "a-ö" ) < 0 ); CPPUNIT_ASSERT( sc::compare( "123456789012345678901", "123456789012345678902" ) == 0 ); }