Kaydet (Commit) 0ea42178 authored tarafından Radu Ioan's avatar Radu Ioan Kaydeden (comit) Caolán McNamara

fdo#39625 Make existing cppunittests work

Make salhelper testapi cppunit work
- removed call to simpleheader.hxx
- added call in Module_sal.mk for sal_testapi
- created mk for cppunittest for sal_testapi
- fixed some compile warning for auto_ptr

Change-Id: I07a58dbd5282f92604f58eb450e0bf549c54c6b3
Reviewed-on: https://gerrit.libreoffice.org/839Reviewed-by: 's avatarMuthu Subramanian K <muthusuba@gmail.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 36026a6a
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
# Major Contributor(s):
# Copyright (C) 2012 Radu Ioan <ioan.radu.g@gmail.com> (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
$(eval $(call gb_CppunitTest_CppunitTest,salhelper_testapi))
$(eval $(call gb_CppunitTest_add_exception_objects,salhelper_testapi,\
salhelper/qa/test_api \
))
$(eval $(call gb_CppunitTest_set_include,salhelper_testapi,\
$$(INCLUDE) \
-I$(SRCDIR)/salhelper/inc \
))
$(eval $(call gb_CppunitTest_use_libraries,salhelper_testapi,\
salhelper \
sal \
$(gb_STDLIBS) \
))
# vim: set noet sw=4 ts=4:
......@@ -35,6 +35,7 @@ $(eval $(call gb_Module_add_targets,salhelper,\
$(eval $(call gb_Module_add_check_targets,salhelper,\
CppunitTest_salhelper_checkapi \
CppunitTest_salhelper_testapi \
))
# vim: set noet sw=4 ts=4:
......@@ -48,11 +48,14 @@ std::type_info const & getSimpleReferenceObjectTypeInfo()
}
#include "testshl/simpleheader.hxx"
#include "osl/mutex.hxx"
#include "salhelper/condition.hxx"
#include "salhelper/dynload.hxx"
#include "salhelper/simplereferenceobject.hxx"
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
#include <boost/scoped_ptr.hpp>
#include <memory>
......@@ -208,12 +211,12 @@ void Test::testSimpleReferenceObject() {
void Test::testDerivedCondition() {
osl::Mutex mutex;
std::auto_ptr< salhelper::Condition > p(new DerivedCondition(mutex));
boost::scoped_ptr< salhelper::Condition > p(new DerivedCondition(mutex));
CPPUNIT_ASSERT(dynamic_cast< DerivedCondition * >(p.get()) != 0);
}
void Test::testDerivedConditionWaiterTimedout() {
std::auto_ptr< salhelper::ConditionWaiter::timedout > p(
boost::scoped_ptr< salhelper::ConditionWaiter::timedout > p(
new DerivedConditionWaiterTimedout);
CPPUNIT_ASSERT(
dynamic_cast< DerivedConditionWaiterTimedout * >(p.get()) != 0);
......@@ -235,10 +238,10 @@ void Test::testDerivedSimpleReferenceObject() {
}
}
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
NOADDITIONAL;
CPPUNIT_PLUGIN_IMPLEMENT();
/* 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