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
d9e2c824
Kaydet (Commit)
d9e2c824
authored
Eyl 08, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
also add test for DoubleToString
Change-Id: I3de9afa7b5d975487fd03ae2a9c5393143abff9c
üst
bb5d6380
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
common_functor_test.cxx
chart2/qa/unit/common_functor_test.cxx
+23
-0
No files found.
chart2/qa/unit/common_functor_test.cxx
Dosyayı görüntüle @
d9e2c824
...
@@ -25,9 +25,11 @@ class CommonFunctorsTest : public CppUnit::TestFixture
...
@@ -25,9 +25,11 @@ class CommonFunctorsTest : public CppUnit::TestFixture
public
:
public
:
CPPUNIT_TEST_SUITE
(
CommonFunctorsTest
);
CPPUNIT_TEST_SUITE
(
CommonFunctorsTest
);
CPPUNIT_TEST
(
testAnyToString
);
CPPUNIT_TEST
(
testAnyToString
);
CPPUNIT_TEST
(
testDoubleToString
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
void
testAnyToString
();
void
testAnyToString
();
void
testDoubleToString
();
private
:
private
:
};
};
...
@@ -54,6 +56,27 @@ void CommonFunctorsTest::testAnyToString()
...
@@ -54,6 +56,27 @@ void CommonFunctorsTest::testAnyToString()
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"123.456"
),
aOutput
[
5
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"123.456"
),
aOutput
[
5
]);
}
}
void
CommonFunctorsTest
::
testDoubleToString
()
{
std
::
vector
<
double
>
aInput
;
aInput
.
push_back
(
2.0
);
aInput
.
push_back
(
10.0
);
aInput
.
push_back
(
12.0
);
aInput
.
push_back
(
15.0
);
aInput
.
push_back
(
25.234
);
aInput
.
push_back
(
123.456
);
std
::
vector
<
OUString
>
aOutput
;
std
::
transform
(
aInput
.
begin
(),
aInput
.
end
(),
std
::
back_inserter
(
aOutput
),
chart
::
CommonFunctors
::
DoubleToOUString
());
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_TEST_SUITE_REGISTRATION
(
CommonFunctorsTest
);
...
...
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