From bc77e4821786a7b8080bec5bf7c6f7a96392a461 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 22 Jun 2016 23:33:48 +0900 Subject: [PATCH] Use 1 in 2nd parameter of fwrite for consistency --- test/MultiDiskAdaptorTest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/MultiDiskAdaptorTest.cc b/test/MultiDiskAdaptorTest.cc index d8758bf6..7fcefa8f 100644 --- a/test/MultiDiskAdaptorTest.cc +++ b/test/MultiDiskAdaptorTest.cc @@ -270,18 +270,20 @@ void MultiDiskAdaptorTest::testResetDiskWriterEntries() } } +namespace { void readFile(const std::string& filename, char* buf, int bufLength) { FILE* f = fopen(filename.c_str(), "r"); if (f == nullptr) { CPPUNIT_FAIL(strerror(errno)); } - int retval = fread(buf, bufLength, 1, f); + int retval = fread(buf, 1, bufLength, f); fclose(f); - if (retval != 1) { + if (retval != bufLength) { CPPUNIT_FAIL("return value is not 1"); } } +} // namespace void MultiDiskAdaptorTest::testWriteData() {