Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress expected errors in resource unit tests #91028

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/core/io/test_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

#include "thirdparty/doctest/doctest.h"

#include "tests/test_macros.h"

namespace TestResource {

TEST_CASE("[Resource] Duplication") {
Expand Down Expand Up @@ -124,9 +126,12 @@ TEST_CASE("[Resource] Breaking circular references on save") {
const String save_path_binary = OS::get_singleton()->get_cache_path().path_join("resource.res");
const String save_path_text = OS::get_singleton()->get_cache_path().path_join("resource.tres");
ResourceSaver::save(resource_a, save_path_binary);
// Suppress expected errors caused by the resources above being uncached.
ERR_PRINT_OFF;
akien-mga marked this conversation as resolved.
Show resolved Hide resolved
ResourceSaver::save(resource_a, save_path_text);

const Ref<Resource> &loaded_resource_a_binary = ResourceLoader::load(save_path_binary);
ERR_PRINT_ON;
CHECK_MESSAGE(
loaded_resource_a_binary->get_name() == "A",
"The loaded resource name should be equal to the expected value.");
Expand Down
Loading