[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 5 commits - cppu/prj cppu/qa desktop/qa o3tl/qa
Damjan Jovanovic
damjan at apache.org
Sun Aug 30 03:08:11 PDT 2015
cppu/prj/build.lst | 1
cppu/qa/main.cxx | 28
cppu/qa/makefile.mk | 69 -
cppu/qa/test_any.cxx | 1241 +++++++++++--------------
cppu/qa/test_recursion.cxx | 17
cppu/qa/test_reference.cxx | 31
cppu/qa/test_unotype.cxx | 456 ++++-----
cppu/qa/version.map | 30
desktop/qa/deployment_misc/main.cxx | 28
desktop/qa/deployment_misc/makefile.mk | 36
desktop/qa/deployment_misc/test_dp_version.cxx | 21
desktop/qa/deployment_misc/version.map | 30
o3tl/qa/export.map | 30
o3tl/qa/main.cxx | 28
o3tl/qa/makefile.mk | 53 -
o3tl/qa/test-cow_wrapper.cxx | 161 +--
o3tl/qa/test-heap_ptr.cxx | 202 +---
o3tl/qa/test-range.cxx | 214 ++--
o3tl/qa/test-vector_pool.cxx | 80 -
19 files changed, 1231 insertions(+), 1525 deletions(-)
New commits:
commit 61224f2be25942cee9f2222506f5311c619539c8
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Aug 30 09:09:06 2015 +0000
#i125003# migrate main/o3tl from cppunit to Google Test
diff --git a/o3tl/qa/export.map b/o3tl/qa/export.map
deleted file mode 100644
index ec49c45..0000000
--- a/o3tl/qa/export.map
+++ /dev/null
@@ -1,30 +0,0 @@
-#**************************************************************
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-
-UDK_3_0_0 {
- global:
- cppunitTestPlugIn;
-
- local:
- *;
-};
diff --git a/o3tl/qa/main.cxx b/o3tl/qa/main.cxx
new file mode 100644
index 0000000..df14e5b
--- /dev/null
+++ b/o3tl/qa/main.cxx
@@ -0,0 +1,28 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "gtest/gtest.h"
+
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/o3tl/qa/makefile.mk b/o3tl/qa/makefile.mk
index 7693185..419694a 100644
--- a/o3tl/qa/makefile.mk
+++ b/o3tl/qa/makefile.mk
@@ -20,73 +20,48 @@
#**************************************************************
-
-.IF "$(WITH_CPPUNIT)" != "YES" || "$(GUI)" == "OS2"
-
- at all:
-.IF "$(GUI)" == "OS2"
- @echo "Skipping, cppunit broken."
-.ELIF "$(WITH_CPPUNIT)" != "YES"
- @echo "cppunit disabled. nothing do do."
-.END
-
-.ELSE # "$(WITH_CPPUNIT)" != "YES" || "$(GUI)" == "OS2"
-
PRJ=..
-
PRJNAME=o3tl
TARGET=tests
ENABLE_EXCEPTIONS=TRUE
+
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-#building with stlport, but cppunit was not built with stlport
-.IF "$(USE_SYSTEM_STL)"!="YES"
-.IF "$(SYSTEM_CPPUNIT)"=="YES"
-CFLAGSCXX+=-DADAPT_EXT_STL
-.ENDIF
-.ENDIF
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+ @echo unit tests are disabled. Nothing to do.
+
+.ELSE
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
.IF "$(L10N_framework)"==""
# --- Common ----------------------------------------------------------
# BEGIN ----------------------------------------------------------------
-SHL1OBJS= \
+APP1OBJS= \
$(SLO)$/cow_wrapper_clients.obj \
+ $(SLO)$/main.obj \
$(SLO)$/test-cow_wrapper.obj \
$(SLO)$/test-vector_pool.obj \
$(SLO)$/test-heap_ptr.obj \
$(SLO)$/test-range.obj
-SHL1TARGET= tests
-SHL1STDLIBS= $(SALLIB) \
- $(CPPUNITLIB)
+APP1TARGET= tests
+APP1STDLIBS= $(SALLIB) \
+ $(GTESTLIB)
-SHL1IMPLIB= i$(SHL1TARGET)
-
-DEF1NAME =$(SHL1TARGET)
-SHL1VERSIONMAP = export.map
-SHL1RPATH = NONE
+APP1RPATH = NONE
+APP1TEST = enabled
# END ------------------------------------------------------------------
-#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-SLOFILES=$(SHL1OBJS)
-
# --- Targets ------------------------------------------------------
.ENDIF # L10N_framework
.INCLUDE : target.mk
-# --- Enable test execution in normal build ------------------------
-.IF "$(L10N_framework)"==""
-.INCLUDE : _cppunit.mk
-.ENDIF # L10N_framework
-
-.ENDIF # "$(WITH_CPPUNIT)" != "YES" || "$(GUI)" == "OS2"
+.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
diff --git a/o3tl/qa/test-cow_wrapper.cxx b/o3tl/qa/test-cow_wrapper.cxx
index 5d0e2d2..7d9f5a2 100644
--- a/o3tl/qa/test-cow_wrapper.cxx
+++ b/o3tl/qa/test-cow_wrapper.cxx
@@ -22,10 +22,7 @@
// autogenerated file with codegen.pl
#include "preextstl.h"
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
+#include "gtest/gtest.h"
#include "postextstl.h"
#include "cow_wrapper_clients.hxx"
@@ -34,117 +31,79 @@ using namespace ::o3tl;
using namespace ::o3tltests;
-class cow_wrapper_test : public CppUnit::TestFixture
+class cow_wrapper_test : public ::testing::Test
{
public:
template< class T > void test( T& rTestObj1, T& rTestObj2, T& rTestObj3 )
{
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 is unique",
- rTestObj1.is_unique() );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2 is unique",
- rTestObj2.is_unique() );
- CPPUNIT_ASSERT_MESSAGE("rTestObj3 is unique",
- rTestObj3.is_unique() );
-
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 != rTestObj2",
- rTestObj1 != rTestObj2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2 != rTestObj3",
- rTestObj2 != rTestObj3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 != rTestObj3",
- rTestObj1 != rTestObj3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 < rTestObj2",
- rTestObj1 < rTestObj2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2 < rTestObj3",
- rTestObj2 < rTestObj3 );
+ ASSERT_TRUE(rTestObj1.is_unique() ) << "rTestObj1 is unique";
+ ASSERT_TRUE(rTestObj2.is_unique() ) << "rTestObj2 is unique";
+ ASSERT_TRUE(rTestObj3.is_unique() ) << "rTestObj3 is unique";
+
+ ASSERT_TRUE(rTestObj1 != rTestObj2 ) << "rTestObj1 != rTestObj2";
+ ASSERT_TRUE(rTestObj2 != rTestObj3 ) << "rTestObj2 != rTestObj3";
+ ASSERT_TRUE(rTestObj1 != rTestObj3 ) << "rTestObj1 != rTestObj3";
+ ASSERT_TRUE(rTestObj1 < rTestObj2 ) << "rTestObj1 < rTestObj2";
+ ASSERT_TRUE(rTestObj2 < rTestObj3 ) << "rTestObj2 < rTestObj3";
rTestObj2 = rTestObj1;
rTestObj3 = rTestObj1;
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 == rTestObj2",
- rTestObj1 == rTestObj2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 == rTestObj3",
- rTestObj1 == rTestObj3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1.use_count() == 3",
- rTestObj1.use_count() == 3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2.use_count() == 3",
- rTestObj2.use_count() == 3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj3.use_count() == 3",
- rTestObj3.use_count() == 3 );
+ ASSERT_TRUE(rTestObj1 == rTestObj2 ) << "rTestObj1 == rTestObj2";
+ ASSERT_TRUE(rTestObj1 == rTestObj3 ) << "rTestObj1 == rTestObj3";
+ ASSERT_TRUE(rTestObj1.use_count() == 3 ) << "rTestObj1.use_count() == 3";
+ ASSERT_TRUE(rTestObj2.use_count() == 3 ) << "rTestObj2.use_count() == 3";
+ ASSERT_TRUE(rTestObj3.use_count() == 3 ) << "rTestObj3.use_count() == 3";
rTestObj2.makeUnique();
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 == rTestObj2",
- rTestObj1 == rTestObj2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 == rTestObj3",
- rTestObj1 == rTestObj3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1.use_count() == 2",
- rTestObj1.use_count() == 2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2.use_count() == 1",
- rTestObj2.use_count() == 1 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2.is_unique()",
- rTestObj2.is_unique() );
- CPPUNIT_ASSERT_MESSAGE("rTestObj3.use_count() == 2",
- rTestObj3.use_count() == 2 );
+ ASSERT_TRUE(rTestObj1 == rTestObj2 ) << "rTestObj1 == rTestObj2";
+ ASSERT_TRUE(rTestObj1 == rTestObj3 ) << "rTestObj1 == rTestObj3";
+ ASSERT_TRUE(rTestObj1.use_count() == 2 ) << "rTestObj1.use_count() == 2";
+ ASSERT_TRUE(rTestObj2.use_count() == 1 ) << "rTestObj2.use_count() == 1";
+ ASSERT_TRUE(rTestObj2.is_unique() ) << "rTestObj2.is_unique()";
+ ASSERT_TRUE(rTestObj3.use_count() == 2 ) << "rTestObj3.use_count() == 2";
rTestObj2.swap( rTestObj3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 == rTestObj2",
- rTestObj1 == rTestObj2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1 == rTestObj3",
- rTestObj1 == rTestObj3 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj1.use_count() == 2",
- rTestObj1.use_count() == 2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj2.use_count() == 2",
- rTestObj2.use_count() == 2 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj3.use_count() == 1",
- rTestObj3.use_count() == 1 );
- CPPUNIT_ASSERT_MESSAGE("rTestObj3.is_unique()",
- rTestObj3.is_unique() );
+ ASSERT_TRUE(rTestObj1 == rTestObj2 ) << "rTestObj1 == rTestObj2";
+ ASSERT_TRUE(rTestObj1 == rTestObj3 ) << "rTestObj1 == rTestObj3";
+ ASSERT_TRUE(rTestObj1.use_count() == 2 ) << "rTestObj1.use_count() == 2";
+ ASSERT_TRUE(rTestObj2.use_count() == 2 ) << "rTestObj2.use_count() == 2";
+ ASSERT_TRUE(rTestObj3.use_count() == 1 ) << "rTestObj3.use_count() == 1";
+ ASSERT_TRUE(rTestObj3.is_unique() ) << "rTestObj3.is_unique()";
}
+};
- void testCowWrapper()
- {
- // setup
- cow_wrapper_client1 aTestObj1;
- cow_wrapper_client1 aTestObj2;
- cow_wrapper_client1 aTestObj3;
-
- cow_wrapper_client2 aTestObj4;
- cow_wrapper_client2 aTestObj5;
- cow_wrapper_client2 aTestObj6;
-
- cow_wrapper_client3 aTestObj7;
- cow_wrapper_client3 aTestObj8;
- cow_wrapper_client3 aTestObj9;
-
- {
- aTestObj1 = cow_wrapper_client1( 1 );
- aTestObj2.modify( 2 );
- aTestObj3.modify( 3 );
-
- aTestObj4 = cow_wrapper_client2( 4 );
- aTestObj5.modify( 5 );
- aTestObj6.modify( 6 );
-
- aTestObj7 = cow_wrapper_client3( 7 );
- aTestObj8.modify( 8 );
- aTestObj9.modify( 9 );
- }
- // all three temporaries are dead now
-
- // test
- test( aTestObj1, aTestObj2, aTestObj3 );
- test( aTestObj4, aTestObj5, aTestObj6 );
- test( aTestObj7, aTestObj8, aTestObj9 );
- }
+TEST_F(cow_wrapper_test, testCowWrapper)
+{
+ // setup
+ cow_wrapper_client1 aTestObj1;
+ cow_wrapper_client1 aTestObj2;
+ cow_wrapper_client1 aTestObj3;
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
- // because these macros are need by auto register mechanism.
+ cow_wrapper_client2 aTestObj4;
+ cow_wrapper_client2 aTestObj5;
+ cow_wrapper_client2 aTestObj6;
- CPPUNIT_TEST_SUITE(cow_wrapper_test);
- CPPUNIT_TEST(testCowWrapper);
- CPPUNIT_TEST_SUITE_END();
-};
+ cow_wrapper_client3 aTestObj7;
+ cow_wrapper_client3 aTestObj8;
+ cow_wrapper_client3 aTestObj9;
+
+ {
+ aTestObj1 = cow_wrapper_client1( 1 );
+ aTestObj2.modify( 2 );
+ aTestObj3.modify( 3 );
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION(cow_wrapper_test);
+ aTestObj4 = cow_wrapper_client2( 4 );
+ aTestObj5.modify( 5 );
+ aTestObj6.modify( 6 );
+
+ aTestObj7 = cow_wrapper_client3( 7 );
+ aTestObj8.modify( 8 );
+ aTestObj9.modify( 9 );
+ }
+ // all three temporaries are dead now
-CPPUNIT_PLUGIN_IMPLEMENT();
+ // test
+ test( aTestObj1, aTestObj2, aTestObj3 );
+ test( aTestObj4, aTestObj5, aTestObj6 );
+ test( aTestObj7, aTestObj8, aTestObj9 );
+}
diff --git a/o3tl/qa/test-heap_ptr.cxx b/o3tl/qa/test-heap_ptr.cxx
index 40f3147..76c34b5 100644
--- a/o3tl/qa/test-heap_ptr.cxx
+++ b/o3tl/qa/test-heap_ptr.cxx
@@ -22,9 +22,7 @@
#include "preextstl.h"
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
+#include "gtest/gtest.h"
#include "postextstl.h"
#include <o3tl/heap_ptr.hxx>
@@ -52,112 +50,106 @@ class Help
int Help::nInstanceCount_ = 0;
-class heap_ptr_test : public CppUnit::TestFixture
+class heap_ptr_test : public ::testing::Test
{
public:
- void global()
+}; // class heap_ptr_test
+
+TEST_F(heap_ptr_test, global)
+{
+ // Construction
+ heap_ptr<Help>
+ t_empty;
+ const heap_ptr<Help>
+ t0( new Help(7000) );
+ heap_ptr<Help>
+ t1( new Help(10) );
+ heap_ptr<Help>
+ t2( new Help(20) );
+
+ int nHelpCount = 3;
+
+ ASSERT_TRUE(! t_empty.is()) << "ctor1";
+ ASSERT_TRUE(t0.is()) << "ctor2";
+ ASSERT_TRUE((*t0).Value() == 7000) << "ctor3";
+ ASSERT_TRUE(t0->Value() == 7000) << "ctor4";
+ ASSERT_TRUE(t0.get() == t0.operator->()) << "ctor5";
+ ASSERT_TRUE(t0.get() == &(*t0)) << "ctor6";
+
+ ASSERT_TRUE(t1.is()) << "ctor7";
+ ASSERT_TRUE((*t1).Value() == 10) << "ctor8";
+ ASSERT_TRUE(t1->Value() == 10) << "ctor9";
+ ASSERT_TRUE(t1.get() == t1.operator->()) << "ctor10";
+ ASSERT_TRUE(t1.get() == &(*t1)) << "ctor11";
+
+ ASSERT_TRUE(t2.operator*().Value() == 20) << "ctor12";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "ctor13";
+
+
+ // Operator safe_bool() / bool()
+ ASSERT_TRUE(! t_empty) << "bool1";
+ ASSERT_TRUE(t0) << "bool2";
+ ASSERT_TRUE(t1.is() == static_cast<bool>(t1)) << "bool3";
+
+
+ // Assignment, reset() and release()
+ // Release
+ Help * hp = t1.release();
+ ASSERT_TRUE(! t1.is()) << "release1";
+ ASSERT_TRUE(t1.get() == 0) << "release2";
+ ASSERT_TRUE(t1.operator->() == 0) << "release3";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "release4";
+
+ // operator=()
+ t_empty = hp;
+ ASSERT_TRUE(t_empty.is()) << "assign1";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "assign2";
+
+ t1 = t_empty.release();
+ ASSERT_TRUE(t1.is()) << "assign3";
+ ASSERT_TRUE(! t_empty.is()) << "assign4";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "assign5";
+
+ // reset()
+ hp = new Help(30);
+ ++nHelpCount;
+
+ t_empty.reset(hp);
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "reset1";
+ ASSERT_TRUE(t_empty.is()) << "reset2";
+ ASSERT_TRUE(t_empty.get() == hp) << "reset3";
+
+ // Ignore second assignment
+ t_empty = hp;
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "selfassign1";
+ ASSERT_TRUE(t_empty.is()) << "selfassign2";
+ ASSERT_TRUE(t_empty.get() == hp) << "selfassign3";
+
+ t_empty.reset(0);
+ hp = 0;
+ --nHelpCount;
+ ASSERT_TRUE(! t_empty.is()) << "reset4";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "reset5";
+
+
+ // swap
+ t1.swap(t2);
+ ASSERT_TRUE(t1->Value() == 20) << "swap1";
+ ASSERT_TRUE(t2->Value() == 10) << "swap2";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "swap3";
+
+ o3tl::swap(t1,t2);
+ ASSERT_TRUE(t1->Value() == 10) << "swap4";
+ ASSERT_TRUE(t2->Value() == 20) << "swap5";
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "swap6";
+
+ // RAII
{
- // Construction
- heap_ptr<Help>
- t_empty;
- const heap_ptr<Help>
- t0( new Help(7000) );
heap_ptr<Help>
- t1( new Help(10) );
- heap_ptr<Help>
- t2( new Help(20) );
-
- int nHelpCount = 3;
-
- CPPUNIT_ASSERT_MESSAGE("ctor1", ! t_empty.is());
- CPPUNIT_ASSERT_MESSAGE("ctor2", t0.is());
- CPPUNIT_ASSERT_MESSAGE("ctor3", (*t0).Value() == 7000 );
- CPPUNIT_ASSERT_MESSAGE("ctor4", t0->Value() == 7000 );
- CPPUNIT_ASSERT_MESSAGE("ctor5", t0.get() == t0.operator->() );
- CPPUNIT_ASSERT_MESSAGE("ctor6", t0.get() == &(*t0) );
-
- CPPUNIT_ASSERT_MESSAGE("ctor7", t1.is());
- CPPUNIT_ASSERT_MESSAGE("ctor8", (*t1).Value() == 10 );
- CPPUNIT_ASSERT_MESSAGE("ctor9", t1->Value() == 10 );
- CPPUNIT_ASSERT_MESSAGE("ctor10", t1.get() == t1.operator->() );
- CPPUNIT_ASSERT_MESSAGE("ctor11", t1.get() == &(*t1) );
-
- CPPUNIT_ASSERT_MESSAGE("ctor12", t2.operator*().Value() == 20);
- CPPUNIT_ASSERT_MESSAGE("ctor13", Help::InstanceCount_() == nHelpCount);
-
-
- // Operator safe_bool() / bool()
- CPPUNIT_ASSERT_MESSAGE("bool1", ! t_empty);
- CPPUNIT_ASSERT_MESSAGE("bool2", t0);
- CPPUNIT_ASSERT_MESSAGE("bool3", t1.is() == static_cast<bool>(t1));
-
-
- // Assignment, reset() and release()
- // Release
- Help * hp = t1.release();
- CPPUNIT_ASSERT_MESSAGE("release1", ! t1.is() );
- CPPUNIT_ASSERT_MESSAGE("release2", t1.get() == 0 );
- CPPUNIT_ASSERT_MESSAGE("release3", t1.operator->() == 0 );
- CPPUNIT_ASSERT_MESSAGE("release4", Help::InstanceCount_() == nHelpCount);
-
- // operator=()
- t_empty = hp;
- CPPUNIT_ASSERT_MESSAGE("assign1", t_empty.is() );
- CPPUNIT_ASSERT_MESSAGE("assign2", Help::InstanceCount_() == nHelpCount);
-
- t1 = t_empty.release();
- CPPUNIT_ASSERT_MESSAGE("assign3", t1.is() );
- CPPUNIT_ASSERT_MESSAGE("assign4", ! t_empty.is() );
- CPPUNIT_ASSERT_MESSAGE("assign5", Help::InstanceCount_() == nHelpCount);
-
- // reset()
- hp = new Help(30);
- ++nHelpCount;
-
- t_empty.reset(hp);
- CPPUNIT_ASSERT_MESSAGE("reset1", Help::InstanceCount_() == nHelpCount);
- CPPUNIT_ASSERT_MESSAGE("reset2", t_empty.is() );
- CPPUNIT_ASSERT_MESSAGE("reset3", t_empty.get() == hp );
-
- // Ignore second assignment
- t_empty = hp;
- CPPUNIT_ASSERT_MESSAGE("selfassign1", Help::InstanceCount_() == nHelpCount);
- CPPUNIT_ASSERT_MESSAGE("selfassign2", t_empty.is() );
- CPPUNIT_ASSERT_MESSAGE("selfassign3", t_empty.get() == hp );
-
- t_empty.reset(0);
- hp = 0;
- --nHelpCount;
- CPPUNIT_ASSERT_MESSAGE("reset4", ! t_empty.is() );
- CPPUNIT_ASSERT_MESSAGE("reset5", Help::InstanceCount_() == nHelpCount);
-
-
- // swap
- t1.swap(t2);
- CPPUNIT_ASSERT_MESSAGE("swap1", t1->Value() == 20 );
- CPPUNIT_ASSERT_MESSAGE("swap2", t2->Value() == 10 );
- CPPUNIT_ASSERT_MESSAGE("swap3", Help::InstanceCount_() == nHelpCount);
-
- o3tl::swap(t1,t2);
- CPPUNIT_ASSERT_MESSAGE("swap4", t1->Value() == 10 );
- CPPUNIT_ASSERT_MESSAGE("swap5", t2->Value() == 20 );
- CPPUNIT_ASSERT_MESSAGE("swap6", Help::InstanceCount_() == nHelpCount);
-
- // RAII
- {
- heap_ptr<Help>
- t_raii( new Help(55) );
- CPPUNIT_ASSERT_MESSAGE("raii1", Help::InstanceCount_() == nHelpCount + 1);
- }
- CPPUNIT_ASSERT_MESSAGE("raii2", Help::InstanceCount_() == nHelpCount);
+ t_raii( new Help(55) );
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount + 1) << "raii1";
}
+ ASSERT_TRUE(Help::InstanceCount_() == nHelpCount) << "raii2";
+}
- // These macros are needed by auto register mechanism.
- CPPUNIT_TEST_SUITE(heap_ptr_test);
- CPPUNIT_TEST(global);
- CPPUNIT_TEST_SUITE_END();
-}; // class heap_ptr_test
-
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION(heap_ptr_test);
diff --git a/o3tl/qa/test-range.cxx b/o3tl/qa/test-range.cxx
index 91f0e00..943f46f 100644
--- a/o3tl/qa/test-range.cxx
+++ b/o3tl/qa/test-range.cxx
@@ -22,9 +22,7 @@
#include "preextstl.h"
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
+#include "gtest/gtest.h"
#include "postextstl.h"
#include <o3tl/range.hxx>
@@ -39,7 +37,7 @@ using o3tl::range_of;
using std::size_t;
-class range_test : public CppUnit::TestFixture
+class range_test : public ::testing::Test
{
public:
@@ -51,18 +49,18 @@ public:
t2(33,33);
// ctor
- CPPUNIT_ASSERT_MESSAGE("int ctor1", t1.begin() == 12);
- CPPUNIT_ASSERT_MESSAGE("int ctor2", t1.end() == 88);
- CPPUNIT_ASSERT_MESSAGE("int ctor3", t2.begin() == 33);
- CPPUNIT_ASSERT_MESSAGE("int ctor4", t2.end() == 33);
+ ASSERT_TRUE(t1.begin() == 12) << "int ctor1";
+ ASSERT_TRUE(t1.end() == 88) << "int ctor2";
+ ASSERT_TRUE(t2.begin() == 33) << "int ctor3";
+ ASSERT_TRUE(t2.end() == 33) << "int ctor4";
// make_range
- CPPUNIT_ASSERT_MESSAGE("int make_range1", make_range(0,8).begin() == 0);
- CPPUNIT_ASSERT_MESSAGE("int make_range2", make_range(0,8).end() == 8);
+ ASSERT_TRUE(make_range(0,8).begin() == 0) << "int make_range1";
+ ASSERT_TRUE(make_range(0,8).end() == 8) << "int make_range2";
// size
- CPPUNIT_ASSERT_MESSAGE("int size1", t1.size() == size_t(t1.end() - t1.begin()) );
- CPPUNIT_ASSERT_MESSAGE("int size2", t2.size() == size_t(0) );
+ ASSERT_TRUE(t1.size() == size_t(t1.end() - t1.begin())) << "int size1";
+ ASSERT_TRUE(t2.size() == size_t(0)) << "int size2";
// contains
range<int> t3(0,10);
@@ -76,50 +74,50 @@ public:
range<int> t11(90, 100);
range<int> t12(200,200);
- CPPUNIT_ASSERT_MESSAGE("int contains1", t1.contains(t1));
- CPPUNIT_ASSERT_MESSAGE("int contains2", t1.contains(t2));
- CPPUNIT_ASSERT_MESSAGE("int contains3", ! t1.contains(t3));
- CPPUNIT_ASSERT_MESSAGE("int contains4", ! t1.contains(t4));
- CPPUNIT_ASSERT_MESSAGE("int contains5", t1.contains(t5));
- CPPUNIT_ASSERT_MESSAGE("int contains6", t1.contains(t6));
- CPPUNIT_ASSERT_MESSAGE("int contains7", t1.contains(t7));
- CPPUNIT_ASSERT_MESSAGE("int contains8", t1.contains(t8));
- CPPUNIT_ASSERT_MESSAGE("int contains9", ! t1.contains(t9));
- CPPUNIT_ASSERT_MESSAGE("int contains10", ! t1.contains(t10));
- CPPUNIT_ASSERT_MESSAGE("int contains11", ! t1.contains(t11));
- CPPUNIT_ASSERT_MESSAGE("int contains12", ! t1.contains(t12));
-
- CPPUNIT_ASSERT_MESSAGE("int contains n1", t1.contains(50));
- CPPUNIT_ASSERT_MESSAGE("int contains n2", t1.contains(12));
- CPPUNIT_ASSERT_MESSAGE("int contains n3", t1.contains(87));
- CPPUNIT_ASSERT_MESSAGE("int contains n4", ! t1.contains(3));
- CPPUNIT_ASSERT_MESSAGE("int contains n5", ! t1.contains(11));
- CPPUNIT_ASSERT_MESSAGE("int contains n6", ! t1.contains(88));
- CPPUNIT_ASSERT_MESSAGE("int contains n7", ! t1.contains(100));
+ ASSERT_TRUE(t1.contains(t1)) << "int contains1";
+ ASSERT_TRUE(t1.contains(t2)) << "int contains2";
+ ASSERT_TRUE(! t1.contains(t3)) << "int contains3";
+ ASSERT_TRUE(! t1.contains(t4)) << "int contains4";
+ ASSERT_TRUE(t1.contains(t5)) << "int contains5";
+ ASSERT_TRUE(t1.contains(t6)) << "int contains6";
+ ASSERT_TRUE(t1.contains(t7)) << "int contains7";
+ ASSERT_TRUE(t1.contains(t8)) << "int contains8";
+ ASSERT_TRUE(! t1.contains(t9)) << "int contains9";
+ ASSERT_TRUE(! t1.contains(t10)) << "int contains10";
+ ASSERT_TRUE(! t1.contains(t11)) << "int contains11";
+ ASSERT_TRUE(! t1.contains(t12)) << "int contains12";
+
+ ASSERT_TRUE(t1.contains(50)) << "int contains n1";
+ ASSERT_TRUE(t1.contains(12)) << "int contains n2";
+ ASSERT_TRUE(t1.contains(87)) << "int contains n3";
+ ASSERT_TRUE(! t1.contains(3)) << "int contains n4";
+ ASSERT_TRUE(! t1.contains(11)) << "int contains n5";
+ ASSERT_TRUE(! t1.contains(88)) << "int contains n6";
+ ASSERT_TRUE(! t1.contains(100)) << "int contains n7";
// overlaps
range<int> t13(88,99);
- CPPUNIT_ASSERT_MESSAGE("int overlaps1", t1.overlaps(t1));
- CPPUNIT_ASSERT_MESSAGE("int overlaps2", t1.overlaps(t2));
- CPPUNIT_ASSERT_MESSAGE("int overlaps3", ! t1.overlaps(t3));
- CPPUNIT_ASSERT_MESSAGE("int overlaps4", t1.overlaps(t4));
- CPPUNIT_ASSERT_MESSAGE("int overlaps5", t1.overlaps(t5));
- CPPUNIT_ASSERT_MESSAGE("int overlaps6", t1.overlaps(t6));
- CPPUNIT_ASSERT_MESSAGE("int overlaps7", t1.overlaps(t7));
- CPPUNIT_ASSERT_MESSAGE("int overlaps8", t1.overlaps(t8));
- CPPUNIT_ASSERT_MESSAGE("int overlaps9", ! t1.overlaps(t9));
- CPPUNIT_ASSERT_MESSAGE("int overlaps10", t1.overlaps(t10));
- CPPUNIT_ASSERT_MESSAGE("int overlaps11", ! t1.overlaps(t11));
- CPPUNIT_ASSERT_MESSAGE("int overlaps12", ! t1.overlaps(t12));
- CPPUNIT_ASSERT_MESSAGE("int overlaps13", ! t1.overlaps(t13));
+ ASSERT_TRUE(t1.overlaps(t1)) << "int overlaps1";
+ ASSERT_TRUE(t1.overlaps(t2)) << "int overlaps2";
+ ASSERT_TRUE(! t1.overlaps(t3)) << "int overlaps3";
+ ASSERT_TRUE(t1.overlaps(t4)) << "int overlaps4";
+ ASSERT_TRUE(t1.overlaps(t5)) << "int overlaps5";
+ ASSERT_TRUE(t1.overlaps(t6)) << "int overlaps6";
+ ASSERT_TRUE(t1.overlaps(t7)) << "int overlaps7";
+ ASSERT_TRUE(t1.overlaps(t8)) << "int overlaps8";
+ ASSERT_TRUE(! t1.overlaps(t9)) << "int overlaps9";
+ ASSERT_TRUE(t1.overlaps(t10)) << "int overlaps10";
+ ASSERT_TRUE(! t1.overlaps(t11)) << "int overlaps11";
+ ASSERT_TRUE(! t1.overlaps(t12)) << "int overlaps12";
+ ASSERT_TRUE(! t1.overlaps(t13)) << "int overlaps13";
// distance_to
- CPPUNIT_ASSERT_MESSAGE("int distance_to1", t1.distance_to(t13) == 0);
- CPPUNIT_ASSERT_MESSAGE("int distance_to2", t1.distance_to(t9) == 0);
- CPPUNIT_ASSERT_MESSAGE("int distance_to3", t1.distance_to(t11) == 2);
- CPPUNIT_ASSERT_MESSAGE("int distance_to4", t1.distance_to(t8) == -1);
- CPPUNIT_ASSERT_MESSAGE("int distance_to5", t1.distance_to(t3) == -88);
+ ASSERT_TRUE(t1.distance_to(t13) == 0) << "int distance_to1";
+ ASSERT_TRUE(t1.distance_to(t9) == 0) << "int distance_to2";
+ ASSERT_TRUE(t1.distance_to(t11) == 2) << "int distance_to3";
+ ASSERT_TRUE(t1.distance_to(t8) == -1) << "int distance_to4";
+ ASSERT_TRUE(t1.distance_to(t3) == -88) << "int distance_to5";
}
void iterator_test()
@@ -137,18 +135,18 @@ public:
t2(hv.begin()+33, hv.begin()+33);
// ctor
- CPPUNIT_ASSERT_MESSAGE("ivec ctor1", t1.begin() == hit1);
- CPPUNIT_ASSERT_MESSAGE("ivec ctor2", t1.end() == hit2);
- CPPUNIT_ASSERT_MESSAGE("ivec ctor3", t2.begin() == hv.begin()+33);
- CPPUNIT_ASSERT_MESSAGE("ivec ctor4", t2.end() == hv.begin()+33);
+ ASSERT_TRUE(t1.begin() == hit1) << "ivec ctor1";
+ ASSERT_TRUE(t1.end() == hit2) << "ivec ctor2";
+ ASSERT_TRUE(t2.begin() == hv.begin()+33) << "ivec ctor3";
+ ASSERT_TRUE(t2.end() == hv.begin()+33) << "ivec ctor4";
// make_range
- CPPUNIT_ASSERT_MESSAGE("ivec make_range1", make_range(hv.begin(), hv.begin()+8).begin() == hv.begin());
- CPPUNIT_ASSERT_MESSAGE("ivec make_range2", make_range(hv.begin(), hv.begin()+8).end() == hv.begin()+8);
+ ASSERT_TRUE(make_range(hv.begin(), hv.begin()+8).begin() == hv.begin()) << "ivec make_range1";
+ ASSERT_TRUE(make_range(hv.begin(), hv.begin()+8).end() == hv.begin()+8) << "ivec make_range2";
// size
- CPPUNIT_ASSERT_MESSAGE("ivec size1", t1.size() == size_t(t1.end() - t1.begin()) );
- CPPUNIT_ASSERT_MESSAGE("ivec size2", t2.size() == size_t(0) );
+ ASSERT_TRUE(t1.size() == size_t(t1.end() - t1.begin())) << "ivec size1";
+ ASSERT_TRUE(t2.size() == size_t(0)) << "ivec size2";
// contains
range<test_it> t3(hv.begin(), hv.begin() + 10);
@@ -162,71 +160,63 @@ public:
range<test_it> t11(hv.begin() + 90, hv.begin() + 100);
range<test_it> t12(hv.begin() + 200,hv.begin() + 200);
- CPPUNIT_ASSERT_MESSAGE("ivec contains1", t1.contains(t1));
- CPPUNIT_ASSERT_MESSAGE("ivec contains2", t1.contains(t2));
- CPPUNIT_ASSERT_MESSAGE("ivec contains3", ! t1.contains(t3));
- CPPUNIT_ASSERT_MESSAGE("ivec contains4", ! t1.contains(t4));
- CPPUNIT_ASSERT_MESSAGE("ivec contains5", t1.contains(t5));
- CPPUNIT_ASSERT_MESSAGE("ivec contains6", t1.contains(t6));
- CPPUNIT_ASSERT_MESSAGE("ivec contains7", t1.contains(t7));
- CPPUNIT_ASSERT_MESSAGE("ivec contains8", t1.contains(t8));
- CPPUNIT_ASSERT_MESSAGE("ivec contains9", ! t1.contains(t9));
- CPPUNIT_ASSERT_MESSAGE("ivec contains10", ! t1.contains(t10));
- CPPUNIT_ASSERT_MESSAGE("ivec contains11", ! t1.contains(t11));
- CPPUNIT_ASSERT_MESSAGE("ivec contains12", ! t1.contains(t12));
-
- CPPUNIT_ASSERT_MESSAGE("ivec contains n1", t1.contains(hv.begin() + 50));
- CPPUNIT_ASSERT_MESSAGE("ivec contains n2", t1.contains(hit1));
- CPPUNIT_ASSERT_MESSAGE("ivec contains n3", t1.contains(hv.begin() + 87));
- CPPUNIT_ASSERT_MESSAGE("ivec contains n4", ! t1.contains(hv.begin() + 3));
- CPPUNIT_ASSERT_MESSAGE("ivec contains n5", ! t1.contains(hv.begin() + 11));
- CPPUNIT_ASSERT_MESSAGE("ivec contains n6", ! t1.contains(hit2));
- CPPUNIT_ASSERT_MESSAGE("ivec contains n7", ! t1.contains(hv.begin() + 100));
+ ASSERT_TRUE(t1.contains(t1)) << "ivec contains1";
+ ASSERT_TRUE(t1.contains(t2)) << "ivec contains2";
+ ASSERT_TRUE(! t1.contains(t3)) << "ivec contains3";
+ ASSERT_TRUE(! t1.contains(t4)) << "ivec contains4";
+ ASSERT_TRUE(t1.contains(t5)) << "ivec contains5";
+ ASSERT_TRUE(t1.contains(t6)) << "ivec contains6";
+ ASSERT_TRUE(t1.contains(t7)) << "ivec contains7";
+ ASSERT_TRUE(t1.contains(t8)) << "ivec contains8";
+ ASSERT_TRUE(! t1.contains(t9)) << "ivec contains9";
+ ASSERT_TRUE(! t1.contains(t10)) << "ivec contains10";
+ ASSERT_TRUE(! t1.contains(t11)) << "ivec contains11";
+ ASSERT_TRUE(! t1.contains(t12)) << "ivec contains12";
+
+ ASSERT_TRUE(t1.contains(hv.begin() + 50)) << "ivec contains n1";
+ ASSERT_TRUE(t1.contains(hit1)) << "ivec contains n2";
+ ASSERT_TRUE(t1.contains(hv.begin() + 87)) << "ivec contains n3";
+ ASSERT_TRUE(! t1.contains(hv.begin() + 3)) << "ivec contains n4";
+ ASSERT_TRUE(! t1.contains(hv.begin() + 11)) << "ivec contains n5";
+ ASSERT_TRUE(! t1.contains(hit2)) << "ivec contains n6";
+ ASSERT_TRUE(! t1.contains(hv.begin() + 100)) << "ivec contains n7";
// overlaps
range<test_it> t13(hit2, hv.begin() + 99);
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps1", t1.overlaps(t1));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps2", t1.overlaps(t2));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps3", ! t1.overlaps(t3));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps4", t1.overlaps(t4));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps5", t1.overlaps(t5));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps6", t1.overlaps(t6));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps7", t1.overlaps(t7));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps8", t1.overlaps(t8));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps9", ! t1.overlaps(t9));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps10", t1.overlaps(t10));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps11", ! t1.overlaps(t11));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps12", ! t1.overlaps(t12));
- CPPUNIT_ASSERT_MESSAGE("ivec overlaps13", ! t1.overlaps(t13));
+ ASSERT_TRUE(t1.overlaps(t1)) << "ivec overlaps1";
+ ASSERT_TRUE(t1.overlaps(t2)) << "ivec overlaps2";
+ ASSERT_TRUE(! t1.overlaps(t3)) << "ivec overlaps3";
+ ASSERT_TRUE(t1.overlaps(t4)) << "ivec overlaps4";
+ ASSERT_TRUE(t1.overlaps(t5)) << "ivec overlaps5";
+ ASSERT_TRUE(t1.overlaps(t6)) << "ivec overlaps6";
+ ASSERT_TRUE(t1.overlaps(t7)) << "ivec overlaps7";
+ ASSERT_TRUE(t1.overlaps(t8)) << "ivec overlaps8";
+ ASSERT_TRUE(! t1.overlaps(t9)) << "ivec overlaps9";
+ ASSERT_TRUE(t1.overlaps(t10)) << "ivec overlaps10";
+ ASSERT_TRUE(! t1.overlaps(t11)) << "ivec overlaps11";
+ ASSERT_TRUE(! t1.overlaps(t12)) << "ivec overlaps12";
+ ASSERT_TRUE(! t1.overlaps(t13)) << "ivec overlaps13";
// distance_to
- CPPUNIT_ASSERT_MESSAGE("ivec distance_to1", t1.distance_to(t13) == 0);
- CPPUNIT_ASSERT_MESSAGE("ivec distance_to2", t1.distance_to(t8) == -1);
- CPPUNIT_ASSERT_MESSAGE("ivec distance_to3", t1.distance_to(t9) == 0);
- CPPUNIT_ASSERT_MESSAGE("ivec distance_to4", t1.distance_to(t11) == 2);
- CPPUNIT_ASSERT_MESSAGE("ivec distance_to5", t1.distance_to(t3) == -88);
+ ASSERT_TRUE(t1.distance_to(t13) == 0) << "ivec distance_to1";
+ ASSERT_TRUE(t1.distance_to(t8) == -1) << "ivec distance_to2";
+ ASSERT_TRUE(t1.distance_to(t9) == 0) << "ivec distance_to3";
+ ASSERT_TRUE(t1.distance_to(t11) == 2) << "ivec distance_to4";
+ ASSERT_TRUE(t1.distance_to(t3) == -88) << "ivec distance_to5";
const std::vector< int* > h2(20, (int*)0);
std::deque< double > h3(30, 0.0);
- CPPUNIT_ASSERT_MESSAGE("range_of1", range_of(h2).begin() == h2.begin());
- CPPUNIT_ASSERT_MESSAGE("range_of2", range_of(h3).end() == h3.end());
+ ASSERT_TRUE(range_of(h2).begin() == h2.begin()) << "range_of1";
+ ASSERT_TRUE(range_of(h3).end() == h3.end()) << "range_of2";
}
- // insert your test code here.
- void global()
- {
- int_test();
- iterator_test();
- }
-
-
- // These macros are needed by auto register mechanism.
- CPPUNIT_TEST_SUITE(range_test);
- CPPUNIT_TEST(global);
- CPPUNIT_TEST_SUITE_END();
}; // class range_test
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION(range_test);
+TEST_F(range_test, global)
+{
+ int_test();
+ iterator_test();
+}
+
diff --git a/o3tl/qa/test-vector_pool.cxx b/o3tl/qa/test-vector_pool.cxx
index aa0f31a..c8af499 100644
--- a/o3tl/qa/test-vector_pool.cxx
+++ b/o3tl/qa/test-vector_pool.cxx
@@ -22,71 +22,59 @@
// autogenerated file with codegen.pl
#include "preextstl.h"
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
+#include "gtest/gtest.h"
#include "postextstl.h"
#include <o3tl/vector_pool.hxx>
using namespace ::o3tl;
-class vector_pool_test : public CppUnit::TestFixture
+class vector_pool_test : public ::testing::Test
{
public:
- void testPoolBasics()
- {
- vector_pool<int> aPool;
-
- std::ptrdiff_t nIdx1 = aPool.alloc();
- std::ptrdiff_t nIdx2 = aPool.alloc();
- std::ptrdiff_t nIdx3 = aPool.alloc();
+};
- CPPUNIT_ASSERT_MESSAGE("allocator idx order 1", nIdx1 < nIdx2 );
- CPPUNIT_ASSERT_MESSAGE("allocator idx order 2", nIdx2 < nIdx3 );
+TEST_F(vector_pool_test, testPoolBasics)
+{
+ vector_pool<int> aPool;
- aPool.free(nIdx2);
- aPool.free(nIdx3);
+ std::ptrdiff_t nIdx1 = aPool.alloc();
+ std::ptrdiff_t nIdx2 = aPool.alloc();
+ std::ptrdiff_t nIdx3 = aPool.alloc();
- nIdx2 = aPool.alloc();
- nIdx3 = aPool.alloc();
+ ASSERT_TRUE(nIdx1 < nIdx2) << "allocator idx order 1";
+ ASSERT_TRUE(nIdx2 < nIdx3) << "allocator idx order 2";
- CPPUNIT_ASSERT_MESSAGE("allocator idx order 1 after fragmentation", nIdx1 < nIdx3 );
- CPPUNIT_ASSERT_MESSAGE("allocator idx order 2 after fragmentation", nIdx3 < nIdx2 );
- }
+ aPool.free(nIdx2);
+ aPool.free(nIdx3);
- void testPoolValueSemantics()
- {
- vector_pool<int> aPool;
+ nIdx2 = aPool.alloc();
+ nIdx3 = aPool.alloc();
- std::ptrdiff_t nIdx1 = aPool.store(0);
- CPPUNIT_ASSERT_MESSAGE("allocator value semantics 1", aPool.get(nIdx1) == 0 );
+ ASSERT_TRUE(nIdx1 < nIdx3) << "allocator idx order 1 after fragmentation";
+ ASSERT_TRUE(nIdx3 < nIdx2) << "allocator idx order 2 after fragmentation";
+}
- std::ptrdiff_t nIdx2 = aPool.store(1);
- CPPUNIT_ASSERT_MESSAGE("allocator value semantics 2", aPool.get(nIdx2) == 1 );
+TEST_F(vector_pool_test, testPoolValueSemantics)
+{
+ vector_pool<int> aPool;
- std::ptrdiff_t nIdx3 = aPool.store(2);
- CPPUNIT_ASSERT_MESSAGE("allocator value semantics 3", aPool.get(nIdx3) == 2 );
+ std::ptrdiff_t nIdx1 = aPool.store(0);
+ ASSERT_TRUE(aPool.get(nIdx1) == 0) << "allocator value semantics 1";
- aPool.free(nIdx2);
- aPool.free(nIdx3);
+ std::ptrdiff_t nIdx2 = aPool.store(1);
+ ASSERT_TRUE(aPool.get(nIdx2) == 1) << "allocator value semantics 2";
- nIdx2 = aPool.store(1);
- CPPUNIT_ASSERT_MESSAGE("allocator value semantics 2 after fragmentation", aPool.get(nIdx2) == 1 );
+ std::ptrdiff_t nIdx3 = aPool.store(2);
+ ASSERT_TRUE(aPool.get(nIdx3) == 2) << "allocator value semantics 3";
- nIdx3 = aPool.store(2);
- CPPUNIT_ASSERT_MESSAGE("allocator value semantics 3 after fragmentation", aPool.get(nIdx3) == 2 );
- }
+ aPool.free(nIdx2);
+ aPool.free(nIdx3);
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
- // because these macros are need by auto register mechanism.
+ nIdx2 = aPool.store(1);
+ ASSERT_TRUE(aPool.get(nIdx2) == 1) << "allocator value semantics 2 after fragmentation";
- CPPUNIT_TEST_SUITE(vector_pool_test);
- CPPUNIT_TEST(testPoolBasics);
- CPPUNIT_TEST(testPoolValueSemantics);
- CPPUNIT_TEST_SUITE_END();
-};
+ nIdx3 = aPool.store(2);
+ ASSERT_TRUE(aPool.get(nIdx3) == 2) << "allocator value semantics 3 after fragmentation";
+}
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION(vector_pool_test);
commit 800ee3d0e0d43d4ea3ec10f9ea73fe8d68a40c18
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Aug 30 08:42:01 2015 +0000
Remove unused main/desktop/qa/deployment_misc/version.map
diff --git a/desktop/qa/deployment_misc/version.map b/desktop/qa/deployment_misc/version.map
deleted file mode 100644
index ec49c45..0000000
--- a/desktop/qa/deployment_misc/version.map
+++ /dev/null
@@ -1,30 +0,0 @@
-#**************************************************************
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-
-UDK_3_0_0 {
- global:
- cppunitTestPlugIn;
-
- local:
- *;
-};
commit 1608655b290700db0dd8a6fc1b0951411c59463b
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Aug 30 08:41:13 2015 +0000
#i125003# migrate main/desktop from cppunit to Google Test
diff --git a/desktop/qa/deployment_misc/main.cxx b/desktop/qa/deployment_misc/main.cxx
new file mode 100644
index 0000000..df14e5b
--- /dev/null
+++ b/desktop/qa/deployment_misc/main.cxx
@@ -0,0 +1,28 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "gtest/gtest.h"
+
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk
index 4fcf6d6..aa55209 100644
--- a/desktop/qa/deployment_misc/makefile.mk
+++ b/desktop/qa/deployment_misc/makefile.mk
@@ -20,18 +20,6 @@
#**************************************************************
-
-.IF "$(WITH_CPPUNIT)" != "YES" || "$(GUI)" == "OS2"
-
- at all:
-.IF "$(GUI)" == "OS2"
- @echo "Skipping, cppunit broken."
-.ELIF "$(WITH_CPPUNIT)" != "YES"
- @echo "cppunit disabled. nothing do do."
-.END
-
-.ENDIF "$(WITH_CPPUNIT)" != "YES" || "$(GUI)" == "OS2"
-
PRJ := ..$/..
PRJNAME := desktop
.IF "$(GUI)" == "OS2"
@@ -45,7 +33,12 @@ ENABLE_EXCEPTIONS := TRUE
.INCLUDE: settings.mk
.INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+ @echo unit tests are disabled. Nothing to do.
+
+.ELSE
+
# TODO: On Windows, test_dp_version.cxx fails due to BOOL redefinition between
# windef.h and tools/solar.h caused by including "precompiled_desktop.hxx"; this
@@ -53,15 +46,12 @@ CFLAGSCXX += $(CPPUNIT_CFLAGS)
# 112600:
CFLAGSCXX += -DDISABLE_PCH_HACK
-SHL1TARGET = $(TARGET)
-SHL1OBJS = $(SLO)$/test_dp_version.obj
-SHL1STDLIBS = $(CPPUNITLIB) $(DEPLOYMENTMISCLIB) $(SALLIB)
-SHL1VERSIONMAP = version.map
-SHL1RPATH = NONE
-SHL1IMPLIB = i$(SHL1TARGET)
-DEF1NAME = $(SHL1TARGET)
-
-SLOFILES = $(SHL1OBJS)
+APP1TARGET = $(TARGET)
+APP1OBJS = $(SLO)$/test_dp_version.obj $(SLO)$/main.obj
+APP1STDLIBS = $(GTESTLIB) $(DEPLOYMENTMISCLIB) $(SALLIB)
+APP1RPATH = NONE
+APP1TEST = enabled
.INCLUDE: target.mk
-.INCLUDE : _cppunit.mk
+
+.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
diff --git a/desktop/qa/deployment_misc/test_dp_version.cxx b/desktop/qa/deployment_misc/test_dp_version.cxx
index 5592216..56ab39a 100644
--- a/desktop/qa/deployment_misc/test_dp_version.cxx
+++ b/desktop/qa/deployment_misc/test_dp_version.cxx
@@ -28,10 +28,7 @@
#include <cstddef>
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
+#include "gtest/gtest.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
@@ -39,16 +36,11 @@
namespace {
-class Test: public ::CppUnit::TestFixture {
+class Test: public ::testing::Test {
public:
- void test();
-
- CPPUNIT_TEST_SUITE(Test);
- CPPUNIT_TEST(test);
- CPPUNIT_TEST_SUITE_END();
};
-void Test::test() {
+TEST_F(Test, test) {
struct Data {
rtl::OUString version1;
rtl::OUString version2;
@@ -70,20 +62,17 @@ void Test::test() {
::dp_misc::GREATER }
};
for (::std::size_t i = 0; i < sizeof data / sizeof (Data); ++i) {
- CPPUNIT_ASSERT_EQUAL(
+ ASSERT_EQ(
data[i].order,
::dp_misc::compareVersions(data[i].version1, data[i].version2));
static ::dp_misc::Order const reverse[3] = {
::dp_misc::GREATER, ::dp_misc::EQUAL, ::dp_misc::LESS
};
- CPPUNIT_ASSERT_EQUAL(
+ ASSERT_EQ(
reverse[data[i].order],
::dp_misc::compareVersions(data[i].version2, data[i].version1));
}
}
-CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
-
-CPPUNIT_PLUGIN_IMPLEMENT();
commit 62e7650f158c2441dca7d7ba8e50523edc58600c
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Aug 30 08:29:07 2015 +0000
Remove unused main/cppu/qa/version.map
diff --git a/cppu/qa/version.map b/cppu/qa/version.map
deleted file mode 100644
index f12a8b2..0000000
--- a/cppu/qa/version.map
+++ /dev/null
@@ -1,30 +0,0 @@
-#**************************************************************
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-
-UDK_3_0_0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
commit da44b7365bd3b8fc8d6109c92cef73cd5ea34c60
Author: Damjan Jovanovic <damjan at apache.org>
Date: Sun Aug 30 08:26:13 2015 +0000
#i125003# migrate main/cppu from cppunit to Google Test and run it on every build.
diff --git a/cppu/prj/build.lst b/cppu/prj/build.lst
index a22ca9e..2a290d8 100644
--- a/cppu/prj/build.lst
+++ b/cppu/prj/build.lst
@@ -10,3 +10,4 @@ cu cppu\source\UnsafeBridge nmake - all cu_UnsafeBridge cu_inc NULL
cu cppu\source\AffineBridge nmake - all cu_AffineBridge cu_inc NULL
cu cppu\source\LogBridge nmake - all cu_LogBridge cu_inc NULL
cu cppu\util nmake - all cu_util cu_thpool cu_typelib cu_cppu cu_uno cu_helper_purpenv cu_UnsafeBridge cu_AffineBridge cu_LogBridge NULL
+cu cppu\qa nmake - all cu_qa cu_inc cu_thpool cu_typelib cu_cppu cu_uno cu_helper_purpenv cu_UnsafeBridge cu_AffineBridge cu_LogBridge NULL
diff --git a/cppu/qa/main.cxx b/cppu/qa/main.cxx
new file mode 100644
index 0000000..df14e5b
--- /dev/null
+++ b/cppu/qa/main.cxx
@@ -0,0 +1,28 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "gtest/gtest.h"
+
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/cppu/qa/makefile.mk b/cppu/qa/makefile.mk
index 4e26bd5..da2d879 100644
--- a/cppu/qa/makefile.mk
+++ b/cppu/qa/makefile.mk
@@ -29,47 +29,42 @@ ENABLE_EXCEPTIONS := TRUE
.INCLUDE: settings.mk
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+ @echo unit tests are disabled. Nothing to do.
+
+.ELSE
-DLLPRE = # no leading "lib" on .so files
INCPRE += $(MISC)$/$(TARGET)$/inc
-SHL1TARGET = $(TARGET)_any
-SHL1OBJS = $(SLO)$/test_any.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
-SHL1VERSIONMAP = version.map
-SHL1IMPLIB = i$(SHL1TARGET)
-DEF1NAME = $(SHL1TARGET)
-
-SHL2TARGET = $(TARGET)_unotype
-SHL2OBJS = $(SLO)$/test_unotype.obj
-SHL2STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
-SHL2VERSIONMAP = version.map
-SHL2IMPLIB = i$(SHL2TARGET)
-DEF2NAME = $(SHL2TARGET)
-
-SHL3TARGET = $(TARGET)_reference
-SHL3OBJS = $(SLO)$/test_reference.obj
-SHL3STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
-SHL3VERSIONMAP = version.map
-SHL3IMPLIB = i$(SHL3TARGET)
-DEF3NAME = $(SHL3TARGET)
-
-SHL4TARGET = $(TARGET)_recursion
-SHL4OBJS = $(SLO)$/test_recursion.obj
-SHL4STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
-SHL4VERSIONMAP = version.map
-SHL4IMPLIB = i$(SHL4TARGET)
-DEF4NAME = $(SHL4TARGET)
-
-SLOFILES = $(SHL1OBJS) $(SHL2OBJS) $(SHL3OBJS) $(SHL4OBJS)
+APP1TARGET = $(TARGET)_any
+APP1OBJS = $(SLO)$/test_any.obj $(SLO)$/main.obj
+APP1STDLIBS = $(CPPULIB) $(GTESTLIB) $(TESTSHL2LIB) $(SALLIB)
+APP1RPATH = NONE
+APP1TEST = enabled
+
+APP2TARGET = $(TARGET)_unotype
+APP2OBJS = $(SLO)$/test_unotype.obj $(SLO)$/main.obj
+APP2STDLIBS = $(CPPULIB) $(GTESTLIB) $(TESTSHL2LIB) $(SALLIB)
+APP2RPATH = NONE
+APP2TEST = enabled
+
+APP3TARGET = $(TARGET)_reference
+APP3OBJS = $(SLO)$/test_reference.obj $(SLO)$/main.obj
+APP3STDLIBS = $(CPPULIB) $(GTESTLIB) $(TESTSHL2LIB) $(SALLIB)
+APP3RPATH = NONE
+APP3TEST = enabled
+
+APP4TARGET = $(TARGET)_recursion
+APP4OBJS = $(SLO)$/test_recursion.obj $(SLO)$/main.obj
+APP4STDLIBS = $(CPPULIB) $(GTESTLIB) $(TESTSHL2LIB) $(SALLIB)
+APP4RPATH = NONE
+APP4TEST = enabled
.INCLUDE: target.mk
-ALLTAR: test
-
-$(SHL1OBJS): $(MISC)$/$(TARGET).cppumaker.flag
+$(APP1OBJS): $(MISC)$/$(TARGET).cppumaker.flag
$(MISC)$/$(TARGET).cppumaker.flag: $(MISC)$/$(TARGET).rdb
- $(MKDIRHIER) $(MISC)$/$(TARGET)$/inc
@@ -85,8 +80,4 @@ $(MISC)$/$(TARGET)$/types.urd: types.idl
- $(MKDIR) $(MISC)$/$(TARGET)
$(IDLC) -O$(MISC)$/$(TARGET) -I$(SOLARIDLDIR) -cid -we $<
-test .PHONY: $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN) $(SHL4TARGETN)
- $(TESTSHL2) $(SHL1TARGETN)
- $(TESTSHL2) $(SHL2TARGETN)
- $(TESTSHL2) $(SHL3TARGETN)
- $(TESTSHL2) $(SHL4TARGETN)
+.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
\ No newline at end of file
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 5aa74c1..4567d57 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -51,13 +51,13 @@
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/uno/Type.hxx"
#include "com/sun/star/uno/XInterface.hpp"
-#include "testshl/simpleheader.hxx"
#include "osl/diagnose.h"
#include "osl/interlck.h"
#include "rtl/string.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include "gtest/gtest.h"
namespace {
@@ -190,2137 +190,2006 @@ public:
}
};
-class Test: public CppUnit::TestFixture {
+class Test: public ::testing::Test {
public:
- void testVoid();
-
- void testBoolean();
-
- void testByte();
-
- void testShort();
-
- void testUnsignedShort();
-
- void testLong();
-
- void testUnsignedLong();
-
- void testHyper();
-
- void testUnsignedHyper();
-
- void testFloat();
-
- void testDouble();
-
- void testChar();
-
- void testString();
-
- void testType();
-
- void testSequence();
-
- void testEnum();
-
- void testStruct();
-
- void testPoly();
-
- void testException();
-
- void testInterface();
-
- void testNull();
-
- CPPUNIT_TEST_SUITE(Test);
- CPPUNIT_TEST(testVoid);
- CPPUNIT_TEST(testBoolean);
- CPPUNIT_TEST(testByte);
- CPPUNIT_TEST(testShort);
- CPPUNIT_TEST(testUnsignedShort);
- CPPUNIT_TEST(testLong);
- CPPUNIT_TEST(testUnsignedLong);
- CPPUNIT_TEST(testHyper);
- CPPUNIT_TEST(testUnsignedHyper);
- CPPUNIT_TEST(testFloat);
- CPPUNIT_TEST(testDouble);
- CPPUNIT_TEST(testChar);
- CPPUNIT_TEST(testString);
- CPPUNIT_TEST(testType);
- CPPUNIT_TEST(testSequence);
- CPPUNIT_TEST(testEnum);
- CPPUNIT_TEST(testStruct);
- CPPUNIT_TEST(testPoly);
- CPPUNIT_TEST(testException);
- CPPUNIT_TEST(testInterface);
- CPPUNIT_TEST(testNull);
- CPPUNIT_TEST_SUITE_END();
};
-void Test::testVoid() {
+TEST_F(Test, testVoid) {
css::uno::Any a;
- CPPUNIT_ASSERT(a.getValueType() == getVoidCppuType());
+ ASSERT_TRUE(a.getValueType() == getVoidCppuType());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(
+ !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) << "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(
+ !(a >>= b) && b == getCppuType< rtl::OUString >()) << "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>", !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) << "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testBoolean() {
+TEST_F(Test, testBoolean) {
css::uno::Any a(false);
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Bool >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_Bool >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", (a >>= b) && !b);
+ ASSERT_TRUE((a >>= b) && !b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a >>= b) && !b);
+ ASSERT_TRUE((a >>= b) && !b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
if (boost::is_same< sal_uInt8, sal_Bool >::value) {
- CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a >>= b) && b == 0);
+ ASSERT_TRUE((a >>= b) && b == 0) << "@sal_uInt8";
} else {
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testByte() {
+TEST_F(Test, testByte) {
css::uno::Any a(static_cast< sal_Int8 >(1));
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int8 >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int8 >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "double";
}
{
sal_Unicode b = '2';
if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
- CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "@sal_Unicode";
} else {
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testShort() {
+TEST_F(Test, testShort) {
css::uno::Any a(static_cast< sal_Int16 >(1));
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int16 >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int16 >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "double";
}
{
sal_Unicode b = '2';
if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
- CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "@sal_Unicode";
} else {
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testUnsignedShort() {
+TEST_F(Test, testUnsignedShort) {
sal_uInt16 n = 1;
css::uno::Any a(&n, getCppuType(static_cast< sal_uInt16 const * >(0)));
- CPPUNIT_ASSERT(
+ ASSERT_TRUE(
a.getValueType() == getCppuType(static_cast< sal_uInt16 const * >(0)));
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "double";
}
{
sal_Unicode b = '2';
if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
- CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "@sal_Unicode";
} else {
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testLong() {
+TEST_F(Test, testLong) {
css::uno::Any a(static_cast< sal_Int32 >(1));
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int32 >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int32 >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testUnsignedLong() {
+TEST_F(Test, testUnsignedLong) {
css::uno::Any a(static_cast< sal_uInt32 >(1));
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt32 >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_uInt32 >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testHyper() {
+TEST_F(Test, testHyper) {
css::uno::Any a(static_cast< sal_Int64 >(1));
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int64 >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int64 >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testUnsignedHyper() {
+TEST_F(Test, testUnsignedHyper) {
css::uno::Any a(static_cast< sal_uInt64 >(1));
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt64 >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< sal_uInt64 >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testFloat() {
+TEST_F(Test, testFloat) {
css::uno::Any a(1.f);
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< float >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< float >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
}
{
sal_Int32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
}
{
sal_uInt32 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
}
{
sal_Int64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
}
{
sal_uInt64 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
}
{
float b = 2;
- CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "float";
}
{
double b = 2;
- CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
+ ASSERT_TRUE((a >>= b) && b == 1) << "double";
}
{
sal_Unicode b = '2';
- CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
+ ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
}
{
rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
- CPPUNIT_ASSERT_MESSAGE(
- "rtl::OUString",
- !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
+ ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
+ "rtl::OUString";
}
{
css::uno::Type b(getCppuType< rtl::OUString >());
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Type",
- !(a >>= b) && b == getCppuType< rtl::OUString >());
+ ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
+ "css::uno::Type";
}
{
css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
- CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
+ ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
}
{
css::uno::Sequence< rtl::OUString > b(2);
- CPPUNIT_ASSERT_MESSAGE(
- "css::uno::Sequence<rtl::OUString>",
- !(a >>= b) && b.getLength() == 2);
+ ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
+ "css::uno::Sequence<rtl::OUString>";
}
{
Enum1 b = Enum1_M2;
- CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
+ ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
}
{
Struct1 b(2);
- CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
}
{
Exception1 b(
rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
- CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
+ ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
}
{
css::uno::Reference< Interface1 > i(new Impl1);
css::uno::Reference< Interface1 > b(i);
- CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
+ ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
}
}
-void Test::testDouble() {
+TEST_F(Test, testDouble) {
css::uno::Any a(1.);
- CPPUNIT_ASSERT(a.getValueType() == getCppuType< double >());
+ ASSERT_TRUE(a.getValueType() == getCppuType< double >());
{
bool b = true;
- CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "bool";
}
{
sal_Bool b = true;
- CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
+ ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
}
{
sal_Int8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
}
{
sal_uInt8 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
}
{
sal_Int16 b = 2;
- CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
+ ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
}
{
sal_uInt16 b = 2;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list