summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-03-28 08:56:05 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-03-28 09:07:17 +0200
commit2ebda60bfe7897ac371dd7ee97c4309e72f20e4b (patch)
treef6f42a14ccd351201aae4a9f316617f8cec50b3d /sal/qa
parent86ebc8471d5e056a1240e5f9d487c5b1c9b3d423 (diff)
more SFINAE to distinguish between const char* and const char[]
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/rtl/strings/test_ostring_stringliterals.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 0ada7097221b..4af152c4f7c7 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -149,20 +149,48 @@ void test::ostring::StringLiterals::checkUsage()
rtl_string_unittest_const_literal = false; // start checking for OString conversions
rtl_string_unittest_non_const_literal_function = false; // and check for non-const variants
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT_EQUAL( foo, rtl::OString() = "foo" );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FoO.equalsIgnoreAsciiCase( "fOo" ));
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobarfoo.match( "bar", 3 ));
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobar.match( "foo" ));
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FooBaRfoo.matchIgnoreAsciiCase( "bAr", 3 ));
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FooBaR.matchIgnoreAsciiCase( "fOo" ));
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobar.endsWith( "bar" ));
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+// rtl_string_unittest_const_literal_function = false;
// CPPUNIT_ASSERT( FooBaR.endsWithIgnoreAsciiCase( "bar" ));
+// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foo == "foo" );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( "foo" == foo );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foo != "bar" );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( "foo" != bar );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobarfoo.indexOf( "foo", 1 ) == 6 );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+// rtl_string_unittest_const_literal_function = false;
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( "foo" ) == 6 );
+// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
// if this is not true, some of the calls above converted to OString
CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
// if this is not true, some of the calls above used non-const variants