[Libreoffice-commits] .: sal/qa
Lubos Lunak
llunak at kemper.freedesktop.org
Wed Mar 28 14:49:01 PDT 2012
sal/qa/rtl/strings/test_ostring_stringliterals.cxx | 10 +++++-----
sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 14 +++++++-------
2 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit bb070c05b6e2d09b15fed673507a523c11eb2a19
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Wed Mar 28 23:48:17 2012 +0200
CPPUNIT_ASSERT_EQUAL() takes expected as the first argument
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 494c1da..0d5036a 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 2070698..6316478 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 )));
More information about the Libreoffice-commits
mailing list