Allow AsInt from Float EffectParameter, and AsFloat from Int EffectParameter.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-03 21:08:27 +02:00
parent f65b2f74bd
commit 119e71e86a
2 changed files with 8 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ TEST_CASE("Bool EffectParameter", "[Library]") {
TEST_CASE("Int EffectParameter", "[Library]") {
auto p = EffectParameter((int64_t)684);
REQUIRE(p.AsInt() == 684);
REQUIRE(p.AsFloat() == 684);
}
TEST_CASE("String EffectParameter", "[Library]") {
@@ -23,6 +24,7 @@ TEST_CASE("String EffectParameter", "[Library]") {
TEST_CASE("Float EffectParameter", "[Library]") {
auto p = EffectParameter(1.5f);
REQUIRE(p.AsFloat() == Approx(1.5f));
REQUIRE(p.AsInt() == 1);
}
#endif