Fixed Mac compile error in util/options_test.cc

Summary:
Fixed the following error in Mac:

./util/testharness.h:93:19: error: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]
  BINARY_OP(IsEq, ==)
  ~~~~~~~~~~~~~~~~^~~
./util/testharness.h:86:14: note: expanded from macro 'BINARY_OP'
    if (! (x op y)) {                                   \
             ^
util/options_test.cc:269:3: note: in instantiation of function template specialization 'rocksdb::test::Tester::IsEq<unsigned long, int>' requested here
  ASSERT_EQ(new_cf_opt.write_buffer_size, 5);
  ^

Test Plan:
options_test
main
Yueh-Hsuan Chiang 10 years ago
parent 5a76186340
commit 3ead857a0d
  1. 12
      util/options_test.cc

@ -266,24 +266,24 @@ TEST(OptionsTest, GetOptionsFromStringTest) {
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, "", &new_cf_opt)); ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, "", &new_cf_opt));
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt,
"write_buffer_size=5", &new_cf_opt)); "write_buffer_size=5", &new_cf_opt));
ASSERT_EQ(new_cf_opt.write_buffer_size, 5); ASSERT_EQ(new_cf_opt.write_buffer_size, 5U);
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt,
"write_buffer_size=6;", &new_cf_opt)); "write_buffer_size=6;", &new_cf_opt));
ASSERT_EQ(new_cf_opt.write_buffer_size, 6); ASSERT_EQ(new_cf_opt.write_buffer_size, 6U);
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt,
" write_buffer_size = 7 ", &new_cf_opt)); " write_buffer_size = 7 ", &new_cf_opt));
ASSERT_EQ(new_cf_opt.write_buffer_size, 7); ASSERT_EQ(new_cf_opt.write_buffer_size, 7U);
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt,
" write_buffer_size = 8 ; ", &new_cf_opt)); " write_buffer_size = 8 ; ", &new_cf_opt));
ASSERT_EQ(new_cf_opt.write_buffer_size, 8); ASSERT_EQ(new_cf_opt.write_buffer_size, 8U);
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt,
"write_buffer_size=9;max_write_buffer_number=10", &new_cf_opt)); "write_buffer_size=9;max_write_buffer_number=10", &new_cf_opt));
ASSERT_EQ(new_cf_opt.write_buffer_size, 9); ASSERT_EQ(new_cf_opt.write_buffer_size, 9U);
ASSERT_EQ(new_cf_opt.max_write_buffer_number, 10); ASSERT_EQ(new_cf_opt.max_write_buffer_number, 10);
ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(GetColumnFamilyOptionsFromString(base_cf_opt,
"write_buffer_size=11; max_write_buffer_number = 12 ;", "write_buffer_size=11; max_write_buffer_number = 12 ;",
&new_cf_opt)); &new_cf_opt));
ASSERT_EQ(new_cf_opt.write_buffer_size, 11); ASSERT_EQ(new_cf_opt.write_buffer_size, 11U);
ASSERT_EQ(new_cf_opt.max_write_buffer_number, 12); ASSERT_EQ(new_cf_opt.max_write_buffer_number, 12);
// Wrong name "max_write_buffer_number_" // Wrong name "max_write_buffer_number_"
ASSERT_TRUE(!GetColumnFamilyOptionsFromString(base_cf_opt, ASSERT_TRUE(!GetColumnFamilyOptionsFromString(base_cf_opt,

Loading…
Cancel
Save