diff --git a/src/app/core/controller.cc b/src/app/core/controller.cc index 917c2d32..b459102b 100644 --- a/src/app/core/controller.cc +++ b/src/app/core/controller.cc @@ -108,10 +108,9 @@ absl::Status Controller::OnLoad() { return absl::OkStatus(); } -absl::Status Controller::OnTestLoad() { - RETURN_IF_ERROR(test_editor_->Update()); - return absl::OkStatus(); -} + + + void Controller::DoRender() const { ImGui::Render(); diff --git a/src/app/core/controller.h b/src/app/core/controller.h index 4ae36c8a..79d26e1b 100644 --- a/src/app/core/controller.h +++ b/src/app/core/controller.h @@ -33,7 +33,6 @@ class Controller { void Initialize(std::string filename = ""); void OnInput(); absl::Status OnLoad(); - absl::Status OnTestLoad(); void DoRender() const; void OnExit(); @@ -44,7 +43,6 @@ class Controller { absl::Status LoadConfigFiles(); auto window() -> SDL_Window * { return window_.get(); } - void init_test_editor(editor::Editor *editor) { test_editor_ = editor; } void set_active(bool active) { active_ = active; } auto active() const { return active_; } @@ -52,7 +50,6 @@ class Controller { friend int ::main(int argc, char **argv); bool active_ = false; - editor::Editor *test_editor_ = nullptr; editor::EditorManager editor_manager_; int audio_frequency_ = 48000; diff --git a/test/integration/test_editor.cc b/test/integration/test_editor.cc index 45cfbba3..dc5c0168 100644 --- a/test/integration/test_editor.cc +++ b/test/integration/test_editor.cc @@ -15,7 +15,6 @@ namespace yaze { namespace test { -namespace integration { absl::Status TestEditor::Update() { ImGui::NewFrame(); @@ -44,10 +43,7 @@ void TestEditor::RegisterTests(ImGuiTestEngine* engine) { } int RunIntegrationTest() { - yaze::test::integration::TestEditor test_editor; yaze::core::Controller controller; - controller.init_test_editor(&test_editor); - if (!controller.CreateWindow().ok()) { return EXIT_FAILURE; } @@ -71,6 +67,7 @@ int RunIntegrationTest() { controller.window(), yaze::core::Renderer::GetInstance().renderer()); ImGui_ImplSDLRenderer2_Init(yaze::core::Renderer::GetInstance().renderer()); + yaze::test::integration::TestEditor test_editor; test_editor.RegisterTests(engine); ImGuiTestEngine_Start(engine, ImGui::GetCurrentContext()); controller.set_active(true); @@ -84,9 +81,7 @@ int RunIntegrationTest() { while (controller.IsActive()) { controller.OnInput(); - if (const auto status = controller.OnTestLoad(); !status.ok()) { - return EXIT_FAILURE; - } + test_editor.Update(); controller.DoRender(); } @@ -95,6 +90,5 @@ int RunIntegrationTest() { return EXIT_SUCCESS; } -} // namespace integration } // namespace test } // namespace yaze diff --git a/test/yaze_test.cc b/test/yaze_test.cc index 8534ae60..e86e535b 100644 --- a/test/yaze_test.cc +++ b/test/yaze_test.cc @@ -13,11 +13,11 @@ int main(int argc, char* argv[]) { absl::InstallFailureSignalHandler(options); if (argc > 1 && std::string(argv[1]) == "integration") { - return yaze::test::integration::RunIntegrationTest(); + return yaze::test::RunIntegrationTest(); } else if (argc > 1 && std::string(argv[1]) == "room_object") { ::testing::InitGoogleTest(&argc, argv); if (!RUN_ALL_TESTS()) { - return yaze::test::integration::RunIntegrationTest(); + return yaze::test::RunIntegrationTest(); } }