mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Fix double delete of the Value in Struct::get_field
This commit is contained in:
parent
c6740fe592
commit
a3d0f3155d
2 changed files with 8 additions and 10 deletions
|
@ -164,11 +164,12 @@ SCENARIO("Struct API")
|
|||
|
||||
REQUIRE(!struc.get_field("not_there"));
|
||||
|
||||
struc.set_field("field_a", Value(true));
|
||||
struc.set_field("field_a", Value(sixtyfps::SharedString("Hallo")));
|
||||
|
||||
auto value_opt = struc.get_field("field_a");
|
||||
REQUIRE(value_opt.has_value());
|
||||
auto value = value_opt.value();
|
||||
REQUIRE(value.to_bool().has_value());
|
||||
REQUIRE(value.to_bool().value() == true);
|
||||
}
|
||||
REQUIRE(value.to_string().has_value());
|
||||
REQUIRE(value.to_string().value() == "Hallo");
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue