提交 1f6f7e3e 编写于 作者: D Daniel Black 提交者: Facebook Github Bot

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
上级 243975d5
......@@ -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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册