Browse Source

Create Oct Output Test

remotes/origin/Input_Handling
Sophia Weber 11 months ago
parent
commit
5a9978be91
  1. 2
      src/outputHandling.c
  2. 6
      test/test_outputHandling.c

2
src/outputHandling.c

@ -3,7 +3,7 @@
#include "inputHandling.h" #include "inputHandling.h"
void buildHexString(char* string, int num) { void buildHexString(char* string, int num) {
sprintf(string, "%X", num);
sprintf(string, "0x%X", num);
} }
void buildOctString(char* string, int num) { void buildOctString(char* string, int num) {

6
test/test_outputHandling.c

@ -20,4 +20,10 @@ void test_outputHandling_buildOctString(void)
TEST_ASSERT_EQUAL_STRING("25142543", string); TEST_ASSERT_EQUAL_STRING("25142543", string);
} }
void test_outputHandling_buildHexString(void)
{
buildHexString(string, 5555555);
TEST_ASSERT_EQUAL_STRING("0x54C563", string);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save