From 1f6f7e3e89fe68c603389a8363e07da1ea27f4d3 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 12 Dec 2016 14:32:55 -0800 Subject: [PATCH] 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 --- tools/ldb_cmd_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ldb_cmd_test.cc b/tools/ldb_cmd_test.cc index b4a8772d5..48b0a69e2 100644 --- a/tools/ldb_cmd_test.cc +++ b/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(actual[i])); + EXPECT_EQ(expected[i], static_cast((signed char) actual[i])); } auto reverse = rocksdb::LDBCommand::StringToHex(actual); EXPECT_STRCASEEQ(inPair.first.c_str(), reverse.c_str());