diff options
author | gauravsh@chromium.org <gauravsh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 07:44:02 +0000 |
---|---|---|
committer | gauravsh@chromium.org <gauravsh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 07:44:02 +0000 |
commit | 4773e6afd7a570d4d2c0438fd61584d81ad3eb95 (patch) | |
tree | d850e4b3f9280921ee0b2493e3d1c731ffe442cf /chromeos/dbus | |
parent | 3f540b4b5643a8269d8e30974011bb808fc521fb (diff) | |
download | chromium_src-4773e6afd7a570d4d2c0438fd61584d81ad3eb95.zip chromium_src-4773e6afd7a570d4d2c0438fd61584d81ad3eb95.tar.gz chromium_src-4773e6afd7a570d4d2c0438fd61584d81ad3eb95.tar.bz2 |
ibus unit tests: Do bool checks using EXPECT_TRUE instead of ASSERT_EQ
This is a workaround until we can upgrade to a newer version of
gtest on Chrome OS.
The version of gtest used on Chrome OS doesn't correctly
handle EXPECT_EQ with boolean arguments. In particularly the unit tests
fail to compile with the new tool chain due to [-Werror=conversion-null]
warnings.
BUG=none
TEST=built chromeos_unittests using new tool chain
Review URL: https://chromiumcodereview.appspot.com/12634032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus')
-rw-r--r-- | chromeos/dbus/ibus/ibus_lookup_table_unittest.cc | 6 | ||||
-rw-r--r-- | chromeos/dbus/ibus/ibus_object_unittest.cc | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/chromeos/dbus/ibus/ibus_lookup_table_unittest.cc b/chromeos/dbus/ibus/ibus_lookup_table_unittest.cc index 4938400..ab03344 100644 --- a/chromeos/dbus/ibus/ibus_lookup_table_unittest.cc +++ b/chromeos/dbus/ibus/ibus_lookup_table_unittest.cc @@ -60,7 +60,7 @@ TEST(IBusLookupTable, WriteReadTest) { // Check values. EXPECT_EQ(kPageSize, target_lookup_table.page_size()); EXPECT_EQ(kCursorPosition, target_lookup_table.cursor_position()); - EXPECT_EQ(kIsCursorVisible, target_lookup_table.is_cursor_visible()); + EXPECT_TRUE(kIsCursorVisible == target_lookup_table.is_cursor_visible()); EXPECT_EQ(kOrientation, target_lookup_table.orientation()); ASSERT_EQ(2UL, target_lookup_table.candidates().size()); EXPECT_EQ(kSampleText1, target_lookup_table.candidates().at(0).value); @@ -195,8 +195,8 @@ TEST(IBusLookupTable, ReadMozcCandidateTest) { EXPECT_EQ(kSampleText2, target_lookup_table.candidates().at(1).value); EXPECT_EQ(kSampleLabel1, target_lookup_table.candidates().at(0).label); EXPECT_EQ(kSampleLabel2, target_lookup_table.candidates().at(1).label); - EXPECT_EQ(kShowWindowAtComposition, - target_lookup_table.show_window_at_composition()); + EXPECT_TRUE(kShowWindowAtComposition == + target_lookup_table.show_window_at_composition()); } TEST(IBusLookupTable, IsEqualTest) { diff --git a/chromeos/dbus/ibus/ibus_object_unittest.cc b/chromeos/dbus/ibus/ibus_object_unittest.cc index ea89f5d..263e76e 100644 --- a/chromeos/dbus/ibus/ibus_object_unittest.cc +++ b/chromeos/dbus/ibus/ibus_object_unittest.cc @@ -81,7 +81,7 @@ TEST(IBusObjectTest, WriteReadTest) { // Check the fourth boolean value. bool expected_bool = true; ASSERT_TRUE(ibus_object_reader.PopBool(&expected_bool)); - EXPECT_EQ(kSampleBool, expected_bool); + EXPECT_TRUE(kSampleBool == expected_bool); // Check the fifth value which is array of uint32. dbus::MessageReader array_reader(NULL); ASSERT_TRUE(ibus_object_reader.PopArray(&array_reader)); @@ -215,7 +215,7 @@ TEST(IBusObjectTest, PopAppendIBusPropertyTest) { EXPECT_EQ(kSampleLabel, result_property.label()); EXPECT_EQ(kSampleTooltip, result_property.tooltip()); EXPECT_EQ(kSampleVisible, result_property.visible()); - EXPECT_EQ(kSampleChecked, result_property.checked()); + EXPECT_TRUE(kSampleChecked == result_property.checked()); } } // namespace chromeos |