From 01a54ce8363963a906794d4df741d0a1b1e72fe6 Mon Sep 17 00:00:00 2001 From: Laurin Date: Wed, 31 Jan 2024 11:40:24 +0100 Subject: [PATCH] added test for binaryStrLen in case input is negative --- 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 a823000..fe9441a 100644 --- a/test/conversionOfNumbers/test_conversionOfNumbers.c +++ b/test/conversionOfNumbers/test_conversionOfNumbers.c @@ -50,4 +50,16 @@ void test_convert10ToBinaryStr1010(){ //assert TEST_ASSERT_EQUAL_STRING(expected, result); +} + +void test_binaryStringLengthOfInputNegative10is5(){ + //arrange + int result; + int expected = 5; + + //act + result = binaryStrLen(-10); + + //assert + TEST_ASSERT_EQUAL_INT(expected, result); } \ No newline at end of file