Skip to content

Commit

Permalink
fix scripting engine UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
zpl-zak committed Jan 9, 2024
1 parent 1da1a03 commit 3fcd499
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions code/tests/modules/scripting_engine_ut.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@
MODULE(scripting_engine, {
using namespace Framework::Scripting;

IT("can allocate and deallocate a valid NodeJS scripting engine instance", {
Module *pEngine = new Module;

// Init the engine and make sure everything went fine
EQUALS(pEngine->Init(EngineTypes::ENGINE_NODE, NULL), ModuleError::MODULE_NONE);
NEQUALS(pEngine->GetEngine(), nullptr);
NEQUALS(reinterpret_cast<Engines::Node::Engine *>(pEngine->GetEngine())->GetIsolate(), nullptr);
NEQUALS(reinterpret_cast<Engines::Node::Engine *>(pEngine->GetEngine())->GetPlatform(), nullptr);

// Shutdown the engine and make sure everything went down
EQUALS(pEngine->Shutdown(), ModuleError::MODULE_NONE);
EQUALS(reinterpret_cast<Engines::Node::Engine *>(pEngine->GetEngine())->GetIsolate(), nullptr);
EQUALS(reinterpret_cast<Engines::Node::Engine *>(pEngine->GetEngine())->GetPlatform(), nullptr);

delete pEngine;
});

IT("can allocate and deallocate a valid scripting engine instance, then do it again to test re-entry", {
Module *pEngine = new Module;

Expand All @@ -48,6 +31,7 @@ MODULE(scripting_engine, {
delete pEngine;

// Intentionally duplicated to test engine for re-entry
pEngine = new Module;

// Init the engine and make sure everything went fine
EQUALS(pEngine->Init(EngineTypes::ENGINE_NODE, NULL), ModuleError::MODULE_NONE);
Expand Down

0 comments on commit 3fcd499

Please sign in to comment.