From 5b5c4dccea4bcf6e14735dfe6846634fe512d507 Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Fri, 20 Jan 2023 19:08:26 +0100 Subject: [PATCH] refactoring: replaced variables with arrays and the consecutive use of assertions with for-loops --- tests/build/test/cache/test_LoginCustomer.c | 270 ++---------------- tests/build/test/out/c/LoginCustomer.o | Bin 2804 -> 3008 bytes tests/build/test/out/c/test_LoginCustomer.o | Bin 5684 -> 4140 bytes .../test/out/c/test_LoginCustomer_runner.o | Bin 6640 -> 6640 bytes tests/build/test/out/test_LoginCustomer.out | Bin 57036 -> 56560 bytes .../preprocess/files/test_LoginCustomer.c | 270 ++---------------- .../test/results/test_LoginCustomer.pass | 4 +- .../test/runners/test_LoginCustomer_runner.c | 2 +- tests/test/test_LoginCustomer.c | 64 +---- 9 files changed, 74 insertions(+), 536 deletions(-) diff --git a/tests/build/test/cache/test_LoginCustomer.c b/tests/build/test/cache/test_LoginCustomer.c index 5149d92..28f8ec8 100644 --- a/tests/build/test/cache/test_LoginCustomer.c +++ b/tests/build/test/cache/test_LoginCustomer.c @@ -1,297 +1,87 @@ #include "Semester/ProgMeth/Bankmanagement/bankmanagement-system/src/LoginCustomer.h" #include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" - - void setUp(){}; void tearDown(){}; - - void test_checkLogin() { - - - - -_Bool - - test_1_to_true = (4==4); - - - -_Bool - - test_2_to_true = ( - - 1 - - == - - 1 - - ); - - - -_Bool - - test_3_to_true = (1==1); - - - -_Bool - - test_4_to_true = ( - - 0 - - == - - 0 - - ); - - - -_Bool - - test_5_to_true = ('z'=='z'); - - - -_Bool - - test_6_to_true = ('='=='='); - - - -_Bool - - test_7_to_true = (0x1A==0x1A); - - - - - -_Bool - - test_1_to_false = (4!=4); - - - -_Bool - - test_2_to_false = ( - - 1 - - == - - 0 - - ); - - - -_Bool - - test_3_to_false = (1==0); - - - -_Bool - - test_4_to_false = ( - - 0 - - == - - 1 - - ); - - - -_Bool - - test_5_to_false = ('z'=='x'); - - - -_Bool - - test_6_to_false = ('!'==')'); - - - -_Bool - - test_7_to_false = (0x1A==0x2B); - - - - - - - - - -_Bool - - result_1 = checkLogin(test_1_to_true); - - - -_Bool - - result_2 = checkLogin(test_2_to_true); - - - -_Bool - - result_3 = checkLogin(test_3_to_true); - - - -_Bool - - result_4 = checkLogin(test_4_to_true); - - - -_Bool - - result_5 = checkLogin(test_5_to_true); - - - -_Bool - - result_6 = checkLogin(test_6_to_true); - _Bool - result_7 = checkLogin(test_7_to_true); + expected_test_values_compute_to_true[] = {4==4, + 1 + == - + 1 -_Bool + , 1==1, - result_8 = checkLogin(test_1_to_false); + 0 - + == -_Bool + 0 - result_9 = checkLogin(test_2_to_false); + , 'z'=='z', '='=='=',0x1A==0x1A}; - - -_Bool - - result_10 = checkLogin(test_3_to_false); - - - -_Bool - - result_11 = checkLogin(test_4_to_false); - - - -_Bool + int length_1 = sizeof(expected_test_values_compute_to_true)/sizeof( - result_12 = checkLogin(test_5_to_false); + _Bool - + ); -_Bool - result_13 = checkLogin(test_6_to_false); _Bool - result_14 = checkLogin(test_7_to_false); - - - - - - - - do {if ((result_1== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(47)));}} while(0); - - do {if ((result_2== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(48)));}} while(0); - - do {if ((result_3== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(49)));}} while(0); - - do {if ((result_4== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(50)));}} while(0); - - do {if ((result_5== + expected_test_values_compute_to_false[] = {4!=4, -1 + 1 -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(51)));}} while(0); + == - do {if ((result_6== + 0 -1 + ,1==0, -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(52)));}} while(0); + 0 - do {if ((result_7== + == -1 + 1 -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(53)));}} while(0); + ,'z'=='x','!'==')',0x1A==0x2B}; + int length_2 = sizeof(expected_test_values_compute_to_false)/sizeof( + _Bool - do {if (!(result_8)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(55)));}} while(0); + ); - do {if (!(result_9)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(56)));}} while(0); - do {if (!(result_10)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(57)));}} while(0); - do {if (!(result_11)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(58)));}} while(0); - do {if (!(result_12)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(59)));}} while(0); - do {if (!(result_13)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(60)));}} while(0); + for(int i=0;i<7;++i) { - do {if (!(result_14)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(61)));}} while(0); + do {if ((checkLogin(expected_test_values_compute_to_true[i]))) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(16)));}} while(0); + } + for(int i=0;i<7;++i){ + do {if (!(checkLogin(expected_test_values_compute_to_false[i]))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(19)));}} while(0); + } } diff --git a/tests/build/test/out/c/LoginCustomer.o b/tests/build/test/out/c/LoginCustomer.o index 8cb00aec5296a1fa79d354c6f99e9afe806a462d..82cb77b53f1898426f37bd91e324cb4ef976af5c 100644 G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} z=o$`{KA3k?M!f6(qPQlCL4CAbWI~+x?s41KMqbz|2li1M+T)t+d!r`OXuphVQ_MNKO*khaOt!k!Z0|w zKI|p$bHlVKu+Q*Zye+uT{UzCM88XEv)rWtJxXCr2Bf(o=6V>Og7rbq_^}Rqg%3xlQ z-lTmxhsMTD@FBm%=*C^9!C2}Bu@7dM@e%N>OrE%l*R2L;iB|7 IKW^NA0Cv(lyZ`_I diff --git a/tests/build/test/out/c/test_LoginCustomer_runner.o b/tests/build/test/out/c/test_LoginCustomer_runner.o index 1efa0098329f45793f30fa73f4997cbedd2b4014..f839ac15db6dc490a724e363b3356e2a82b4c553 100644 GIT binary patch delta 14 Vcmexh{K0s`OGZZ4&94~QBmgtQ1)~4} delta 14 Vcmexh{K0s`OGZZa&94~QBmgtc1*HH0 diff --git a/tests/build/test/out/test_LoginCustomer.out b/tests/build/test/out/test_LoginCustomer.out index 8a1d6b840aca594c50b2cb8af06caf8d3c8f2c6a..3c7dca5801f8cdc804c4dffb9f5d46be60fb1cc1 100755 GIT binary patch delta 10958 zcmaJ{3tUvy*57B(oHK(A%j`* zc(8D4`G~Tn^S69|uRkOm^7mo8J)YbZRqJ=vZ?HYX`S-peI;d+xyClY{_S&kh8)wNY zsvJjEo!143``bS}9*Eo%lEj>#A+8J3{_Jn?{TAPg_+G;IGQL-&#_a1R##m$aY5cP3 zjoIfI+n?PGhFjy`A^x?VD@I?a&b}iZwQgnBt-GqOTXNkWYuzu|H7}s*x_OpuMO9Y{ z!JV9du%KI2c1J01Y|OsN#*vE$R*XJfoqe;7i&F0hZc4hBpcPevRWH}#$;(Z6xv7-z zt*NQbzxQdw=w+84#c3{8jCidcD)8*D_6@^*YC^HP)-uPLFNueXZHnYr8*ir<)Wl!nDK&+J~WNv;)x+mf7WuezF? za<9g4Xtabl^S%aB<<;oyP1SuFQbizguMPS4M)w!VTbhi$`a4;_}e zzy4V~7SS!H5gCR&tj5TGOoAU28W#4J~;ry+$r{;&Kp}9BzR9_SMrh)tX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OuAA0QWC2dKku*kbVP9f4eWxBj~0Oz5&LBOvc{S4SWDRDVDJ> zbi5bXxS^y5s)4O=AXS%pfQ@@8k~18{=@X8=;0XHz8wU(2pFA&re*S`K(~>4vcn_~q zD_%d|%*Kbe6}wKmR9c&`YF|7(L}@M3&O|iYf=r+{vtsO-7ZhF@C4Tre+H&zl{H0Zd zoQ+YJzk*~57G2Lqt6#mt*ug+C?QFEAd^hq=l$?#R)E>njjKqg$W5WDS;lEMf++sXN G@qYlX7%#g3 diff --git a/tests/build/test/preprocess/files/test_LoginCustomer.c b/tests/build/test/preprocess/files/test_LoginCustomer.c index 5149d92..28f8ec8 100644 --- a/tests/build/test/preprocess/files/test_LoginCustomer.c +++ b/tests/build/test/preprocess/files/test_LoginCustomer.c @@ -1,297 +1,87 @@ #include "Semester/ProgMeth/Bankmanagement/bankmanagement-system/src/LoginCustomer.h" #include "/var/lib/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" - - void setUp(){}; void tearDown(){}; - - void test_checkLogin() { - - - - -_Bool - - test_1_to_true = (4==4); - - - -_Bool - - test_2_to_true = ( - - 1 - - == - - 1 - - ); - - - -_Bool - - test_3_to_true = (1==1); - - - -_Bool - - test_4_to_true = ( - - 0 - - == - - 0 - - ); - - - -_Bool - - test_5_to_true = ('z'=='z'); - - - -_Bool - - test_6_to_true = ('='=='='); - - - -_Bool - - test_7_to_true = (0x1A==0x1A); - - - - - -_Bool - - test_1_to_false = (4!=4); - - - -_Bool - - test_2_to_false = ( - - 1 - - == - - 0 - - ); - - - -_Bool - - test_3_to_false = (1==0); - - - -_Bool - - test_4_to_false = ( - - 0 - - == - - 1 - - ); - - - -_Bool - - test_5_to_false = ('z'=='x'); - - - -_Bool - - test_6_to_false = ('!'==')'); - - - -_Bool - - test_7_to_false = (0x1A==0x2B); - - - - - - - - - -_Bool - - result_1 = checkLogin(test_1_to_true); - - - -_Bool - - result_2 = checkLogin(test_2_to_true); - - - -_Bool - - result_3 = checkLogin(test_3_to_true); - - - -_Bool - - result_4 = checkLogin(test_4_to_true); - - - -_Bool - - result_5 = checkLogin(test_5_to_true); - - - -_Bool - - result_6 = checkLogin(test_6_to_true); - _Bool - result_7 = checkLogin(test_7_to_true); + expected_test_values_compute_to_true[] = {4==4, + 1 + == - + 1 -_Bool + , 1==1, - result_8 = checkLogin(test_1_to_false); + 0 - + == -_Bool + 0 - result_9 = checkLogin(test_2_to_false); + , 'z'=='z', '='=='=',0x1A==0x1A}; - - -_Bool - - result_10 = checkLogin(test_3_to_false); - - - -_Bool - - result_11 = checkLogin(test_4_to_false); - - - -_Bool + int length_1 = sizeof(expected_test_values_compute_to_true)/sizeof( - result_12 = checkLogin(test_5_to_false); + _Bool - + ); -_Bool - result_13 = checkLogin(test_6_to_false); _Bool - result_14 = checkLogin(test_7_to_false); - - - - - - - - do {if ((result_1== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(47)));}} while(0); - - do {if ((result_2== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(48)));}} while(0); - - do {if ((result_3== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(49)));}} while(0); - - do {if ((result_4== - -1 - -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(50)));}} while(0); - - do {if ((result_5== + expected_test_values_compute_to_false[] = {4!=4, -1 + 1 -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(51)));}} while(0); + == - do {if ((result_6== + 0 -1 + ,1==0, -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(52)));}} while(0); + 0 - do {if ((result_7== + == -1 + 1 -)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(53)));}} while(0); + ,'z'=='x','!'==')',0x1A==0x2B}; + int length_2 = sizeof(expected_test_values_compute_to_false)/sizeof( + _Bool - do {if (!(result_8)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(55)));}} while(0); + ); - do {if (!(result_9)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(56)));}} while(0); - do {if (!(result_10)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(57)));}} while(0); - do {if (!(result_11)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(58)));}} while(0); - do {if (!(result_12)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(59)));}} while(0); - do {if (!(result_13)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(60)));}} while(0); + for(int i=0;i<7;++i) { - do {if (!(result_14)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(61)));}} while(0); + do {if ((checkLogin(expected_test_values_compute_to_true[i]))) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(16)));}} while(0); + } + for(int i=0;i<7;++i){ + do {if (!(checkLogin(expected_test_values_compute_to_false[i]))) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(19)));}} while(0); + } } diff --git a/tests/build/test/results/test_LoginCustomer.pass b/tests/build/test/results/test_LoginCustomer.pass index bd31688..730ed0b 100644 --- a/tests/build/test/results/test_LoginCustomer.pass +++ b/tests/build/test/results/test_LoginCustomer.pass @@ -4,7 +4,7 @@ :file: test_LoginCustomer.c :successes: - :test: test_checkLogin - :line: 7 + :line: 5 :message: '' :unity_test_time: 0 :failures: [] @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0017807170006562956 +:time: 0.001912861000164412 diff --git a/tests/build/test/runners/test_LoginCustomer_runner.c b/tests/build/test/runners/test_LoginCustomer_runner.c index f847d37..f061ca9 100644 --- a/tests/build/test/runners/test_LoginCustomer_runner.c +++ b/tests/build/test/runners/test_LoginCustomer_runner.c @@ -75,7 +75,7 @@ static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE l int main(void) { UnityBegin("test_LoginCustomer.c"); - run_test(test_checkLogin, "test_checkLogin", 7); + run_test(test_checkLogin, "test_checkLogin", 5); return UnityEnd(); } diff --git a/tests/test/test_LoginCustomer.c b/tests/test/test_LoginCustomer.c index fc23e10..610a847 100644 --- a/tests/test/test_LoginCustomer.c +++ b/tests/test/test_LoginCustomer.c @@ -1,63 +1,21 @@ #include #include "LoginCustomer.h" - void setUp(){}; void tearDown(){}; - void test_checkLogin() { /*arrange*/ - - bool test_1_to_true = (4==4); - bool test_2_to_true = (true==true); - bool test_3_to_true = (1==1); - bool test_4_to_true = (false==false); - bool test_5_to_true = ('z'=='z'); - bool test_6_to_true = ('='=='='); - bool test_7_to_true = (0x1A==0x1A); - - bool test_1_to_false = (4!=4); - bool test_2_to_false = (true==false); - bool test_3_to_false = (1==0); - bool test_4_to_false = (false==true); - bool test_5_to_false = ('z'=='x'); - bool test_6_to_false = ('!'==')'); - bool test_7_to_false = (0x1A==0x2B); + bool expected_test_values_compute_to_true[] = {4==4,true==true, 1==1, false==false, 'z'=='z', '='=='=',0x1A==0x1A}; + int length_1 = sizeof(expected_test_values_compute_to_true)/sizeof(bool); - /*act*/ - - bool result_1 = checkLogin(test_1_to_true); - bool result_2 = checkLogin(test_2_to_true); - bool result_3 = checkLogin(test_3_to_true); - bool result_4 = checkLogin(test_4_to_true); - bool result_5 = checkLogin(test_5_to_true); - bool result_6 = checkLogin(test_6_to_true); - bool result_7 = checkLogin(test_7_to_true); - - bool result_8 = checkLogin(test_1_to_false); - bool result_9 = checkLogin(test_2_to_false); - bool result_10 = checkLogin(test_3_to_false); - bool result_11 = checkLogin(test_4_to_false); - bool result_12 = checkLogin(test_5_to_false); - bool result_13 = checkLogin(test_6_to_false); - bool result_14 = checkLogin(test_7_to_false); - - /*assertions*/ - - TEST_ASSERT_TRUE(result_1); - TEST_ASSERT_TRUE(result_2); - TEST_ASSERT_TRUE(result_3); - TEST_ASSERT_TRUE(result_4); - TEST_ASSERT_TRUE(result_5); - TEST_ASSERT_TRUE(result_6); - TEST_ASSERT_TRUE(result_7); - - TEST_ASSERT_FALSE(result_8); - TEST_ASSERT_FALSE(result_9); - TEST_ASSERT_FALSE(result_10); - TEST_ASSERT_FALSE(result_11); - TEST_ASSERT_FALSE(result_12); - TEST_ASSERT_FALSE(result_13); - TEST_ASSERT_FALSE(result_14); + bool expected_test_values_compute_to_false[] = {4!=4,true==false,1==0,false==true,'z'=='x','!'==')',0x1A==0x2B}; + int length_2 = sizeof(expected_test_values_compute_to_false)/sizeof(bool); + /*act and assertions*/ + for(int i=0;i<7;++i) { + TEST_ASSERT_TRUE(checkLogin(expected_test_values_compute_to_true[i])); + } + for(int i=0;i<7;++i){ + TEST_ASSERT_FALSE(checkLogin(expected_test_values_compute_to_false[i])); + } }