mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 22:39:09 -05:00
+22
-30
@@ -27,13 +27,12 @@
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <openspace/scene/assetloader.h>
|
||||
#include <openspace/scene/assetmanager.h>
|
||||
#include <openspace/scene/asset.h>
|
||||
#include <openspace/scene/scene.h>
|
||||
#include <openspace/scene/scenegraphnode.h>
|
||||
#include <openspace/scene/sceneinitializer.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
#include <openspace/util/synchronizationwatcher.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/lua/lua_helper.h>
|
||||
#include <ghoul/misc/dictionaryluaformatter.h>
|
||||
@@ -53,10 +52,8 @@ namespace {
|
||||
TEST_CASE("AssetLoader: Assertion", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
openspace::AssetManager assetLoader(
|
||||
state,
|
||||
&syncWatcher,
|
||||
absPath("${TESTDIR}/AssetLoaderTest/").string()
|
||||
);
|
||||
|
||||
@@ -67,10 +64,8 @@ TEST_CASE("AssetLoader: Assertion", "[assetloader]") {
|
||||
TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
openspace::AssetManager assetLoader(
|
||||
state,
|
||||
&syncWatcher,
|
||||
absPath("${TESTDIR}/AssetLoaderTest/").string()
|
||||
);
|
||||
|
||||
@@ -80,32 +75,29 @@ TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") {
|
||||
TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
openspace::AssetManager assetLoader(
|
||||
state,
|
||||
&syncWatcher,
|
||||
absPath("${TESTDIR}/AssetLoaderTest/").string()
|
||||
);
|
||||
|
||||
REQUIRE_NOTHROW(assetLoader.add("assetfunctionsexist"));
|
||||
}
|
||||
|
||||
TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
state,
|
||||
&syncWatcher,
|
||||
absPath("${TESTDIR}/AssetLoaderTest/").string()
|
||||
);
|
||||
|
||||
bool passed;
|
||||
lua_pushlightuserdata(*state, &passed);
|
||||
lua_pushcclosure(*state, &passTest, 1);
|
||||
lua_setglobal(*state, "passTest");
|
||||
|
||||
std::shared_ptr<openspace::Asset> asset = assetLoader.add("initialization");
|
||||
REQUIRE_NOTHROW(asset->initialize());
|
||||
REQUIRE(passed);
|
||||
}
|
||||
//TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") {
|
||||
// openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
// ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
// openspace::SynchronizationWatcher syncWatcher;
|
||||
// openspace::AssetManager assetLoader(
|
||||
// state,
|
||||
// absPath("${TESTDIR}/AssetLoaderTest/").string()
|
||||
// );
|
||||
//
|
||||
// bool passed;
|
||||
// lua_pushlightuserdata(*state, &passed);
|
||||
// lua_pushcclosure(*state, &passTest, 1);
|
||||
// lua_setglobal(*state, "passTest");
|
||||
//
|
||||
// std::shared_ptr<openspace::Asset> asset = assetLoader.add("initialization");
|
||||
// REQUIRE_NOTHROW(asset->initialize());
|
||||
// REQUIRE(passed);
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user