Fixing memory tests
This commit is contained in:
@@ -83,6 +83,9 @@ int_t memoryCompare(
|
|||||||
assertNotNull(a, "Cannot compare NULL memory.");
|
assertNotNull(a, "Cannot compare NULL memory.");
|
||||||
assertNotNull(b, "Cannot compare NULL memory.");
|
assertNotNull(b, "Cannot compare NULL memory.");
|
||||||
assertTrue(size >= 0, "Cannot compare negative bytes of memory.");
|
assertTrue(size >= 0, "Cannot compare negative bytes of memory.");
|
||||||
|
|
||||||
|
if(size == 0) return 0; // Comparing 0 bytes is always equal
|
||||||
|
|
||||||
return memcmp(a, b, size);
|
return memcmp(a, b, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user