You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2015/09/03 19:11:28 UTC

svn commit: r1701079 - in /openoffice/trunk/main/sal/qa/osl/setthreadname: makefile.mk test-setthreadname.cxx

Author: damjan
Date: Thu Sep  3 17:11:28 2015
New Revision: 1701079

URL: http://svn.apache.org/r1701079
Log:
#i125003# migrate main/sal/qa/osl/setthreadname from cppunit to Google Test.


Modified:
    openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk
    openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx

Modified: openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk?rev=1701079&r1=1701078&r2=1701079&view=diff
==============================================================================
--- openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk (original)
+++ openoffice/trunk/main/sal/qa/osl/setthreadname/makefile.mk Thu Sep  3 17:11:28 2015
@@ -33,21 +33,20 @@ ENABLE_EXCEPTIONS = TRUE
 
 .INCLUDE: settings.mk
 
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
-
-DLLPRE =
-
-SHL1IMPLIB = i$(SHL1TARGET)
-SHL1OBJS = $(SLO)/test-setthreadname.obj
-SHL1RPATH = NONE
-SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
-SHL1TARGET = test-setthreadname
-SHL1VERSIONMAP = version.map
-DEF1NAME = $(SHL1TARGET)
-
-SLOFILES = $(SHL1OBJS)
+.IF "$(ENABLE_UNIT_TESTS)" != "YES"
+all:
+	@echo unit tests are disabled. Nothing to do.
+
+.ELSE
+
+APP1OBJS = $(SLO)/test-setthreadname.obj
+APP1RPATH = NONE
+APP1STDLIBS = $(GTESTLIB) $(SALLIB)
+APP1TARGET = test-setthreadname
+APP1TEST = enabled
 
 .INCLUDE: target.mk
-.INCLUDE: _cppunit.mk
+
+.ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES"
 
 .END

Modified: openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx?rev=1701079&r1=1701078&r2=1701079&view=diff
==============================================================================
--- openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx (original)
+++ openoffice/trunk/main/sal/qa/osl/setthreadname/test-setthreadname.cxx Thu Sep  3 17:11:28 2015
@@ -29,10 +29,7 @@
 #include <limits>
 
 #include "boost/noncopyable.hpp"
-#include "cppunit/TestAssert.h"
-#include "cppunit/TestFixture.h"
-#include "cppunit/extensions/HelperMacros.h"
-#include "cppunit/plugin/TestPlugIn.h"
+#include "gtest/gtest.h"
 #include "osl/thread.hxx"
 
 namespace {
@@ -61,23 +58,20 @@ void TestThread::run() {
     }
 }
 
-class Test: public CppUnit::TestFixture {
-private:
-    CPPUNIT_TEST_SUITE(Test);
-    CPPUNIT_TEST(test);
-    CPPUNIT_TEST_SUITE_END();
-
-    void test();
+class Test: public ::testing::Test {
 };
 
-void Test::test() {
+TEST_F(Test, test) {
     TestThread t;
     t.create();
     t.join();
 }
 
-CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 }
 
-CPPUNIT_PLUGIN_IMPLEMENT();
+int main(int argc, char **argv)
+{
+    ::testing::InitGoogleTest(&argc, argv);
+    return RUN_ALL_TESTS();
+}