From 385f6240278b38643894158d2eb7001f25fc965b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 12 Dec 2016 15:31:35 +0100 Subject: Prevent use of ORowSetValue with sal_Bool as TINYINT sal_Bool and sal_uInt8 are typedefs for the same underlying type, so any use of ORowSetValue with sal_Bool instead of bool, apparently intending to treat the value as a boolean, actually treated it as a TINYINT. (See e.g. recent 7b0c57b2faec875c790051d233d1e9abaed2a3bc "some compilers don't like implicit bool-to-ORowSetValue conversion".) Now that there's no way to create a sal_uInt8 ORowSetValue, getUInt8 and the m_uInt8 union member can probably go away, too. Change-Id: Ia27554f76e7e9edce6410284b578064573e54fd3 Reviewed-on: https://gerrit.libreoffice.org/31909 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../qa/connectivity/commontools/FValue_test.cxx | 23 ---------------------- 1 file changed, 23 deletions(-) (limited to 'connectivity/qa') diff --git a/connectivity/qa/connectivity/commontools/FValue_test.cxx b/connectivity/qa/connectivity/commontools/FValue_test.cxx index c90fa588fa5b..036fbbc3ca5f 100644 --- a/connectivity/qa/connectivity/commontools/FValue_test.cxx +++ b/connectivity/qa/connectivity/commontools/FValue_test.cxx @@ -34,7 +34,6 @@ public: void test_Bool(); void test_Int8(); - void test_uInt8(); void test_Int16(); void test_uInt16(); @@ -58,7 +57,6 @@ public: CPPUNIT_TEST(test_Bool); CPPUNIT_TEST(test_Int8); - CPPUNIT_TEST(test_uInt8); CPPUNIT_TEST(test_Int16); CPPUNIT_TEST(test_uInt16); @@ -120,27 +118,6 @@ void FValueTest::test_Int8() CPPUNIT_ASSERT_EQUAL_MESSAGE("sal_Int8 conversion from Any didn't work", trg_salInt8, src_salInt8); } -void FValueTest::test_uInt8() -{ - sal_uInt8 src_saluInt8 = 255; - ORowSetValue v(src_saluInt8); - sal_uInt8 trg_saluInt8 = v.getUInt8(); - - std::cerr << "src_saluInt8: " << static_cast(src_saluInt8) << std::endl; - std::cerr << "trg_saluInt8: " << static_cast(trg_saluInt8) << std::endl; - - CPPUNIT_ASSERT_EQUAL_MESSAGE("sal_uInt8 conversion to ORowSetValue didn't work", trg_saluInt8, src_saluInt8); - - Any any_uInt8 = v.makeAny(); - ORowSetValue t; - t.fill(any_uInt8); - trg_saluInt8 = t.getUInt8(); - - std::cerr << "trg_saluInt8: " << static_cast(trg_saluInt8) << std::endl; - - CPPUNIT_ASSERT_EQUAL_MESSAGE("sal_uInt8 conversion from Any didn't work", trg_saluInt8, src_saluInt8); -} - void FValueTest::test_Int16() { sal_Int16 src_salInt16 = -10001; -- cgit