From d5a174a6d4f8be5e7cffe7c2adbb8db23b578f56 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Thu, 2 Jan 2025 18:49:56 -0600 Subject: Fixing errors in Vector. --- test/test_file.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test/test_file.cpp') diff --git a/test/test_file.cpp b/test/test_file.cpp index 12cfb98..c1ce4f1 100644 --- a/test/test_file.cpp +++ b/test/test_file.cpp @@ -21,11 +21,11 @@ #include "test_common.hpp" #include "gtest/gtest.h" -#include #include #include #include -#include + +// NOLINTBEGIN(readability-magic-numbers) namespace fud { @@ -121,6 +121,7 @@ TEST(FudBufferedFile, OpenReadWrite) ASSERT_EQ(bufferedFile.file().size().getOkayOr(std::numeric_limits::max()), 0); auto writeResult = bufferedFile.write( + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) reinterpret_cast(testName.data()), testName.size(), NullOpt); @@ -132,6 +133,7 @@ TEST(FudBufferedFile, OpenReadWrite) ASSERT_EQ(bufferedFile.seekStart(), FudStatus::Success); Vector output{Vector::withSize(testName.size()).takeOkay()}; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) auto readResult = bufferedFile.read(reinterpret_cast(output.data()), testName.size(), NullOpt); ASSERT_EQ(readResult, expected); @@ -142,11 +144,13 @@ TEST(FudBufferedFile, OpenReadWrite) ASSERT_EQ(bufferedFile.seekStart(), FudStatus::Success); expected.bytesDrained = 1; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) readResult = bufferedFile.read(reinterpret_cast(output.data()), 1, NullOpt); ASSERT_EQ(readResult, expected); EXPECT_EQ(output[0], testName.data()[0]); expected.bytesDrained = testName.size() - 2; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) readResult = bufferedFile.read(reinterpret_cast(output.data()) + 1, testName.size() - 2, NullOpt); ASSERT_EQ(readResult, expected); EXPECT_EQ( @@ -154,6 +158,7 @@ TEST(FudBufferedFile, OpenReadWrite) compareMem(output.data() + 1, output.size() - 1, testName.data() + 1, testName.size() - 2).takeOkayOr(-1)); expected.bytesDrained = 1; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) readResult = bufferedFile.read(reinterpret_cast(output.data()), 1, NullOpt); EXPECT_TRUE(readResult.status == FudStatus::Success || readResult.status == FudStatus::Partial); @@ -164,3 +169,5 @@ TEST(FudBufferedFile, OpenReadWrite) } } // namespace fud + +// NOLINTEND(readability-magic-numbers) -- cgit v1.2.3