feat: Add unit test for loading ROM file in OverworldTest
This commit is contained in:
@@ -8,6 +8,7 @@ add_executable(
|
|||||||
test/gfx/compression_test.cc
|
test/gfx/compression_test.cc
|
||||||
test/gfx/snes_palette_test.cc
|
test/gfx/snes_palette_test.cc
|
||||||
test/integration/test_editor.cc
|
test/integration/test_editor.cc
|
||||||
|
test/zelda3/overworld_test.cc
|
||||||
test/zelda3/sprite_builder_test.cc
|
test/zelda3/sprite_builder_test.cc
|
||||||
cli/command_handler.cc
|
cli/command_handler.cc
|
||||||
app/rom.cc
|
app/rom.cc
|
||||||
|
|||||||
35
src/test/zelda3/overworld_test.cc
Normal file
35
src/test/zelda3/overworld_test.cc
Normal 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
|
||||||
Reference in New Issue
Block a user