[Libreoffice-commits] .: 2 commits - sal/inc sal/qa

Caolán McNamara caolan at kemper.freedesktop.org
Tue Aug 2 03:09:23 PDT 2011


 sal/inc/rtl/strbuf.hxx                     |    2 +-
 sal/inc/rtl/ustrbuf.hxx                    |    2 +-
 sal/qa/OStringBuffer/rtl_OStringBuffer.cxx |   18 +++++++++++++++++-
 3 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 65cf76e82e8f7a2b51c44ad8bddd13026efe501f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jul 31 15:51:25 2011 +0100

    make these explicit

diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index 3a26c1b..a5412e7 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -111,7 +111,7 @@ public:
 
         @param      length   the initial capacity.
      */
-    OStringBuffer(sal_Int32 length)
+    explicit OStringBuffer(sal_Int32 length)
         : pData(NULL)
         , nCapacity( length )
     {
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 7569597..cbab193 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -110,7 +110,7 @@ public:
 
         @param      length   the initial capacity.
      */
-    OUStringBuffer(sal_Int32 length)
+    explicit OUStringBuffer(sal_Int32 length)
         : pData(NULL)
         , nCapacity( length )
     {
commit 88cf78d511c71af77658104a20c9c7a225c83078
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 29 23:18:41 2011 +0100

    make sure we get the right interim obj

diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index 036a2c3..172c436 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -136,7 +136,7 @@ namespace rtl_OStringBuffer
 
             CPPUNIT_ASSERT_MESSAGE
             (
-                "New OStringBuffer from Ostring",
+                "New OStringBuffer from OString",
                 aStrBuf.getStr() == aStrtmp &&
                 leg == aStrtmp.pData->length &&
                 aStrBuf.getCapacity() == leg+16
@@ -150,6 +150,21 @@ namespace rtl_OStringBuffer
             rtl::OStringBuffer b2(b1);
         }
 
+        void ctor_006()
+        {
+            //pass in a const char*, get a temp
+            //OString
+            ::rtl::OStringBuffer aStrBuf(kTestStr1);
+            sal_Int32 leg = aStrBuf.getLength();
+
+            CPPUNIT_ASSERT_MESSAGE
+            (
+                "New OStringBuffer from const char*",
+                leg == rtl_str_getLength(kTestStr1) &&
+                aStrBuf.getCapacity() == leg+16
+            );
+        }
+
         CPPUNIT_TEST_SUITE(ctors);
         CPPUNIT_TEST(ctor_001);
         CPPUNIT_TEST(ctor_002);
@@ -157,6 +172,7 @@ namespace rtl_OStringBuffer
         CPPUNIT_TEST(ctor_003_1);
         CPPUNIT_TEST(ctor_004);
         CPPUNIT_TEST(ctor_005);
+        CPPUNIT_TEST(ctor_006);
         CPPUNIT_TEST_SUITE_END();
     };
 


More information about the Libreoffice-commits mailing list