cast to signed char in ldb_cmd_test for ppc64le

Summary:
char is unsigned on power by default causing this test to fail with the FF case. ppc64 return 255 while x86 returned -1. Casting works on both platforms.
Closes https://github.com/facebook/rocksdb/pull/1500

Differential Revision: D4308775

Pulled By: yiwu-arbug

fbshipit-source-id: db3e6e0
main
Daniel Black 8 years ago committed by Facebook Github Bot
parent 243975d5da
commit 1f6f7e3e89
  1. 2
      tools/ldb_cmd_test.cc

@ -26,7 +26,7 @@ TEST_F(LdbCmdTest, HexToString) {
auto actual = rocksdb::LDBCommand::HexToString(inPair.first);
auto expected = inPair.second;
for (unsigned int i = 0; i < actual.length(); i++) {
EXPECT_EQ(expected[i], static_cast<int>(actual[i]));
EXPECT_EQ(expected[i], static_cast<int>((signed char) actual[i]));
}
auto reverse = rocksdb::LDBCommand::StringToHex(actual);
EXPECT_STRCASEEQ(inPair.first.c_str(), reverse.c_str());

Loading…
Cancel
Save