From f68d81069719765e7509aef0df20f307cb9e81bb Mon Sep 17 00:00:00 2001 From: Laurin Date: Thu, 1 Feb 2024 12:47:08 +0100 Subject: [PATCH] added test for converting negative integer --- test/conversionOfNumbers/test_conversionOfNumbers.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/conversionOfNumbers/test_conversionOfNumbers.c b/test/conversionOfNumbers/test_conversionOfNumbers.c index fe9441a..4bf3272 100644 --- a/test/conversionOfNumbers/test_conversionOfNumbers.c +++ b/test/conversionOfNumbers/test_conversionOfNumbers.c @@ -62,4 +62,16 @@ void test_binaryStringLengthOfInputNegative10is5(){ //assert TEST_ASSERT_EQUAL_INT(expected, result); +} + +void test_convertNegative12ToBinaryStrNegative1100(){ + //arrange + char* result; + char expected[] = "-1100"; + + //act + result = convertIntToBinaryStr(-12); + + //assert + TEST_ASSERT_EQUAL_STRING(expected, result); } \ No newline at end of file