From ac75e829660abfe14e1788b8f882849b01434a4a Mon Sep 17 00:00:00 2001 From: David Zemon Date: Sat, 29 Apr 2017 09:50:06 -0500 Subject: [PATCH] [#123] Fix FatFile unit tests --- test/PropWare/fatfilereader_test.cpp | 14 +++++++------- test/PropWare/fatfilewriter_test.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/PropWare/fatfilereader_test.cpp b/test/PropWare/fatfilereader_test.cpp index 71f26dd7..0afb8d6d 100644 --- a/test/PropWare/fatfilereader_test.cpp +++ b/test/PropWare/fatfilereader_test.cpp @@ -106,7 +106,7 @@ TEARDOWN { } TEST(ConstructorDestructor) { - testable = new FatFileReader(g_fs, FILE_NAME, buffer); + testable = new FatFileReader(g_fs, FILE_NAME); // Ensure the requested filename was not all upper case (that wouldn't be a very good test if it were) ASSERT_NEQ_MSG(0, strcmp(FILE_NAME, FILE_NAME_UPPER)); @@ -114,8 +114,8 @@ TEST(ConstructorDestructor) { ASSERT_EQ_MSG(0, strcmp(FILE_NAME_UPPER, testable->get_name())); ASSERT_EQ_MSG((unsigned int) &pwOut, (unsigned int) testable->m_logger); ASSERT_EQ_MSG((unsigned int) g_fs.get_driver(), (unsigned int) testable->m_driver); - ASSERT_EQ_MSG((unsigned int) &buffer, (unsigned int) testable->m_buf); - ASSERT_NEQ_MSG((unsigned int) NULL, (unsigned int) testable->m_buf->buf); + ASSERT_EQ_MSG((unsigned int) &PropWare::SHARED_BUFFER, (unsigned int) testable->m_buf); + ASSERT_EQ_MSG((unsigned int) PropWare::SHARED_BUFFER.buf, (unsigned int) testable->m_buf->buf); ASSERT_EQ_MSG((unsigned int) &g_fs.m_dirMeta, (unsigned int) testable->m_fsBufMeta); ASSERT_EQ_MSG((unsigned int) &g_fs, (unsigned int) testable->m_fs); ASSERT_EQ_MSG(-1, testable->get_length()); @@ -124,7 +124,7 @@ TEST(ConstructorDestructor) { } TEST(Exists_doesExist) { - testable = new FatFileReader(g_fs, FILE_NAME, buffer); + testable = new FatFileReader(g_fs, FILE_NAME); PropWare::ErrorCode err; const bool exists = testable->exists(err); @@ -134,14 +134,14 @@ TEST(Exists_doesExist) { } TEST(Exists_doeesNotExist) { - testable = new FatFileReader(g_fs, BOGUS_FILE_NAME, buffer); + testable = new FatFileReader(g_fs, BOGUS_FILE_NAME); ASSERT_FALSE(testable->exists()); tearDown(); } TEST(OpenClose) { PropWare::ErrorCode err; - testable = new FatFileReader(g_fs, FILE_NAME, buffer); + testable = new FatFileReader(g_fs, FILE_NAME); err = testable->open(); error_checker(err); @@ -159,7 +159,7 @@ TEST(OpenClose) { } TEST(Open_NonExistantFile) { - testable = new FatFileReader(g_fs, BOGUS_FILE_NAME, buffer); + testable = new FatFileReader(g_fs, BOGUS_FILE_NAME); ASSERT_EQ_MSG(FatFile::FILENAME_NOT_FOUND, testable->open()); tearDown(); diff --git a/test/PropWare/fatfilewriter_test.cpp b/test/PropWare/fatfilewriter_test.cpp index ee30caac..aec031fa 100644 --- a/test/PropWare/fatfilewriter_test.cpp +++ b/test/PropWare/fatfilewriter_test.cpp @@ -114,12 +114,12 @@ TEST(ConstructorDestructor) { // Ensure the requested filename was not all upper case (that wouldn't be a very good test if it were) ASSERT_NEQ_MSG(0, strcmp(EXISTING_FILE, EXISTING_FILE_UPPER)); - testable = new FatFileWriter(g_fs, EXISTING_FILE, buffer); + testable = new FatFileWriter(g_fs, EXISTING_FILE); ASSERT_EQ_MSG(0, strcmp(EXISTING_FILE_UPPER, testable->get_name())); ASSERT_EQ_MSG((unsigned int) &pwOut, (unsigned int) testable->m_logger); ASSERT_EQ_MSG((unsigned int) g_fs.get_driver(), (unsigned int) testable->m_driver); - ASSERT_EQ_MSG((unsigned int) &buffer, (unsigned int) testable->m_buf); + ASSERT_EQ_MSG((unsigned int) &PropWare::SHARED_BUFFER, (unsigned int) testable->m_buf); ASSERT_EQ_MSG((unsigned int) testable->m_fs, (unsigned int) &g_fs); ASSERT_EQ_MSG(-1, testable->get_length()); ASSERT_EQ_MSG(false, testable->m_fileMetadataModified); @@ -128,13 +128,13 @@ TEST(ConstructorDestructor) { } TEST(Exists_doesNotExist) { - testable = new FatFileWriter(g_fs, NEW_FILE_NAME, buffer); + testable = new FatFileWriter(g_fs, NEW_FILE_NAME); ASSERT_FALSE(testable->exists()); tearDown(); } TEST(Exists_doesExist) { - testable = new FatFileWriter(g_fs, EXISTING_FILE, buffer); + testable = new FatFileWriter(g_fs, EXISTING_FILE); PropWare::ErrorCode err; const bool exists = testable->exists(err); @@ -146,7 +146,7 @@ TEST(Exists_doesExist) { TEST(OpenClose_ExistingFile) { PropWare::ErrorCode err; - testable = new FatFileWriter(g_fs, EXISTING_FILE, buffer); + testable = new FatFileWriter(g_fs, EXISTING_FILE); err = testable->open(); error_checker(err); @@ -164,7 +164,7 @@ TEST(OpenClose_ExistingFile) { TEST(OpenCloseDelete_NonExistingFile) { PropWare::ErrorCode err; - testable = new FatFileWriter(g_fs, NEW_FILE_NAME, buffer); + testable = new FatFileWriter(g_fs, NEW_FILE_NAME); ASSERT_FALSE(testable->exists());