diff --git a/test/JsonVariant_Comparison_Tests.cpp b/test/JsonVariant_Comparison_Tests.cpp index 401fc645..cc68e6e5 100644 --- a/test/JsonVariant_Comparison_Tests.cpp +++ b/test/JsonVariant_Comparison_Tests.cpp @@ -23,36 +23,36 @@ class JsonVariant_Comparison_Tests : public ::testing::Test { private: template void setValueTo(T expected) { - jsonValue = expected; + actual = expected; } template void mustBeEqualTo(T expected) { - EXPECT_EQ(expected, jsonValue); // operator== - EXPECT_EQ(jsonValue, expected); // operator== - EXPECT_LE(expected, jsonValue); // operator<= - EXPECT_LE(jsonValue, expected); // operator<= - EXPECT_GE(expected, jsonValue); // operator>= - EXPECT_GE(jsonValue, expected); // operator>= + EXPECT_EQ(expected, actual); // operator== + EXPECT_EQ(actual, expected); // operator== + EXPECT_LE(expected, actual); // operator<= + EXPECT_LE(actual, expected); // operator<= + EXPECT_GE(expected, actual); // operator>= + EXPECT_GE(actual, expected); // operator>= } template void mustBeGreaterThan(T expected) { - EXPECT_GT(jsonValue, expected); // operator> - EXPECT_LT(expected, jsonValue); // operator< - EXPECT_NE(jsonValue, expected); // operator!= - EXPECT_NE(expected, jsonValue); // operator!= + EXPECT_GT(actual, expected); // operator> + EXPECT_LT(expected, actual); // operator< + EXPECT_NE(actual, expected); // operator!= + EXPECT_NE(expected, actual); // operator!= } template void mustBeLessThan(T expected) { - EXPECT_LT(jsonValue, expected); // operator< - EXPECT_GT(expected, jsonValue); // operator< - EXPECT_NE(jsonValue, expected); // operator!= - EXPECT_NE(expected, jsonValue); // operator!= + EXPECT_LT(actual, expected); // operator< + EXPECT_GT(expected, actual); // operator< + EXPECT_NE(actual, expected); // operator!= + EXPECT_NE(expected, actual); // operator!= } - JsonVariant jsonValue; + JsonVariant actual; }; TEST_F(JsonVariant_Comparison_Tests, Double) { diff --git a/test/JsonVariant_Copy_Tests.cpp b/test/JsonVariant_Copy_Tests.cpp index d739d755..bd5f7f6b 100644 --- a/test/JsonVariant_Copy_Tests.cpp +++ b/test/JsonVariant_Copy_Tests.cpp @@ -14,58 +14,58 @@ using namespace ArduinoJson; class JsonVariant_Copy_Tests : public ::testing::Test { protected: StaticJsonBuffer<200> json; - JsonVariant jsonValue1; - JsonVariant jsonValue2; + JsonVariant variant1; + JsonVariant variant2; }; TEST_F(JsonVariant_Copy_Tests, IntegersAreCopiedByValue) { - jsonValue1 = 123; - jsonValue2 = jsonValue1; - jsonValue1 = 456; + variant1 = 123; + variant2 = variant1; + variant1 = 456; - EXPECT_EQ(123, jsonValue2.as()); + EXPECT_EQ(123, variant2.as()); } TEST_F(JsonVariant_Copy_Tests, DoublesAreCopiedByValue) { - jsonValue1 = 123.45; - jsonValue2 = jsonValue1; - jsonValue1 = 456.78; + variant1 = 123.45; + variant2 = variant1; + variant1 = 456.78; - EXPECT_EQ(123.45, jsonValue2.as()); + EXPECT_EQ(123.45, variant2.as()); } TEST_F(JsonVariant_Copy_Tests, BooleansAreCopiedByValue) { - jsonValue1 = true; - jsonValue2 = jsonValue1; - jsonValue1 = false; + variant1 = true; + variant2 = variant1; + variant1 = false; - EXPECT_TRUE(jsonValue2.as()); + EXPECT_TRUE(variant2.as()); } TEST_F(JsonVariant_Copy_Tests, StringsAreCopiedByValue) { - jsonValue1 = "hello"; - jsonValue2 = jsonValue1; - jsonValue1 = "world"; + variant1 = "hello"; + variant2 = variant1; + variant1 = "world"; - EXPECT_STREQ("hello", jsonValue2.as()); + EXPECT_STREQ("hello", variant2.as()); } TEST_F(JsonVariant_Copy_Tests, ObjectsAreCopiedByReference) { JsonObject &object = json.createObject(); - jsonValue1 = object; + variant1 = object; object["hello"] = "world"; - EXPECT_EQ(1, jsonValue1.asObject().size()); + EXPECT_EQ(1, variant1.asObject().size()); } TEST_F(JsonVariant_Copy_Tests, ArraysAreCopiedByReference) { JsonArray &array = json.createArray(); - jsonValue1 = array; + variant1 = array; array.add("world"); - EXPECT_EQ(1, jsonValue1.asArray().size()); + EXPECT_EQ(1, variant1.asArray().size()); } diff --git a/test/JsonVariant_Storage_Tests.cpp b/test/JsonVariant_Storage_Tests.cpp index e895775a..68c22370 100644 --- a/test/JsonVariant_Storage_Tests.cpp +++ b/test/JsonVariant_Storage_Tests.cpp @@ -15,17 +15,18 @@ class JsonVariant_Storage_Tests : public ::testing::Test { protected: template void testValue(T expected) { - jsonValue.set(expected); - EXPECT_EQ(expected, jsonValue.as()); + actual.set(expected); + EXPECT_EQ(expected, actual.as()); } template void testReference(T &expected) { - jsonValue.set(expected); - EXPECT_EQ(expected, jsonValue.as()); + actual.set(expected); + EXPECT_EQ(expected, actual.as()); } - JsonVariant jsonValue; + private: + JsonVariant actual; }; TEST_F(JsonVariant_Storage_Tests, Double) { testValue(123.45); }