Skip to content

Commit

Permalink
added sdk test
Browse files Browse the repository at this point in the history
  • Loading branch information
hant-hub committed Dec 28, 2024
1 parent f73b567 commit 097c8f9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
9 changes: 3 additions & 6 deletions library/src/interactor_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,9 @@ interactor_impl::interactor_impl(options& options, window_impl& window, scene_im

//----------------------------------------------------------------------------
interactor_impl::~interactor_impl() {
vtkOutputWindow::GetInstance()->RemoveObservers(
vtkF3DConsoleOutputWindow::TriggerEvent);
vtkOutputWindow::GetInstance()->RemoveObservers(
vtkF3DConsoleOutputWindow::ShowEvent);
vtkOutputWindow::GetInstance()->RemoveObservers(
vtkF3DConsoleOutputWindow::HideEvent);
vtkOutputWindow::GetInstance()->RemoveObservers(vtkF3DConsoleOutputWindow::TriggerEvent);
vtkOutputWindow::GetInstance()->RemoveObservers(vtkF3DConsoleOutputWindow::ShowEvent);
vtkOutputWindow::GetInstance()->RemoveObservers(vtkF3DConsoleOutputWindow::HideEvent);
}

//----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions library/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ list(APPEND libf3dSDKTests_list
TestSDKDynamicLightIntensity.cxx
TestSDKEngine.cxx
TestSDKEngineExceptions.cxx
TestSDKEngineRecreation.cxx
TestSDKImage.cxx
TestSDKInteractorDropFullScene.cxx
TestSDKInteractorCommand.cxx
Expand Down
25 changes: 25 additions & 0 deletions library/testing/TestSDKEngineRecreation.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <engine.h>
#include <interactor.h>
#include <log.h>
#include <options.h>
#include <scene.h>
#include <window.h>

#include <iostream>

int TestSDKEngineRecreation (int argc, char* argv[]) {

std::string filename = "TestSDKEngineRecreation";
std::string interactionFilePath = std::string(argv[2]) + "../../" + filename + ".log";
f3d::engine* eng = new f3d::engine(f3d::engine::create(false));
eng->getInteractor().start(1/30, [eng](){
eng->getInteractor().stop();
});
delete eng;
for (int i = 0; i < 5; i++) {
f3d::engine* eng2 = new f3d::engine(f3d::engine::create(false));
eng2->getInteractor().playInteraction(interactionFilePath);
}

return EXIT_SUCCESS;
}
21 changes: 21 additions & 0 deletions testing/recordings/TestSDKEngineRecreation.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# StreamVersion 1.2
ExposeEvent 0 599 0 0 0 0 0
RenderEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
TimerEvent 0 599 0 0 0 0 0
KeyPressEvent -379 463 0 27 1 Escape 0
CharEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
KeyReleaseEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
KeyPressEvent -379 463 0 27 1 Escape 0
CharEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
KeyReleaseEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0
TimerEvent -379 463 0 27 1 Escape 0

0 comments on commit 097c8f9

Please sign in to comment.