Add API to sixtyfps::Image in Rust and C++ to access the optional path

This commit is contained in:
Simon Hausmann 2021-09-27 16:39:00 +02:00 committed by Simon Hausmann
parent bbe178aadf
commit 4eef8c7688
5 changed files with 39 additions and 0 deletions

View file

@ -86,6 +86,9 @@ TEST_CASE("Image")
REQUIRE(size.width == 0.);
REQUIRE(size.height == 0.);
}
{
REQUIRE(!img.path().has_value());
}
img = Image::load_from_path(SOURCE_DIR "/../../vscode_extension/extension-logo.png");
{
@ -93,6 +96,11 @@ TEST_CASE("Image")
REQUIRE(size.width == 128.);
REQUIRE(size.height == 128.);
}
{
auto actual_path = img.path();
REQUIRE(actual_path.has_value());
REQUIRE(*actual_path == SOURCE_DIR "/../../vscode_extension/extension-logo.png");
}
}
TEST_CASE("SharedVector")