summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-03-28 23:48:17 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-03-28 23:48:55 +0200
commitbb070c05b6e2d09b15fed673507a523c11eb2a19 (patch)
tree1ea11b7ce57f8cdda5842aceb329dd088612d7ea /sal
parentc9167bac18e1cca061d91f65d2dc91b9d09ef587 (diff)
CPPUNIT_ASSERT_EQUAL() takes expected as the first argument
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/strings/test_ostring_stringliterals.cxx10
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx14
2 files changed, 12 insertions, 12 deletions
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 494c1da5497e..0d5036aa2f11 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -261,15 +261,15 @@ void test::ostring::StringLiterals::checkBuffer()
rtl_string_unittest_const_literal_function = false;
buf.append( "foo" );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
- CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( "foo" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OString( "foo" ), buf.toString());
rtl_string_unittest_const_literal_function = false;
buf.append( "bar" );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
- CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( "foobar" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OString( "foobar" ), buf.toString());
rtl_string_unittest_const_literal_function = false;
buf.insert( 3, "baz" );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
- CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OString( "foobazbar" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OString( "foobazbar" ), buf.toString());
#else
buf.append( "foobazbar" );
#endif
@@ -279,8 +279,8 @@ void test::ostring::StringLiterals::checkBuffer()
rtl_string_unittest_const_literal = false; // start checking for OString conversions
rtl_string_unittest_const_literal_function = false; // and check for const variants
char d[] = "d";
- CPPUNIT_ASSERT_EQUAL( buf.append( d ).toString(), foobazbard );
- CPPUNIT_ASSERT_EQUAL( buf.insert( 3, d ).toString(), foodbazbard );
+ CPPUNIT_ASSERT_EQUAL( foobazbard, buf.append( d ).toString());
+ CPPUNIT_ASSERT_EQUAL( foodbazbard, buf.insert( 3, d ).toString() );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == false );
}
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 20706980c3f9..631647858927 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -99,10 +99,10 @@ void test::oustring::StringLiterals::checkCtors()
// Check that contents are correct and equal to the case when RTL_CONSTASCII_USTRINGPARAM is used.
// Also check that embedded \0 is included.
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" )), rtl::OUString( "" ));
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\0" )), rtl::OUString( "\0" ));
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ab" )), rtl::OUString( "ab" ));
- CPPUNIT_ASSERT_EQUAL( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "a\0b" )), rtl::OUString( "a\0b" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "\0" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\0" )));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "ab" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ab" )));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "a\0b" ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "a\0b" )));
}
void test::oustring::StringLiterals::testcall( const char str[] )
@@ -175,11 +175,11 @@ void test::oustring::StringLiterals::checkBuffer()
{
rtl::OUStringBuffer buf;
buf.append( "foo" );
- CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OUString( "foo" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "foo" ), buf.toString());
buf.append( "bar" );
- CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OUString( "foobar" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "foobar" ), buf.toString());
buf.insert( 3, "baz" );
- CPPUNIT_ASSERT_EQUAL( buf.toString(), rtl::OUString( "foobazbar" ));
+ CPPUNIT_ASSERT_EQUAL( rtl::OUString( "foobazbar" ), buf.toString());
char d[] = "d";
CPPUNIT_ASSERT( !VALID_CONVERSION( buf.append( d )));
CPPUNIT_ASSERT( !VALID_CONVERSION( buf.insert( 0, d )));