diff options
author | David Ostrovsky <david@ostrovsky.org> | 2013-02-07 00:13:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-09 11:06:11 +0000 |
commit | 0efe5cf57e524aa197fbb57aee8a5548cb32f34a (patch) | |
tree | 38187c5ef771a3988f7e1a22cdbaec73da81bfbd /connectivity/qa | |
parent | translate German comments, remove obsolete code (diff) | |
download | core-0efe5cf57e524aa197fbb57aee8a5548cb32f34a.tar.gz core-0efe5cf57e524aa197fbb57aee8a5548cb32f34a.zip |
ORowSetValue: move float and double to union
Change-Id: Ic5de8ad2cf9ef1143b1a5468e5fc5c9974aca5ec
Reviewed-on: https://gerrit.libreoffice.org/2021
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'connectivity/qa')
-rw-r--r-- | connectivity/qa/connectivity/commontools/FValue_test.cxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/connectivity/qa/connectivity/commontools/FValue_test.cxx b/connectivity/qa/connectivity/commontools/FValue_test.cxx index be3024e32c9d..b460f646ded5 100644 --- a/connectivity/qa/connectivity/commontools/FValue_test.cxx +++ b/connectivity/qa/connectivity/commontools/FValue_test.cxx @@ -43,6 +43,9 @@ public: void test_Int64(); void test_uInt64(); + void test_float(); + void test_double(); + CPPUNIT_TEST_SUITE(FValueTest); CPPUNIT_TEST(test_Bool); @@ -59,6 +62,9 @@ public: CPPUNIT_TEST(test_Int64); CPPUNIT_TEST(test_uInt64); + CPPUNIT_TEST(test_float); + CPPUNIT_TEST(test_double); + CPPUNIT_TEST_SUITE_END(); }; @@ -239,6 +245,44 @@ void FValueTest::test_uInt64() CPPUNIT_ASSERT_MESSAGE("sal_uInt64 conversion from Any didn't work", src_saluInt64 == trg_saluInt64); } +void FValueTest::test_float() +{ + float src_float = 1.234f; + ORowSetValue v(src_float); + float trg_float = v.getFloat(); + + std::cerr << "src_float: " << src_float << std::endl; + std::cerr << "trg_float: " << trg_float << std::endl; + + CPPUNIT_ASSERT_MESSAGE("float conversion to ORowSetValue didn't work", src_float == trg_float); + + Any any_float = v.makeAny(); + ORowSetValue t; + t.fill(any_float); + trg_float = t.getFloat(); + + CPPUNIT_ASSERT_MESSAGE("float conversion from Any didn't work", src_float == trg_float); +} + +void FValueTest::test_double() +{ + double src_double = 1.23456789; + ORowSetValue v(src_double); + double trg_double = v.getDouble(); + + std::cerr << "src_double: " << src_double << std::endl; + std::cerr << "trg_double: " << trg_double << std::endl; + + CPPUNIT_ASSERT_MESSAGE("double conversion to ORowSetValue didn't work", src_double == trg_double); + + Any any_double = v.makeAny(); + ORowSetValue t; + t.fill(any_double); + trg_double = t.getDouble(); + + CPPUNIT_ASSERT_MESSAGE("double conversion from Any didn't work", src_double == trg_double); +} + CPPUNIT_TEST_SUITE_REGISTRATION(FValueTest); }} |