(MOD) Changed returning type of Var_Delete and Array_Delete from "void" to "Status": It requires more plaination when encountering non-alive instances.
(MOD) Implemented Array_Equals. (MOD) Replaced struct member "description" from InstanceStillAlive from "Given instance was yet alive." to "Given instance was still alive.". (MOD) Removed String_GetIdx and String_SetIdx: Meaningless functions. (MOD) Changed the assignment value of struct member "identity" of macro unknown, normal and error from "nameof(e)" to "e.identity".
This commit is contained in:
35
test.c
35
test.c
@@ -21,7 +21,34 @@ void __DESTRUCT__() {}
|
||||
|
||||
Status Main(void)
|
||||
{
|
||||
Memory mem;
|
||||
|
||||
|
||||
return apply(NormalStatus);
|
||||
}
|
||||
|
||||
Status MainArrayComparisonTest(void)
|
||||
{
|
||||
Array arr1 = EMPTY;
|
||||
fail(Array_Create(&arr1, 10, 10));
|
||||
|
||||
Array arr2 = EMPTY;
|
||||
fail(Array_Create(&arr2, 10, 10));
|
||||
|
||||
if (Array_Equals(&arr1, &arr2)) {
|
||||
cat("Equal!");
|
||||
} else {
|
||||
cat("Not equal!");
|
||||
}
|
||||
|
||||
Array_Delete(&arr2);
|
||||
Array_Delete(&arr1);
|
||||
|
||||
return apply(NormalStatus);
|
||||
}
|
||||
|
||||
Status MainMemoryOperationTest(void)
|
||||
{
|
||||
Memory mem = EMPTY;
|
||||
fail(Memory_Create(&mem, sizeof(double)));
|
||||
|
||||
fail(Memory_Allocate(&mem));
|
||||
@@ -56,11 +83,11 @@ Status MainMacroFailsTest(void)
|
||||
|
||||
Status MainArrayCreateAndDeleteWithModulatedMemberAccessing(void)
|
||||
{
|
||||
Array arr;
|
||||
Array arr = EMPTY;
|
||||
fail(Array_Create(&arr, 8, sizeof(int)));
|
||||
|
||||
for (register int i = 0; i < arr.len; i++) {
|
||||
Var current;
|
||||
Var current = EMPTY;
|
||||
|
||||
// fails(Var_Create(¤t, arr.members[0].size),
|
||||
// "Failed to create Var current.");
|
||||
@@ -130,7 +157,7 @@ Status MainArrayCreateAndDeleteWithTraditionalMemberAccessing(void)
|
||||
// // Array_Delete(&arr);
|
||||
|
||||
|
||||
Array arr;
|
||||
Array arr = EMPTY;
|
||||
fail(Array_Create(&arr, 8, sizeof(long long)));
|
||||
|
||||
for (register int i = 0; i < arr.len; i++) {
|
||||
|
Reference in New Issue
Block a user