You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2019/04/20 11:24:45 UTC

svn commit: r1857860 - in /openoffice/branches/AOO42X: ./ main/tools/GoogleTest_tools_pathutils.mk main/tools/Module_tools.mk main/tools/qa/test_pathutils.cxx

Author: mseidel
Date: Sat Apr 20 11:24:45 2019
New Revision: 1857860

URL: http://svn.apache.org/viewvc?rev=1857860&view=rev
Log:
Merged r1856677 from trunk

 - Port a main/tools unit test from cppunit to gtest.

Patch by: Damjan

Added:
    openoffice/branches/AOO42X/main/tools/GoogleTest_tools_pathutils.mk
      - copied unchanged from r1856677, openoffice/trunk/main/tools/GoogleTest_tools_pathutils.mk
Modified:
    openoffice/branches/AOO42X/   (props changed)
    openoffice/branches/AOO42X/main/tools/Module_tools.mk
    openoffice/branches/AOO42X/main/tools/qa/test_pathutils.cxx

Propchange: openoffice/branches/AOO42X/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Apr 20 11:24:45 2019
@@ -9,4 +9,4 @@
 /openoffice/branches/ia2:1417739-1541842
 /openoffice/branches/ooxml-osba:1546391,1546395,1546574,1546934,1547030,1547392,1551920,1551954,1551958,1552283
 /openoffice/branches/rejuvenate01:1480411,1534063,1534098,1536312,1549902,1560617
-/openoffice/trunk:1851110-1851111,1851115,1851118,1851121,1851206,1851214-1851215,1851443,1851449,1851464,1851575,1851634,1851637,1851639,1851715,1851753,1851813,1851987,1852008,1852010,1852029,1852046,1852174,1852187,1852190,1852197,1852430,1852438,1852623-1852624,1852841,1852965,1853175,1853245,1853252,1853285-1853286,1853299,1853319,1853327,1853443-1853444,1853456,1853466,1853504,1853558,1853643,1853668,1853670,1853726,1853742,1853972,1853976,1854051,1854065,1854176,1854196,1854324-1854325,1854473,1854519,1854740,1854788,1854852,1854933,1855053,1855140,1855181,1855246,1855509,1855523,1855617,1855647,1855649,1855778,1855813,1855926,1855947,1856034,1856079,1856113,1856224,1856555,1856833,1856899,1857186,1857302,1857311,1857450-1857451
+/openoffice/trunk:1851110-1851111,1851115,1851118,1851121,1851206,1851214-1851215,1851443,1851449,1851464,1851575,1851634,1851637,1851639,1851715,1851753,1851813,1851987,1852008,1852010,1852029,1852046,1852174,1852187,1852190,1852197,1852430,1852438,1852623-1852624,1852841,1852965,1853175,1853245,1853252,1853285-1853286,1853299,1853319,1853327,1853443-1853444,1853456,1853466,1853504,1853558,1853643,1853668,1853670,1853726,1853742,1853972,1853976,1854051,1854065,1854176,1854196,1854324-1854325,1854473,1854519,1854740,1854788,1854852,1854933,1855053,1855140,1855181,1855246,1855509,1855523,1855617,1855647,1855649,1855778,1855813,1855926,1855947,1856034,1856079,1856113,1856224,1856555,1856677,1856833,1856899,1857186,1857302,1857311,1857450-1857451

Modified: openoffice/branches/AOO42X/main/tools/Module_tools.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO42X/main/tools/Module_tools.mk?rev=1857860&r1=1857859&r2=1857860&view=diff
==============================================================================
--- openoffice/branches/AOO42X/main/tools/Module_tools.mk (original)
+++ openoffice/branches/AOO42X/main/tools/Module_tools.mk Sat Apr 20 11:24:45 2019
@@ -37,6 +37,7 @@ $(eval $(call gb_Module_add_targets,tool
 ifeq ($(ENABLE_UNIT_TESTS),YES)
 $(eval $(call gb_Module_add_check_targets,tools,\
 	GoogleTest_tools_fractiontest \
+	GoogleTest_tools_pathutils \
 ))
 endif
 

Modified: openoffice/branches/AOO42X/main/tools/qa/test_pathutils.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO42X/main/tools/qa/test_pathutils.cxx?rev=1857860&r1=1857859&r2=1857860&view=diff
==============================================================================
--- openoffice/branches/AOO42X/main/tools/qa/test_pathutils.cxx (original)
+++ openoffice/branches/AOO42X/main/tools/qa/test_pathutils.cxx Sat Apr 20 11:24:45 2019
@@ -26,7 +26,7 @@
 
 #include <cwchar>
 
-#include "testshl/simpleheader.hxx"
+#include "gtest/gtest.h"
 #include "tools/pathutils.hxx"
 
 namespace {
@@ -38,8 +38,8 @@ void buildPath(
     wchar_t p[MAX_PATH];
     wchar_t * e = tools::buildPath(
         p, front, front + std::wcslen(front), back, std::wcslen(back));
-    CPPUNIT_ASSERT_EQUAL(p + std::wcslen(path), e);
-    CPPUNIT_ASSERT_EQUAL(0, std::wcscmp(path, p));
+    ASSERT_EQ(p + std::wcslen(path), e);
+    ASSERT_EQ(0, std::wcscmp(path, p));
 #else
     (void) front;
     (void) back;
@@ -47,16 +47,18 @@ void buildPath(
 #endif
 }
 
-class Test: public CppUnit::TestFixture {
+class Test: public ::testing::Test {
 public:
-    void testBuildPath();
-
-    CPPUNIT_TEST_SUITE(Test);
-    CPPUNIT_TEST(testBuildPath);
-    CPPUNIT_TEST_SUITE_END();
+    void SetUp()
+    {
+    }
+
+    void TearDown()
+    {
+    }
 };
 
-void Test::testBuildPath() {
+TEST_F(Test, testBuildPath) {
     buildPath(L"a:\\b\\", L"..", L"a:\\");
     buildPath(L"a:\\b\\", L"..\\", L"a:\\");
     buildPath(L"a:\\b\\c\\", L"..\\..\\..\\d", L"a:\\..\\d");
@@ -65,8 +67,11 @@ void Test::testBuildPath() {
     buildPath(L"", L"..\\a", L"..\\a");
 }
 
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
+}
 
+int main(int argc, char **argv)
+{
+    ::testing::InitGoogleTest(&argc, argv);
+    return RUN_ALL_TESTS();
 }
 
-NOADDITIONAL;