From 939786fcaa7b9fc8fa533420d2d6afd47c1f8c51 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 8 Apr 2024 00:46:11 -0700 Subject: [PATCH] Param_TEST: Check return values of Param::Get/Set (#1394) Signed-off-by: Steve Peters --- src/Param_TEST.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Param_TEST.cc b/src/Param_TEST.cc index 56f30b4e0..378a088bc 100644 --- a/src/Param_TEST.cc +++ b/src/Param_TEST.cc @@ -46,45 +46,45 @@ TEST(Param, Bool) { sdf::Param boolParam("key", "bool", "true", false, "description"); bool value = true; - boolParam.Get(value); + EXPECT_TRUE(boolParam.Get(value)); EXPECT_TRUE(value); - boolParam.Set(false); - boolParam.Get(value); + EXPECT_TRUE(boolParam.Set(false)); + EXPECT_TRUE(boolParam.Get(value)); EXPECT_FALSE(value); // String parameter that represents a boolean. sdf::Param strParam("key", "string", "true", false, "description"); - strParam.Get(value); + EXPECT_TRUE(strParam.Get(value)); EXPECT_TRUE(value); - strParam.Set("false"); - strParam.Get(value); + EXPECT_TRUE(strParam.Set("false")); + EXPECT_TRUE(strParam.Get(value)); EXPECT_FALSE(value); - strParam.Set("1"); - strParam.Get(value); + EXPECT_TRUE(strParam.Set("1")); + EXPECT_TRUE(strParam.Get(value)); EXPECT_TRUE(value); - strParam.Set("0"); - strParam.Get(value); + EXPECT_TRUE(strParam.Set("0")); + EXPECT_TRUE(strParam.Get(value)); EXPECT_FALSE(value); - strParam.Set("True"); - strParam.Get(value); + EXPECT_TRUE(strParam.Set("True")); + EXPECT_TRUE(strParam.Get(value)); EXPECT_TRUE(value); - strParam.Set("TRUE"); - strParam.Get(value); + EXPECT_TRUE(strParam.Set("TRUE")); + EXPECT_TRUE(strParam.Get(value)); EXPECT_TRUE(value); // Anything other than 1 or true is treated as a false value - strParam.Set("%"); - strParam.Get(value); + EXPECT_TRUE(strParam.Set("%")); + EXPECT_TRUE(strParam.Get(value)); EXPECT_FALSE(value); - boolParam.Set(true); + EXPECT_TRUE(boolParam.Set(true)); std::any anyValue; EXPECT_TRUE(boolParam.GetAny(anyValue)); try