feat: Add unit test for loading ROM file in OverworldTest

This commit is contained in:
scawful
2024-08-29 19:10:19 -04:00
parent 93d7aa545c
commit 9a293e0ad6
2 changed files with 36 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ add_executable(
test/gfx/compression_test.cc
test/gfx/snes_palette_test.cc
test/integration/test_editor.cc
test/zelda3/overworld_test.cc
test/zelda3/sprite_builder_test.cc
cli/command_handler.cc
app/rom.cc

View File

@@ -0,0 +1,35 @@
#include "app/zelda3/overworld/overworld.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "app/rom.h"
#include "app/zelda3/overworld/overworld_map.h"
namespace yaze {
namespace test {
namespace zelda3 {
class OverworldTest : public ::testing::Test {
protected:
void SetUp() override {}
void TearDown() override {}
app::zelda3::overworld::Overworld overworld_;
};
TEST_F(OverworldTest, OverworldLoadNoRomDataError) {
// Arrange
app::Rom rom;
// Act
auto status = overworld_.Load(rom);
// Assert
EXPECT_FALSE(status.ok());
EXPECT_THAT(status.message(), testing::HasSubstr("ROM file not loaded"));
}
} // namespace zelda3
} // namespace test
} // namespace yaze