From 5a9978be91259fd3f8c42365d7cea20727d15ab6 Mon Sep 17 00:00:00 2001 From: Sophia Weber Date: Sun, 28 Jan 2024 18:50:30 +0100 Subject: [PATCH] Create Oct Output Test --- src/outputHandling.c | 2 +- test/test_outputHandling.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/outputHandling.c b/src/outputHandling.c index 4a2fef1..450b72b 100644 --- a/src/outputHandling.c +++ b/src/outputHandling.c @@ -3,7 +3,7 @@ #include "inputHandling.h" void buildHexString(char* string, int num) { - sprintf(string, "%X", num); + sprintf(string, "0x%X", num); } void buildOctString(char* string, int num) { diff --git a/test/test_outputHandling.c b/test/test_outputHandling.c index 7ea50e5..13b77bb 100644 --- a/test/test_outputHandling.c +++ b/test/test_outputHandling.c @@ -20,4 +20,10 @@ void test_outputHandling_buildOctString(void) TEST_ASSERT_EQUAL_STRING("25142543", string); } +void test_outputHandling_buildHexString(void) +{ + buildHexString(string, 5555555); + TEST_ASSERT_EQUAL_STRING("0x54C563", string); +} + #endif // TEST