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
57cac07a
Kaydet (Commit)
57cac07a
authored
Agu 10, 2012
tarafından
Artur Dorda
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
encodeBase64 test is working
Change-Id: I598ea47ff02b15fdb1d7ff3992d2c660f5a41c95
üst
9f2a303b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
CppunitTest_sax.mk
sax/CppunitTest_sax.mk
+2
-0
test_converter.cxx
sax/qa/cppunit/test_converter.cxx
+32
-0
No files found.
sax/CppunitTest_sax.mk
Dosyayı görüntüle @
57cac07a
...
...
@@ -17,6 +17,8 @@ $(eval $(call gb_CppunitTest_use_api,sax_cpputest,\
$(eval $(call gb_CppunitTest_use_libraries,sax_cpputest, \
sax \
sal \
comphelper \
cppu \
$(gb_STDLIBS) \
))
...
...
sax/qa/cppunit/test_converter.cxx
Dosyayı görüntüle @
57cac07a
...
...
@@ -31,6 +31,7 @@
#include <com/sun/star/util/MeasureUnit.hpp>
#include "sax/tools/converter.hxx"
#include "comphelper/sequenceasvector.hxx"
using
namespace
::
com
::
sun
::
star
;
...
...
@@ -55,6 +56,7 @@ public:
void
testPercent
();
void
testColor
();
void
testNumber
();
void
testBase64
();
CPPUNIT_TEST_SUITE
(
ConverterTest
);
CPPUNIT_TEST
(
testDuration
);
...
...
@@ -65,6 +67,7 @@ public:
CPPUNIT_TEST
(
testPercent
);
CPPUNIT_TEST
(
testColor
);
CPPUNIT_TEST
(
testNumber
);
CPPUNIT_TEST
(
testBase64
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -506,6 +509,35 @@ void ConverterTest::testNumber()
doTestNumberToString
(
"-1"
,
-
0001
);
doTestNumberToString
(
"0"
,
-
0
);
}
void
doTestEncodeBase64
(
char
const
*
const
pis
,
const
uno
::
Sequence
<
sal_Int8
>
aPass
)
{
::
rtl
::
OUString
const
is
(
::
rtl
::
OUString
::
createFromAscii
(
pis
));
::
rtl
::
OUStringBuffer
buf
;
Converter
::
encodeBase64
(
buf
,
aPass
);
OSL_TRACE
(
"%s"
,
::
rtl
::
OUStringToOString
(
buf
.
getStr
(),
RTL_TEXTENCODING_UTF8
).
getStr
());
CPPUNIT_ASSERT_EQUAL
(
is
,
buf
.
makeStringAndClear
());
}
void
ConverterTest
::
testBase64
()
{
comphelper
::
SequenceAsVector
<
sal_Int8
>
tempSeq
(
4
);
for
(
sal_Int8
i
=
0
;
i
<
4
;
++
i
)
tempSeq
.
push_back
(
i
);
uno
::
Sequence
<
sal_Int8
>
tempSequence
=
tempSeq
.
getAsConstList
();
doTestEncodeBase64
(
"AAAAAAABAgM="
,
tempSequence
);
tempSeq
[
0
]
=
sal_Int8
(
5
);
tempSeq
[
1
]
=
sal_Int8
(
2
);
tempSeq
[
2
]
=
sal_Int8
(
3
);
tempSequence
=
tempSeq
.
getAsConstList
();
doTestEncodeBase64
(
"BQIDAAABAgM="
,
tempSequence
);
tempSeq
[
0
]
=
sal_Int8
(
200
);
tempSeq
[
1
]
=
sal_Int8
(
31
);
tempSeq
[
2
]
=
sal_Int8
(
77
);
tempSeq
[
3
]
=
sal_Int8
(
111
);
tempSequence
=
tempSeq
.
getAsConstList
();
doTestEncodeBase64
(
"yB9NbwABAgM="
,
tempSequence
);
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
ConverterTest
);
}
...
...
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