From eb6b8e04502c57e7b7620ae8282541737bb7f755 Mon Sep 17 00:00:00 2001 From: fdai7514 Date: Fri, 10 Feb 2023 21:53:59 +0100 Subject: [PATCH] refactoring: change variable names in test_calculatorCube.c --- tests/test_calculatorCube.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/test_calculatorCube.c b/tests/test_calculatorCube.c index 485b8ea..024fcf4 100644 --- a/tests/test_calculatorCube.c +++ b/tests/test_calculatorCube.c @@ -3,6 +3,10 @@ #include "unity.h" #include "calculatorCube.c" +// Note: +/* This Function may or may not be implemented in actual program, even if it is merged to the main branch. + If it is temporarily not included in the main Program, then this has a role in future Development of the Project */ + void setUp(void) { @@ -14,22 +18,23 @@ void tearDown(void) void test1_calculatorCube(void) { - float p, a, e; - p = 5; - a = calculatorCube(p); - e = p * p * p; - TEST_ASSERT_EQUAL_FLOAT(e, a); + float num, actual, expected; //Arrange + num = 5; + expected = num * num * num; + actual = calculatorCube(num); //Act + TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert } void test2_calculatorCube(void) { - float p, a, e; - p = 6; - a = calculatorCube(p); - e = p * p * p; - TEST_ASSERT_EQUAL_FLOAT(e, a); + float num, actual, expected; //Arrange + num = 6; + expected = num * num * num; + actual = calculatorCube(num); //Act + TEST_ASSERT_EQUAL_FLOAT(expected, actual); //Assert } + #endif // TEST