Skip to content

Commit

Permalink
test: explicitly discard write value
Browse files Browse the repository at this point in the history
  • Loading branch information
es3n1n committed Oct 9, 2024
1 parent c5735dc commit 2cd73fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tests/memory/reader.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <es3n1n/common/memory/reader.hpp>
#include <es3n1n/common/memory/address.hpp>
#include <es3n1n/common/memory/reader.hpp>
#include <gtest/gtest.h>
#include <tuple>

inline std::expected<std::size_t, memory::e_error_code> read_impl(void* buffer, const std::uintptr_t address, const std::size_t size) {
inline std::expected<std::size_t, memory::e_error_code> read_impl(void*, const std::uintptr_t, const std::size_t) {
throw std::runtime_error("");
}

inline std::expected<std::size_t, memory::e_error_code> write_impl(std::uintptr_t address, const void* buffer, const std::size_t size) {
inline std::expected<std::size_t, memory::e_error_code> write_impl(std::uintptr_t, const void*, const std::size_t) {
throw std::runtime_error("");
}

Expand All @@ -17,6 +18,6 @@ TEST(reader, read_write_impls) {
EXPECT_THROW(memory::reader.read<int>(0x1234), std::runtime_error);
EXPECT_THROW(memory::reader.write<int>(nullptr, 0), std::runtime_error);

EXPECT_THROW(memory::address(0x1234).read<int>(), std::runtime_error);
EXPECT_THROW(std::ignore = memory::address(0x1234).read<int>(), std::runtime_error);
EXPECT_THROW(memory::address(0x1234).write<int>(0), std::runtime_error);
}

0 comments on commit 2cd73fb

Please sign in to comment.