mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-27 02:53:13 +01:00
Fix clang -Weverything
This commit is contained in:
@@ -22,6 +22,7 @@ using namespace rapidjson;
|
||||
class FileStreamTest : public ::testing::Test {
|
||||
public:
|
||||
FileStreamTest() : filename_(), json_(), length_() {}
|
||||
virtual ~FileStreamTest();
|
||||
|
||||
virtual void SetUp() {
|
||||
const char *paths[] = {
|
||||
@@ -42,9 +43,9 @@ public:
|
||||
ASSERT_TRUE(fp != 0);
|
||||
|
||||
fseek(fp, 0, SEEK_END);
|
||||
length_ = (size_t)ftell(fp);
|
||||
length_ = static_cast<size_t>(ftell(fp));
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
json_ = (char*)malloc(length_ + 1);
|
||||
json_ = static_cast<char*>(malloc(length_ + 1));
|
||||
size_t readLength = fread(json_, 1, length_, fp);
|
||||
json_[readLength] = '\0';
|
||||
fclose(fp);
|
||||
@@ -65,6 +66,8 @@ protected:
|
||||
size_t length_;
|
||||
};
|
||||
|
||||
FileStreamTest::~FileStreamTest() {}
|
||||
|
||||
TEST_F(FileStreamTest, FileReadStream) {
|
||||
FILE *fp = fopen(filename_, "rb");
|
||||
ASSERT_TRUE(fp != 0);
|
||||
|
||||
Reference in New Issue
Block a user