Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
0f8cf397
Kaydet (Commit)
0f8cf397
authored
Tem 07, 2014
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#80955 - add a unit test.
Change-Id: Ie79a86827c4ee9feabcabf2530b30466f95905ed
üst
b536cabf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
5 deletions
+138
-5
CppunitTest_filter_priority.mk
filter/CppunitTest_filter_priority.mk
+42
-0
CppunitTest_filter_xslt.mk
filter/CppunitTest_filter_xslt.mk
+1
-5
Module_filter.mk
filter/Module_filter.mk
+1
-0
priority-test.cxx
filter/qa/cppunit/priority-test.cxx
+94
-0
No files found.
filter/CppunitTest_filter_priority.mk
0 → 100644
Dosyayı görüntüle @
0f8cf397
# -*- 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,filter_priority))
$(eval $(call gb_CppunitTest_use_sdk_api,filter_priority))
$(eval $(call gb_CppunitTest_use_ure,filter_priority))
$(eval $(call gb_CppunitTest_use_configuration,filter_priority))
$(eval $(call gb_CppunitTest_use_external,filter_priority,boost_headers))
$(eval $(call gb_CppunitTest_use_libraries,filter_priority, \
comphelper \
unotest \
cppuhelper \
cppu \
sal \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_components,filter_priority,\
configmgr/source/configmgr \
filter/source/config/cache/filterconfig1 \
framework/util/fwk \
framework/util/fwl \
i18npool/util/i18npool \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
))
$(eval $(call gb_CppunitTest_add_exception_objects,filter_priority, \
filter/qa/cppunit/priority-test \
))
# vim: set noet sw=4 ts=4:
filter/CppunitTest_filter_xslt.mk
Dosyayı görüntüle @
0f8cf397
...
@@ -9,11 +9,7 @@
...
@@ -9,11 +9,7 @@
$(eval $(call gb_CppunitTest_CppunitTest,filter_xslt))
$(eval $(call gb_CppunitTest_CppunitTest,filter_xslt))
$(eval $(call gb_CppunitTest_use_api,filter_xslt,\
$(eval $(call gb_CppunitTest_use_sdk_api,filter_xslt))
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,filter_xslt))
$(eval $(call gb_CppunitTest_use_ure,filter_xslt))
$(eval $(call gb_CppunitTest_use_vcl,filter_xslt))
$(eval $(call gb_CppunitTest_use_vcl,filter_xslt))
...
...
filter/Module_filter.mk
Dosyayı görüntüle @
0f8cf397
...
@@ -80,6 +80,7 @@ endif
...
@@ -80,6 +80,7 @@ endif
$(eval $(call gb_Module_add_check_targets,filter,\
$(eval $(call gb_Module_add_check_targets,filter,\
CppunitTest_filter_xslt \
CppunitTest_filter_xslt \
CppunitTest_filter_priority \
))
))
ifneq ($(DISABLE_CVE_TESTS),TRUE)
ifneq ($(DISABLE_CVE_TESTS),TRUE)
...
...
filter/qa/cppunit/priority-test.cxx
0 → 100644
Dosyayı görüntüle @
0f8cf397
/* -*- 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/.
*/
// Unit test to check that we get the right filters for the right extensions.
#include <limits>
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
#include <sal/types.h>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/document/XTypeDetection.hpp>
#include <comphelper/processfactory.hxx>
#include <unotest/bootstrapfixturebase.hxx>
using
namespace
std
;
using
namespace
css
;
namespace
{
class
PriorityFilterTest
:
public
test
::
BootstrapFixtureBase
{
public
:
void
testPriority
();
CPPUNIT_TEST_SUITE
(
PriorityFilterTest
);
CPPUNIT_TEST
(
testPriority
);
CPPUNIT_TEST_SUITE_END
();
};
void
PriorityFilterTest
::
testPriority
()
{
uno
::
Reference
<
document
::
XTypeDetection
>
xDetection
(
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
"com.sun.star.document.TypeDetection"
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_MESSAGE
(
"No type detection component"
,
xDetection
.
is
());
static
struct
{
const
char
*
pURL
;
const
char
*
pFormat
;
}
aToCheck
[]
=
{
{
"file:///tmp/foo.xls"
,
"calc_MS_Excel_97"
}
// TODO: expand this to check more of these priorities
};
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aToCheck
);
i
++
)
{
OUString
aURL
=
OUString
::
createFromAscii
(
aToCheck
[
i
].
pURL
);
try
{
OUString
aTypeName
=
xDetection
->
queryTypeByURL
(
aURL
);
OUString
aFormatCorrect
=
OUString
::
createFromAscii
(
aToCheck
[
i
].
pFormat
);
OUStringBuffer
aMsg
(
"Mis-matching formats "
);
aMsg
.
append
(
"'"
);
aMsg
.
append
(
aTypeName
);
aMsg
.
append
(
"' should be '"
);
aMsg
.
append
(
aFormatCorrect
);
aMsg
.
append
(
"'"
);
CPPUNIT_ASSERT_MESSAGE
(
rtl
::
OUStringToOString
(
aMsg
.
makeStringAndClear
(),
RTL_TEXTENCODING_UTF8
).
getStr
(),
aTypeName
==
aFormatCorrect
);
}
catch
(
const
uno
::
Exception
&
e
)
{
OUStringBuffer
aMsg
(
"Exception querying for type: "
);
aMsg
.
append
(
"'"
);
aMsg
.
append
(
e
.
Message
);
aMsg
.
append
(
"'"
);
CPPUNIT_FAIL
(
rtl
::
OUStringToOString
(
aMsg
.
makeStringAndClear
(),
RTL_TEXTENCODING_UTF8
).
getStr
());
}
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
PriorityFilterTest
);
}
CPPUNIT_PLUGIN_IMPLEMENT
();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment