Remove useless void checks

This commit is contained in:
2026-05-26 19:24:17 -05:00
parent 1f2657cea0
commit 109318aeaf
16 changed files with 44 additions and 94 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
#include "util/array.h"
static void test_arrayReverse(void **state) {
(void)state;
uint8_t array1[] = { 1, 2, 3, 4, 5 };
arrayReverse(array1, 5, sizeof(uint8_t));
+4 -5
View File
@@ -9,7 +9,7 @@
#include "util/math.h"
static void test_mathNextPowTwo(void **state) {
(void)state;
// Positive integers
assert_int_equal(mathNextPowTwo(0), 1);
@@ -44,7 +44,6 @@ static void test_mathNextPowTwo(void **state) {
}
static void test_mathMax(void **state) {
(void)state;
// Test positive integers
assert_int_equal(mathMax(1, 2), 2);
assert_int_equal(mathMax(2, 1), 2);
@@ -94,7 +93,7 @@ static void test_mathMax(void **state) {
}
static void test_mathMin(void **state) {
(void)state;
// Positive integers
assert_int_equal(mathMin(1, 2), 1);
@@ -145,7 +144,7 @@ static void test_mathMin(void **state) {
}
static void test_mathClamp(void **state) {
(void)state;
// Positive Integer bounds.
assert_int_equal(mathClamp(5, 1, 10), 5); // Within bounds
@@ -203,7 +202,7 @@ static void test_mathClamp(void **state) {
}
static void test_mathAbs(void **state) {
(void)state;
// Positive integers
assert_int_equal(mathAbs(5), 5);
+11 -11
View File
@@ -9,7 +9,7 @@
#include "util/memory.h"
static void test_memoryAllocate(void **state) {
(void)state;
// Memory should allocate
void *ptr = memoryAllocate(128);
@@ -39,7 +39,7 @@ static void test_memoryAllocate(void **state) {
}
static void test_memoryFree(void **state) {
(void)state;
// Create some memory
void *ptr = memoryAllocate(64);
@@ -72,7 +72,7 @@ static void test_memoryFree(void **state) {
}
static void test_memoryCopy(void **state) {
(void)state;
// Create some memory
size_t size = 32;
@@ -112,7 +112,7 @@ static void test_memoryCopy(void **state) {
}
static void test_memorySet(void **state) {
(void)state;
// Allocate memory
size_t size = 16;
@@ -146,7 +146,7 @@ static void test_memorySet(void **state) {
}
static void test_memoryZero(void **state) {
(void)state;
// Create some memory
size_t size = 20;
@@ -174,7 +174,7 @@ static void test_memoryZero(void **state) {
}
static void test_memoryCopyRangeSafe(void **state) {
(void)state;
// Create some memory
size_t size = 10;
@@ -223,7 +223,7 @@ static void test_memoryCopyRangeSafe(void **state) {
}
static void test_memoryMove(void **state) {
(void)state;
// Create some memory
size_t size = 15;
@@ -276,7 +276,7 @@ static void test_memoryMove(void **state) {
}
static void test_memoryCompare(void **state) {
(void)state;
// Create two memory blocks
size_t size = 8;
@@ -327,7 +327,7 @@ static void test_memoryCompare(void **state) {
}
static void test_memoryReallocate(void **state) {
(void)state;
size_t initialSize = 16;
void *ptr = memoryAllocate(initialSize);
@@ -360,7 +360,7 @@ static void test_memoryReallocate(void **state) {
}
static void test_memoryResize(void **state) {
(void)state;
size_t initialSize = 32;
void *ptr = memoryAllocate(initialSize);
@@ -424,7 +424,7 @@ static void test_memoryResize(void **state) {
}
static void test_memoryCopyInterleaved(void **state) {
(void)state;
// Basic: copy 4 uint32_t values from contiguous source into every-other dest
// slot (stride = 2*sizeof(uint32_t)).
+1 -3
View File
@@ -104,17 +104,15 @@ void testSortMethod(
}
static void test_sortBubble(void **state) {
(void)state;
testSortMethod(sortBubble, "sortBubble");
}
static void test_sortQuick(void **state) {
(void)state;
testSortMethod(sortQuick, "sortQuick");
}
static void test_sortArrayU8(void **state) {
(void)state;
// Create an array of uint8_t
size_t count = 6;
+9 -14
View File
@@ -10,7 +10,6 @@
#include "util/memory.h"
static void test_stringIsWhitespace(void **state) {
(void)state;
assert_true(stringIsWhitespace(' ')); // Space is whitespace
assert_true(stringIsWhitespace('\t')); // Tab is whitespace
assert_true(stringIsWhitespace('\n')); // Newline is whitespace
@@ -27,7 +26,6 @@ static void test_stringIsWhitespace(void **state) {
}
static void test_stringCopy(void **state) {
(void)state;
char dest[16];
stringCopy(dest, "hello", sizeof(dest));
assert_string_equal(dest, "hello"); // Normal copy
@@ -57,7 +55,7 @@ static void test_stringCopy(void **state) {
}
static void test_stringCompare(void **state) {
(void)state;
// Check for equality
assert_int_equal(stringCompare("abc", "abc"), 0);
@@ -82,7 +80,7 @@ static void test_stringCompare(void **state) {
}
static void test_stringCompareInsensitive(void **state) {
(void)state;
assert_int_equal(stringCompareInsensitive("abc", "ABC"), 0);
assert_true(stringCompareInsensitive("abc", "abd") < 0);
@@ -100,7 +98,7 @@ static void test_stringCompareInsensitive(void **state) {
}
static void test_stringTrim(void **state) {
(void)state;
char buf[32];
stringCopy(buf, " hello ", sizeof(buf));
@@ -146,7 +144,7 @@ static void test_stringTrim(void **state) {
}
static void test_stringFindLastChar(void **state) {
(void)state;
const char *str = "hello world";
char *result = stringFindLastChar(str, 'o');
@@ -170,7 +168,7 @@ static void test_stringFindLastChar(void **state) {
}
static void test_stringFormat(void **state) {
(void)state;
// Test a string format
char buffer[32];
@@ -229,7 +227,6 @@ static void test_stringFormat(void **state) {
}
static void test_stringToI32(void **state) {
(void)state;
char_t buffer[64];
int32_t value;
@@ -358,7 +355,6 @@ static void test_stringToI32(void **state) {
}
static void test_stringToI64(void **state) {
(void)state;
char_t buffer[64];
int64_t value;
@@ -487,7 +483,7 @@ static void test_stringToI64(void **state) {
}
static void test_stringToI16(void **state) {
(void)state;
char_t buffer[64];
int16_t value;
@@ -608,7 +604,7 @@ static void test_stringToI16(void **state) {
}
static void test_stringToU16(void **state) {
(void)state;
char_t buffer[64];
uint16_t value;
@@ -725,7 +721,7 @@ static void test_stringToU16(void **state) {
}
static void test_stringToF32(void **state) {
(void)state;
char_t buffer[64];
float value;
@@ -859,7 +855,7 @@ static void test_stringToF32(void **state) {
}
static void test_stringEndsWith(void **state) {
(void)state;
assert_true(stringEndsWith("hello.c", ".c"));
assert_true(stringEndsWith("Hello World!", "World!"));
@@ -877,7 +873,6 @@ static void test_stringEndsWith(void **state) {
}
static void test_stringEndsWithCaseInsensitive(void **state) {
(void)state;
assert_true(stringEndsWithCaseInsensitive("hello.C", ".c"));
assert_true(stringEndsWithCaseInsensitive("Hello World!", "world!"));