Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Dec 29, 2024
1 parent 1d1b090 commit ae0eadb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_engine_asserts.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ TEST_CASE("[GDSDecomp][ResourceLoaderText] ResourceLoaderText::FORMAT_VERSION ha
}

TEST_CASE("[GDSDecomp][ResourceFormatLoaderCompatBinary] ResourceFormatLoaderCompatBinary can load a resource") {
CHECK(gdre::ensure_dir(get_tmp_path()) == OK);
ResourceFormatSaverBinaryInstance saver;
Ref<Resource> resource;
resource.instantiate();
Expand All @@ -61,6 +62,7 @@ TEST_CASE("[GDSDecomp][ResourceFormatLoaderCompatBinary] ResourceFormatLoaderCom
}

TEST_CASE("[GDSDecomp][ResourceFormatLoaderCompatText] ResourceFormatLoaderCompatBinary can load a resource") {
CHECK(gdre::ensure_dir(get_tmp_path()) == OK);
ResourceFormatSaverTextInstance saver;
Ref<Resource> resource;
resource.instantiate();
Expand Down
3 changes: 3 additions & 0 deletions tests/test_gdre_project_loading.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ inline Error create_test_pck(const String &pck_path, const HashMap<String, Strin
}

inline Error store_file_as_string(const String &path, const String &content) {
ERR_FAIL_COND_V(gdre::ensure_dir(path.get_base_dir()) != OK, ERR_FILE_CANT_WRITE);
auto fa = FileAccess::open(path, FileAccess::WRITE);
ERR_FAIL_COND_V(fa.is_null(), ERR_FILE_CANT_OPEN);
ERR_FAIL_COND_V(!fa->store_string(content), ERR_FILE_CANT_WRITE);
Expand Down Expand Up @@ -71,6 +72,7 @@ TEST_CASE("[GDSDecomp] GDRESettings works") {

TEST_CASE("[GDSDecomp][ProjectConfigLoader] loading example from current engine") {
CHECK(ProjectSettings::get_singleton());
CHECK(gdre::ensure_dir(get_tmp_path()) == OK);
auto text_project_path = get_tmp_path().path_join("project.godot");
ProjectSettings::get_singleton()->save_custom(text_project_path);
auto binary_project_path = get_tmp_path().path_join("project.binary");
Expand Down Expand Up @@ -107,6 +109,7 @@ TEST_CASE("[GDSDecomp][ProjectConfigLoader] loading example from current engine"
}

TEST_CASE("[GDSDecomp] GDRESettings project loading") {
CHECK(gdre::ensure_dir(get_tmp_path()) == OK);
auto tmp_pck_path = get_tmp_path().path_join("test.pck");
auto tmp_project_path = get_tmp_path().path_join("project.binary");
CHECK(ProjectSettings::get_singleton());
Expand Down

0 comments on commit ae0eadb

Please sign in to comment.