Browse Source

Implementation of unit tests for toUnsignedInteger().

remotes/origin/development
fdai7057 2 years ago
parent
commit
62186d36ae
  1. 13
      test/test_StringManipulation.c

13
test/test_StringManipulation.c

@ -4,6 +4,19 @@
#include <unity.h> #include <unity.h>
#include "../src/stringManipulation.c" #include "../src/stringManipulation.c"
void test_toUnsignedInteger()
{
/*variables*/
char *n1 = "176", *n2 = "199", *n3 = "200", *n4 = "500", *n5 = "600", *n6 = "700";
/*assertions*/
TEST_ASSERT_EQUAL_INT(176,toUnsignedInteger(n1));
TEST_ASSERT_EQUAL_INT(199,toUnsignedInteger(n2));
TEST_ASSERT_EQUAL_INT(200,toUnsignedInteger(n3));
TEST_ASSERT_EQUAL_INT(500,toUnsignedInteger(n4));
TEST_ASSERT_EQUAL_INT(600,toUnsignedInteger(n5));
TEST_ASSERT_EQUAL_INT(700,toUnsignedInteger(n6));
}
void test_everyCharacterIsDigit() void test_everyCharacterIsDigit()
{ {
/*test block 1*/ /*test block 1*/

Loading…
Cancel
Save