diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-13 15:55:08 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-13 15:55:52 +0200 |
commit | 4f5f7888c2cc4dc9428c5bcfa68d7ae748b8b948 (patch) | |
tree | dfb2885dccd681b376f65a8e40ec0389cf095f2a | |
parent | debfb21c927e39ab18aafb1895f343840967e16a (diff) |
sw: add initial odftok test
Change-Id: Ibeb7622768b43f725f2aa5bc5d492290fe192efa
-rw-r--r-- | sw/CppunitTest_sw_subsequent_odftok.mk | 97 | ||||
-rw-r--r-- | sw/Module_sw.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/odftok/data/hello.odt | bin | 0 -> 8159 bytes | |||
-rw-r--r-- | sw/qa/extras/odftok/odftok.cxx | 63 |
4 files changed, 161 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_subsequent_odftok.mk b/sw/CppunitTest_sw_subsequent_odftok.mk new file mode 100644 index 000000000000..d1e3ad7b518b --- /dev/null +++ b/sw/CppunitTest_sw_subsequent_odftok.mk @@ -0,0 +1,97 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Miklos Vajna <vmiklos@suse.cz> (SUSE, Inc.) +# Portions created by the Initial Developer are Copyright (C) 2012 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sw_subsequent_odftok)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_subsequent_odftok, \ + sw/qa/extras/odftok/odftok \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_odftok, \ + cppu \ + cppuhelper \ + sal \ + sw \ + test \ + unotest \ + vcl \ + tl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_subsequent_odftok,\ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_subsequent_odftok,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_subsequent_odftok,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odftok)) + +$(eval $(call gb_CppunitTest_use_components,sw_subsequent_odftok,\ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + fileaccess/source/fileacc \ + filter/source/config/cache/filterconfig1 \ + framework/util/fwk \ + i18npool/util/i18npool \ + package/util/package2 \ + package/source/xstor/xstor \ + sw/util/sw \ + sw/util/swd \ + sax/source/expatwrap/expwrap \ + sfx2/util/sfx \ + svl/source/fsstor/fsstorage \ + svtools/util/svt \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + unotools/util/utl \ + unoxml/source/service/unoxml \ + xmlhelp/util/ucpchelp1 \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_odftok)) + +$(eval $(call gb_CppunitTest_use_filter_configuration,sw_subsequent_odftok)) + +$(eval $(call gb_CppunitTest_use_extra_configuration,sw_subsequent_odftok,\ + $(OUTDIR)/unittest/registry \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 59e261284940..06cda0a4de3d 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -60,6 +60,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_subsequent_ww8tok \ CppunitTest_sw_subsequent_rtfexport \ CppunitTest_sw_subsequent_rtftok \ + CppunitTest_sw_subsequent_odftok \ )) $(eval $(call gb_Module_add_subsequentcheck_targets,sw,\ diff --git a/sw/qa/extras/odftok/data/hello.odt b/sw/qa/extras/odftok/data/hello.odt Binary files differnew file mode 100644 index 000000000000..23ce6a4db9af --- /dev/null +++ b/sw/qa/extras/odftok/data/hello.odt diff --git a/sw/qa/extras/odftok/odftok.cxx b/sw/qa/extras/odftok/odftok.cxx new file mode 100644 index 000000000000..efbadb3beb64 --- /dev/null +++ b/sw/qa/extras/odftok/odftok.cxx @@ -0,0 +1,63 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@suse.cz> (SUSE, Inc.) + * Portions created by the Initial Developer are Copyright (C) 2012 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "../swmodeltestbase.hxx" + +using rtl::OUString; + +class Test : public SwModelTestBase +{ +public: + void testHello(); + + CPPUNIT_TEST_SUITE(Test); +#if !defined(MACOSX) && !defined(WNT) + CPPUNIT_TEST(testHello); +#endif + CPPUNIT_TEST_SUITE_END(); + +private: + /// Load an ODF file and make the document available via mxComponent. + void load(const OUString& rURL); +}; + +void Test::load(const OUString& rFilename) +{ + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odftok/data/") + rFilename); +} + +void Test::testHello() +{ + load("hello.odt"); + CPPUNIT_ASSERT_EQUAL(12, getLength()); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Test); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |