Kaydet (Commit) 38ee8ff7 authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic

#i125003# migrate main/sal/qa/osl/setthreadname from cppunit to Google Test.

üst 8d66d4ef
......@@ -33,21 +33,20 @@ ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
CFLAGSCXX += $(CPPUNIT_CFLAGS)
.IF "$(ENABLE_UNIT_TESTS)" != "YES"
all:
@echo unit tests are disabled. Nothing to do.
DLLPRE =
SHL1IMPLIB = i$(SHL1TARGET)
SHL1OBJS = $(SLO)/test-setthreadname.obj
SHL1RPATH = NONE
SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
SHL1TARGET = test-setthreadname
SHL1VERSIONMAP = version.map
DEF1NAME = $(SHL1TARGET)
.ELSE
SLOFILES = $(SHL1OBJS)
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
......@@ -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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment