Kaydet (Commit) 678e35c4 authored tarafından Michael Meeks's avatar Michael Meeks

xmloff: native code unit testing harness.

Change-Id: I5b9133deea2aa7630752128128f1a222bef99eb1
üst 533be981
# -*- 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/.
#
$(eval $(call gb_CppunitTest_CppunitTest,xmloff_uxmloff))
$(eval $(call gb_CppunitTest_add_exception_objects,xmloff_uxmloff, \
xmloff/qa/unit/uxmloff \
))
$(eval $(call gb_CppunitTest_set_include,xmloff_uxmloff,\
-I$(SRCDIR)/xmloff/inc \
-I$(SRCDIR)/xmloff/source/style \
-I$(SRCDIR)/xmloff/source/chart \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,xmloff_uxmloff,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,xmloff_uxmloff))
$(eval $(call gb_CppunitTest_use_library_objects,xmloff_uxmloff,xo))
$(eval $(call gb_CppunitTest_use_externals,xmloff_uxmloff,\
boost_headers \
))
$(eval $(call gb_CppunitTest_use_libraries,xmloff_uxmloff, \
basegfx \
comphelper \
cppu \
cppuhelper \
i18nisolang1 \
sal \
salhelper \
sax \
svl \
test \
tl \
utl \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_components,xmloff_uxmloff,\
configmgr/source/configmgr \
fileaccess/source/fileacc \
i18npool/util/i18npool \
sax/source/expatwrap/expwrap \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
unoxml/source/service/unoxml \
))
# uui/util/uui \
# sfx2/util/sfx \
# framework/util/fwk \
$(eval $(call gb_CppunitTest_use_configuration,xmloff_uxmloff))
# vim: set noet sw=4 ts=4:
......@@ -26,6 +26,10 @@ $(eval $(call gb_Module_add_targets,xmloff,\
Package_inc \
))
$(eval $(call gb_Module_add_check_targets,xmloff,\
CppunitTest_xmloff_uxmloff \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,xmloff,\
JunitTest_xmloff_unoapi \
))
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*/
#include <sal/config.h>
#include <test/bootstrapfixture.hxx>
#include <xmloff/xmlexp.hxx>
#include "SchXMLExport.hxx"
#include <comphelper/processfactory.hxx>
#include <com/sun/star/util/MeasureUnit.hpp>
using namespace ::com::sun::star;
namespace {
class Test : public test::BootstrapFixture {
public:
Test();
virtual void setUp();
virtual void tearDown();
void testSomething();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testSomething);
CPPUNIT_TEST_SUITE_END();
private:
SvXMLExport *pExport;
};
Test::Test()
: pExport( NULL )
{
}
void Test::setUp()
{
BootstrapFixture::setUp();
pExport = new SchXMLExport(/* util::MeasureUnit::CM, */
comphelper::getProcessComponentContext());
}
void Test::tearDown()
{
delete pExport;
BootstrapFixture::tearDown();
}
void Test::testSomething()
{
OUString s1("A");
OUString s2("B");
CPPUNIT_ASSERT_MESSAGE("these strings are supposed to be different!", s1 != s2);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -78,6 +78,21 @@ void SvXMLAutoStylePoolP_Impl::AddFamily(
aPrefix += rStrPrefix;
}
#if OSL_DEBUG_LEVEL > 0
XMLFamilyData_Impl aTemporary( nFamily );
XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTemporary);
if( aFind != maFamilyList.end() )
{
// FIXME: do we really intend to replace the previous nFamily
// entry in this case ?
SAL_WARN_IF( aFind->mxMapper != rMapper, "xmloff",
"Adding duplicate family " << rStrName <<
" with mismatching mapper ! " <<
typeid(*aFind->mxMapper.get()).name() << " " <<
typeid(rMapper.get()).name() );
}
#endif
XMLFamilyData_Impl *pFamily = new XMLFamilyData_Impl( nFamily, rStrName, rMapper, aPrefix, bAsFamily );
maFamilyList.insert(pFamily);
}
......
......@@ -81,6 +81,7 @@ public:
void ClearEntries();
};
/// A set that finds and sorts based only on mnFamily
typedef boost::ptr_set<XMLFamilyData_Impl> XMLFamilyDataList_Impl;
///////////////////////////////////////////////////////////////////////////////
......
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