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
f7b8bab7
Kaydet (Commit)
f7b8bab7
authored
Eyl 08, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
related tdf#93676, add test for chart::CommonFunctors
Change-Id: I9667611135300155ee87cca1ad444ad8a6a9aeb1
üst
0ff4ec7f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
+105
-0
CppunitTest_chart2_common_functors.mk
chart2/CppunitTest_chart2_common_functors.mk
+39
-0
Module_chart2.mk
chart2/Module_chart2.mk
+4
-0
common_functor_test.cxx
chart2/qa/unit/common_functor_test.cxx
+62
-0
No files found.
chart2/CppunitTest_chart2_common_functors.mk
0 → 100644
Dosyayı görüntüle @
f7b8bab7
# -*- 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,chart2_common_functors))
$(eval $(call gb_CppunitTest_add_exception_objects,chart2_common_functors, \
chart2/qa/unit/common_functor_test \
))
$(eval $(call gb_CppunitTest_use_libraries,chart2_common_functors, \
cppu \
cppuhelper \
sal \
salhelper \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_set_include,chart2_common_functors,\
-I$(SRCDIR)/chart2/inc \
-I$(SRCDIR)/chart2/source/inc \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,chart2_common_functors,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,chart2_common_functors))
# vim: set noet sw=4 ts=4:
chart2/Module_chart2.mk
Dosyayı görüntüle @
f7b8bab7
...
...
@@ -21,6 +21,10 @@ $(eval $(call gb_Module_add_l10n_targets,chart2,\
UIConfig_chart2 \
))
$(eval $(call gb_Module_add_check_targets,chart2,\
CppunitTest_chart2_common_functors \
))
$(eval $(call gb_Module_add_slowcheck_targets,chart2,\
CppunitTest_chart2_export \
CppunitTest_chart2_import \
...
...
chart2/qa/unit/common_functor_test.cxx
0 → 100644
Dosyayı görüntüle @
f7b8bab7
/* -*- 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 <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
#include <com/sun/star/uno/Any.h>
#include <rtl/ustring.hxx>
#include <vector>
#include "CommonFunctors.hxx"
class
CommonFunctorsTest
:
public
CppUnit
::
TestFixture
{
public
:
CPPUNIT_TEST_SUITE
(
CommonFunctorsTest
);
CPPUNIT_TEST
(
testAnyToString
);
CPPUNIT_TEST_SUITE_END
();
void
testAnyToString
();
private
:
};
void
CommonFunctorsTest
::
testAnyToString
()
{
std
::
vector
<
css
::
uno
::
Any
>
aInput
;
aInput
.
push_back
(
css
::
uno
::
makeAny
(
2.0
));
aInput
.
push_back
(
css
::
uno
::
makeAny
(
10.0
));
aInput
.
push_back
(
css
::
uno
::
makeAny
(
12.0
));
aInput
.
push_back
(
css
::
uno
::
makeAny
(
15.0
));
aInput
.
push_back
(
css
::
uno
::
makeAny
(
25.234
));
aInput
.
push_back
(
css
::
uno
::
makeAny
(
123.456
));
std
::
vector
<
OUString
>
aOutput
;
std
::
transform
(
aInput
.
begin
(),
aInput
.
end
(),
std
::
back_inserter
(
aOutput
),
chart
::
CommonFunctors
::
AnyToString
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"2"
),
aOutput
[
0
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"10"
),
aOutput
[
1
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"12"
),
aOutput
[
2
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"15"
),
aOutput
[
3
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"25.234"
),
aOutput
[
4
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"123.456"
),
aOutput
[
5
]);
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
CommonFunctorsTest
);
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