Skip to content

Commit

Permalink
Move eof.get_error_message test to eof_test.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Feb 9, 2024
1 parent 7d18c1e commit 358b5b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 11 additions & 0 deletions test/unittests/eof_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,14 @@ TEST(eof, read_valid_eof1_header)
EXPECT_EQ(header.types.size() * 4, test_case.types_size) << test_case.code;
}
}

TEST(eof, get_error_message)
{
EXPECT_EQ(evmone::get_error_message(EOFValidationError::success), "success");
EXPECT_EQ(evmone::get_error_message(EOFValidationError::invalid_prefix), "invalid_prefix");
EXPECT_EQ(evmone::get_error_message(EOFValidationError::stack_overflow), "stack_overflow");
EXPECT_EQ(evmone::get_error_message(EOFValidationError::impossible), "impossible");

// NOLINTNEXTLINE(*.EnumCastOutOfRange)
EXPECT_EQ(evmone::get_error_message(static_cast<EOFValidationError>(-1)), "<unknown>");
}
11 changes: 0 additions & 11 deletions test/unittests/eof_validation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@
using namespace evmone;
using namespace evmone::test;

TEST(eof, get_error_message)
{
EXPECT_EQ(evmone::get_error_message(EOFValidationError::success), "success");
EXPECT_EQ(evmone::get_error_message(EOFValidationError::invalid_prefix), "invalid_prefix");
EXPECT_EQ(evmone::get_error_message(EOFValidationError::stack_overflow), "stack_overflow");
EXPECT_EQ(evmone::get_error_message(EOFValidationError::impossible), "impossible");

// NOLINTNEXTLINE(*.EnumCastOutOfRange)
EXPECT_EQ(evmone::get_error_message(static_cast<EOFValidationError>(-1)), "<unknown>");
}

TEST_F(eof_validation, validate_empty_code)
{
add_test_case("", EOFValidationError::invalid_prefix);
Expand Down

0 comments on commit 358b5b8

Please sign in to comment.