Kaydet (Commit) db8a2a56 authored tarafından Andrés Maldonado's avatar Andrés Maldonado Kaydeden (comit) Stephan Bergmann

tdf#39625 make sal/qa/systools/test_comtools.cxx work with CppUnit

Change-Id: If467a13b03303656e51474b3ebd384db8782ed9b
Reviewed-on: https://gerrit.libreoffice.org/68156
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst b87f3dc3
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_CppunitTest_CppunitTest,sal_comtools))
$(eval $(call gb_CppunitTest_add_exception_objects,sal_comtools,\
sal/qa/systools/test_comtools \
))
$(eval $(call gb_CppunitTest_use_libraries,sal_comtools,\
sal \
))
# vim: set noet sw=4 ts=4:
...@@ -25,6 +25,7 @@ $(eval $(call gb_Module_add_targets,sal,\ ...@@ -25,6 +25,7 @@ $(eval $(call gb_Module_add_targets,sal,\
$(eval $(call gb_Module_add_check_targets,sal,\ $(eval $(call gb_Module_add_check_targets,sal,\
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,CppunitTest_Module_DLL) \ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),,CppunitTest_Module_DLL) \
$(if $(filter WNT,$(OS)),CppunitTest_sal_comtools) \
CppunitTest_sal_osl_security \ CppunitTest_sal_osl_security \
CppunitTest_sal_osl \ CppunitTest_sal_osl \
CppunitTest_sal_rtl \ CppunitTest_sal_rtl \
......
...@@ -17,9 +17,8 @@ ...@@ -17,9 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
// autogenerated file with codegen.pl #include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
#include <testshl/simpleheader.hxx>
#include <systools/win32/comtools.hxx> #include <systools/win32/comtools.hxx>
class COMObject : public IUnknown class COMObject : public IUnknown
...@@ -186,7 +185,7 @@ namespace test_comtools ...@@ -186,7 +185,7 @@ namespace test_comtools
sal::systools::COMReference<IUnknown> r2 = r1.QueryInterface<IUnknown>(IID_IUnknown); sal::systools::COMReference<IUnknown> r2 = r1.QueryInterface<IUnknown>(IID_IUnknown);
CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2); CPPUNIT_ASSERT_MESSAGE("Wrong reference count, 2 is expected", reinterpret_cast<COMObject*>(r2.get())->GetRefCount() == 2);
} }
catch(const sal::systools::ComError& ex) catch(const sal::systools::ComError&)
{ {
CPPUNIT_ASSERT_MESSAGE("Exception should not have been thrown", false); CPPUNIT_ASSERT_MESSAGE("Exception should not have been thrown", false);
} }
...@@ -199,7 +198,7 @@ namespace test_comtools ...@@ -199,7 +198,7 @@ namespace test_comtools
sal::systools::COMReference<IUnknown> r1 = comObjectSource(); sal::systools::COMReference<IUnknown> r1 = comObjectSource();
sal::systools::COMReference<IPersistFile> r2 = r1.QueryInterface<IPersistFile>(IID_IPersistFile); sal::systools::COMReference<IPersistFile> r2 = r1.QueryInterface<IPersistFile>(IID_IPersistFile);
} }
catch(const sal::systools::ComError& ex) catch(const sal::systools::ComError&)
{ {
return; return;
} }
...@@ -227,12 +226,10 @@ namespace test_comtools ...@@ -227,12 +226,10 @@ namespace test_comtools
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
}; };
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_comtools::test_COMReference, "test_comtools"); CPPUNIT_TEST_SUITE_REGISTRATION(test_comtools::test_COMReference);
} // namespace rtl_OUString } // namespace rtl_OUString
// this macro creates an empty function, which will called by the RegisterAllFunctions() CPPUNIT_PLUGIN_IMPLEMENT();
// to let the user the possibility to also register some functions by hand.
NOADDITIONAL;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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