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
dab66665
Kaydet (Commit)
dab66665
authored
Eki 20, 2013
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ORowSetValue: adapt test to new behaviour, extend test more
Change-Id: If28046653935051303fd487d87655bacbddf4644
üst
04fe0cae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
7 deletions
+85
-7
FValue_test.cxx
connectivity/qa/connectivity/commontools/FValue_test.cxx
+85
-7
No files found.
connectivity/qa/connectivity/commontools/FValue_test.cxx
Dosyayı görüntüle @
dab66665
...
...
@@ -20,6 +20,8 @@
#include <test/bootstrapfixture.hxx>
#include "connectivity/FValue.hxx"
#include <com/sun/star/sdbc/DataType.hpp>
using
namespace
::
com
::
sun
::
star
::
sdbc
;
using
namespace
::
com
::
sun
::
star
::
uno
;
namespace
connectivity
{
namespace
commontools
{
...
...
@@ -46,7 +48,10 @@ public:
void
test_float
();
void
test_double
();
void
test_getString
();
void
test_bool_getString
();
void
test_bit_getString
();
void
test_bool_creation
();
CPPUNIT_TEST_SUITE
(
FValueTest
);
...
...
@@ -67,7 +72,9 @@ public:
CPPUNIT_TEST
(
test_float
);
CPPUNIT_TEST
(
test_double
);
CPPUNIT_TEST
(
test_getString
);
CPPUNIT_TEST
(
test_bool_getString
);
CPPUNIT_TEST
(
test_bit_getString
);
CPPUNIT_TEST
(
test_bool_creation
);
CPPUNIT_TEST_SUITE_END
();
};
...
...
@@ -286,25 +293,96 @@ void FValueTest::test_double()
CPPUNIT_ASSERT_MESSAGE
(
"double conversion from Any didn't work"
,
src_double
==
trg_double
);
}
void
FValueTest
::
test_getString
()
void
FValueTest
::
test_
bool_
getString
()
{
bool
src_bool_1
=
true
;
ORowSetValue
v_1
(
src_bool_1
);
OUString
trg_bool_1
=
v_1
.
getString
();
std
::
cerr
<<
"src_bool_1"
<<
src_bool_1
<<
std
::
endl
;
std
::
cerr
<<
"src_bool_1
:
"
<<
src_bool_1
<<
std
::
endl
;
std
::
cerr
<<
"trg_bool_1: "
<<
trg_bool_1
<<
std
::
endl
;
CPPUNIT_ASSERT_MESSAGE
(
"
bool to string conversion to ORowSetValue didn't work"
,
trg_bool_1
==
"1
"
);
CPPUNIT_ASSERT_MESSAGE
(
"
ORowSetValue bool to string conversion didn't work"
,
trg_bool_1
==
"true
"
);
bool
src_bool_0
=
false
;
ORowSetValue
v_0
(
src_bool_0
);
OUString
trg_bool_0
=
v_0
.
getString
();
std
::
cerr
<<
"src_bool_0"
<<
src_bool_0
<<
std
::
endl
;
std
::
cerr
<<
"src_bool_0
:
"
<<
src_bool_0
<<
std
::
endl
;
std
::
cerr
<<
"trg_bool_0: "
<<
trg_bool_0
<<
std
::
endl
;
CPPUNIT_ASSERT_MESSAGE
(
"bool to string conversion to ORowSetValue didn't work"
,
trg_bool_0
==
"0"
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool to string conversion didn't work"
,
trg_bool_0
==
"false"
);
}
void
FValueTest
::
test_bit_getString
()
{
bool
src_bool_1
=
true
;
ORowSetValue
v_1
(
src_bool_1
);
v_1
.
setTypeKind
(
DataType
::
BIT
);
OUString
trg_bool_1
=
v_1
.
getString
();
std
::
cerr
<<
"src_bit_1: "
<<
src_bool_1
<<
std
::
endl
;
std
::
cerr
<<
"trg_bit_1: "
<<
trg_bool_1
<<
std
::
endl
;
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bit to string conversion didn't work"
,
trg_bool_1
==
"1"
);
bool
src_bool_0
=
false
;
ORowSetValue
v_0
(
src_bool_0
);
v_0
.
setTypeKind
(
DataType
::
BIT
);
OUString
trg_bool_0
=
v_0
.
getString
();
std
::
cerr
<<
"src_bit_0: "
<<
src_bool_0
<<
std
::
endl
;
std
::
cerr
<<
"trg_bit_0: "
<<
trg_bool_0
<<
std
::
endl
;
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bit to string conversion didn't work"
,
trg_bool_0
==
"0"
);
}
void
FValueTest
::
test_bool_creation
()
{
OUString
s1
(
"1"
);
OUString
s0
(
"0"
);
OUString
sTrue
(
"true"
);
OUString
sTrUe
(
"tRuE"
);
OUString
sFalse
(
"false"
);
ORowSetValue
vTrue
(
true
);
ORowSetValue
vFalse
(
false
);
{
ORowSetValue
v
(
s1
);
v
.
setTypeKind
(
DataType
::
BOOLEAN
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool creation from string didn't work"
,
v
==
vTrue
);
}
{
ORowSetValue
v
(
s0
);
v
.
setTypeKind
(
DataType
::
BOOLEAN
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool creation from string didn't work"
,
v
==
vFalse
);
}
{
ORowSetValue
v
(
sTrue
);
v
.
setTypeKind
(
DataType
::
BOOLEAN
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool creation from string didn't work"
,
v
==
vTrue
);
}
{
ORowSetValue
v
(
sTrUe
);
v
.
setTypeKind
(
DataType
::
BOOLEAN
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool creation from string didn't work"
,
v
==
vTrue
);
}
{
ORowSetValue
v
(
sFalse
);
v
.
setTypeKind
(
DataType
::
BOOLEAN
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool creation from string didn't work"
,
v
==
vFalse
);
}
{
ORowSetValue
v
(
s0
);
v
.
setTypeKind
(
DataType
::
BOOLEAN
);
CPPUNIT_ASSERT_MESSAGE
(
"ORowSetValue bool creation from string didn't work"
,
v
==
vFalse
);
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
FValueTest
);
...
...
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