Refactor test files to use consistent namespace structure

This commit is contained in:
scawful
2024-08-14 00:31:22 -04:00
parent 731b8f1c75
commit bdea914c22
11 changed files with 56 additions and 38 deletions

View File

@@ -9,8 +9,9 @@
#include "app/emu/memory/memory.h"
#include "app/emu/memory/mock_memory.h"
namespace yaze_test {
namespace emu_test {
namespace yaze {
namespace test {
namespace emu {
using yaze::app::emu::AsmParser;
using yaze::app::emu::Cpu;
@@ -4197,5 +4198,6 @@ TEST_F(CpuTest, XCESwitchBackAndForth) {
EXPECT_FALSE(cpu.E); // Emulation mode flag should be cleared
}
} // namespace emu_test
} // namespace yaze_test
} // namespace emu
} // namespace test
} // namespace yaze

View File

@@ -6,8 +6,9 @@
#include "app/emu/memory/memory.h"
#include "app/emu/memory/mock_memory.h"
namespace yaze_test {
namespace emu_test {
namespace yaze {
namespace test {
namespace emu {
using yaze::app::emu::Clock;
using yaze::app::emu::memory::MockClock;
@@ -56,5 +57,6 @@ class PpuTest : public ::testing::Test {
}
};
} // namespace emu_test
} // namespace yaze_test
} // namespace emu
} // namespace test
} // namespace yaze

View File

@@ -4,8 +4,9 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
namespace yaze_test {
namespace emu_test {
namespace yaze {
namespace test {
namespace emu {
using testing::_;
using testing::Return;
@@ -470,5 +471,6 @@ TEST_F(Spc700Test, BootIplRomOk) {
// EXPECT_EQ(spc700.PC, 0xFFC1 + 0x3F);
}
} // namespace emu_test
} // namespace yaze_test
} // namespace emu
} // namespace test
} // namespace yaze

View File

@@ -10,8 +10,9 @@
#define BUILD_HEADER(command, length) (command << 5) + (length - 1)
namespace yaze_test {
namespace gfx_test {
namespace yaze {
namespace test {
namespace gfx {
using yaze::app::Rom;
using yaze::app::gfx::lc_lz2::CompressionContext;
@@ -419,5 +420,6 @@ TEST(LC_LZ2_CompressionTest, DecompressionMixingCommand) {
EXPECT_THAT(random1_o, ElementsAreArray(decomp_result.data(), 9));
}
} // namespace gfx_test
} // namespace yaze_test
} // namespace gfx
} // namespace test
} // namespace yaze

View File

@@ -5,8 +5,9 @@
#include "app/gfx/snes_color.h"
namespace yaze_test {
namespace gfx_test {
namespace yaze {
namespace test {
namespace gfx {
using ::testing::ElementsAreArray;
using yaze::app::gfx::ConvertRGBtoSNES;
@@ -92,5 +93,6 @@ TEST(SNESColorTest, Convert) {
EXPECT_THAT(data, ElementsAreArray(snes_string.data(), 10));
}
} // namespace gfx_test
} // namespace yaze_test
} // namespace gfx
} // namespace test
} // namespace yaze

View File

@@ -5,7 +5,8 @@
#include "imgui_test_engine/imgui_te_engine.h"
#include "imgui_test_engine/imgui_te_ui.h"
namespace yaze_test {
namespace yaze {
namespace test {
namespace integration {
absl::Status TestEditor::Update() {
@@ -35,4 +36,5 @@ void TestEditor::RegisterTests(ImGuiTestEngine* engine) {
}
} // namespace integration
} // namespace yaze_test
} // namespace test
} // namespace yaze

View File

@@ -6,7 +6,8 @@
#include "imgui_test_engine/imgui_te_context.h"
#include "imgui_test_engine/imgui_te_engine.h"
namespace yaze_test {
namespace yaze {
namespace test {
namespace integration {
class TestEditor : public yaze::app::editor::Editor {
@@ -39,12 +40,12 @@ class TestEditor : public yaze::app::editor::Editor {
void RegisterTests(ImGuiTestEngine* engine);
private:
private:
ImGuiTestEngine* engine_;
};
} // namespace integration
} // namespace yaze_test
} // namespace test
} // namespace yaze
#endif // YAZE_TEST_INTEGRATION_TEST_EDITOR_H

View File

@@ -2,7 +2,8 @@
#include "yaze.h"
namespace yaze_test {
namespace yaze {
namespace test {
TEST(YazeCLibTest, InitializeAndCleanup) {
yaze_flags flags;
@@ -10,4 +11,5 @@ TEST(YazeCLibTest, InitializeAndCleanup) {
yaze_cleanup(&flags);
}
} // namespace yaze_test
} // namespace test
} // namespace yaze

View File

@@ -26,7 +26,7 @@ int main(int argc, char* argv[]) {
if (argc > 1 && std::string(argv[1]) == "integration") {
// Support the ability to launch an integration test window.
// SDL_SetMainReady();
yaze_test::integration::TestEditor test_editor;
yaze::test::integration::TestEditor test_editor;
yaze::app::core::Controller controller;
controller.init_test_editor(&test_editor);

View File

@@ -10,8 +10,9 @@
#include "app/gfx/bitmap.h"
#include "app/rom.h"
namespace yaze_test {
namespace zelda3_test {
namespace yaze {
namespace test {
namespace zelda3 {
using yaze::app::Rom;
using yaze::app::zelda3::dungeon::DungeonObjectRenderer;
@@ -24,5 +25,6 @@ TEST(DungeonObjectTest, RenderObjectsAsBitmaps) {
DungeonObjectRenderer renderer;
}
} // namespace zelda3_test
} // namespace yaze_test
} // namespace zelda3
} // namespace test
} // namespace yaze

View File

@@ -3,8 +3,9 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
namespace yaze_test {
namespace zelda3_test {
namespace yaze {
namespace test {
namespace zelda3 {
using namespace yaze::app::zelda3;
@@ -54,12 +55,12 @@ class SpriteBuilderTest : public ::testing::Test {
};
TEST_F(SpriteBuilderTest, BuildSpritePropertiesOk) {
EXPECT_THAT(sprite.BuildProperties(),
testing::HasSubstr(R"(!SPRID = $00
EXPECT_THAT(sprite.BuildProperties(), testing::HasSubstr(R"(!SPRID = $00
!NbrTiles = $00
!Harmless = $00
)"));
}
} // namespace zelda3_test
} // namespace yaze_test
} // namespace test
} // namespace yaze