|
@ -4,6 +4,36 @@ |
|
|
#include <unity.h> |
|
|
#include <unity.h> |
|
|
#include "../src/stringManipulation.c" |
|
|
#include "../src/stringManipulation.c" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_isLetterOfAlphabet() |
|
|
|
|
|
{ |
|
|
|
|
|
/*test block 1*/ |
|
|
|
|
|
char *testStringsToTrue[] = {"adhj","kasdlwq","vbeuqor","kalkwyynmakj","kakswxl","akljlxjkcyxyklj","asdjhuwpwe","xbcvddd","klajksdjkl","ghghgtie","kajsd"}; |
|
|
|
|
|
unsigned int numberOfElements = sizeof(testStringsToTrue) / sizeof(char *); |
|
|
|
|
|
for(int i=0;i<numberOfElements;++i){ |
|
|
|
|
|
TEST_ASSERT_TRUE(isLetterOfAlphabet(testStringsToTrue[i])); |
|
|
|
|
|
} |
|
|
|
|
|
/*test block 2*/ |
|
|
|
|
|
char *testStringsToTrue_2[] = {"bcjyxhkjyxchjqwo","tree","garden","thinker","philosophy","linux","computer","lesson","teacher","table","drink","water","every", "Frank","city","economic","programming","task","smart","smarter","smartest","dumb","wood","animals","forest","display","hot","cold","ice","bear","keyboard","pair","pencil"}; |
|
|
|
|
|
numberOfElements = sizeof(testStringsToTrue_2) / sizeof(char *); |
|
|
|
|
|
for(int i=0;i<numberOfElements;++i){ |
|
|
|
|
|
TEST_ASSERT_TRUE(isLetterOfAlphabet(testStringsToTrue_2[i])); |
|
|
|
|
|
} |
|
|
|
|
|
/*test block 3*/ |
|
|
|
|
|
char *testStringsToFalse[] = {"ashjdkj32123","4213jashj","laskdj2","1sbabjsdh","askjasdkjd0","123932131a","abcd2hutz","81287asjk231jkhs","aslkjasdlkjsd123","cbc451873"}; |
|
|
|
|
|
numberOfElements = sizeof(testStringsToFalse) / sizeof(char *); |
|
|
|
|
|
for(int i=0;i<numberOfElements;++i){ |
|
|
|
|
|
TEST_ASSERT_FALSE(isLetterOfAlphabet(testStringsToFalse[i])); |
|
|
|
|
|
} |
|
|
|
|
|
/*test block 4*/ |
|
|
|
|
|
char *testStringsToFalse_2[] = {"1234","56789","00000010101010","3748927398273498","757575757","1726371238726","19237182937192837","875378612873621","128973192837","99494949499929292929292938382828","1827391237981273","7481263871236782136"}; |
|
|
|
|
|
numberOfElements = sizeof(testStringsToFalse_2) / sizeof(char *); |
|
|
|
|
|
for(int i=0;i<numberOfElements;++i){ |
|
|
|
|
|
TEST_ASSERT_FALSE(isLetterOfAlphabet(testStringsToFalse_2[i])); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_toUnsignedInteger() |
|
|
void test_toUnsignedInteger() |
|
|
{ |
|
|
{ |
|
|
/*test block 1*/ |
|
|
/*test block 1*/ |
|
|