WriteFmtLn
Description
Write formatted output to the standard output stream (FileStdout()) followed by a newline. This is a convenience macro calling FWriteFmtLn with FileStdout().
Parameters
| Name | Direction | Description |
|---|---|---|
fmtstr |
in | Format string with {} placeholders. |
Success
Placeholders in fmtstr are replaced by the passed arguments, and the resulting formatted string followed by a newline is written to standard output.
Failure
Failure might occur during memory allocation for the temporary string or during the write operation; the backend may also log an error message.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Resolve.c:53:
StrMustResize(&s, n - 2);
}
WriteFmtLn("{}", s);
StrDeinit(&s);
} // Test 1: Empty object reading
bool test_empty_object_reading(void) {
WriteFmtLn("Testing empty object reading");
DefaultAllocator alloc = DefaultAllocatorInit();
if (!obj1.found_anything) { // Should still be true for empty object (reader block didn't execute)
WriteFmtLn("[DEBUG] Empty object test 1 passed - no fields processed");
} else {
WriteFmtLn("[DEBUG] Empty object test 1 FAILED - unexpected field processing"); WriteFmtLn("[DEBUG] Empty object test 1 passed - no fields processed");
} else {
WriteFmtLn("[DEBUG] Empty object test 1 FAILED - unexpected field processing");
success = false;
}
if (!obj2.found_anything) { // Should still be true for empty object
WriteFmtLn("[DEBUG] Empty object with whitespace test passed");
} else {
WriteFmtLn("[DEBUG] Empty object with whitespace test FAILED"); WriteFmtLn("[DEBUG] Empty object with whitespace test passed");
} else {
WriteFmtLn("[DEBUG] Empty object with whitespace test FAILED");
success = false;
} // Test 2: Empty array reading
bool test_empty_array_reading(void) {
WriteFmtLn("Testing empty array reading");
DefaultAllocator alloc = DefaultAllocatorInit();
if (VecLen(&items) == 0) {
WriteFmtLn("[DEBUG] Empty array test passed - no items added");
} else {
WriteFmtLn("[DEBUG] Empty array test FAILED - {} items found", VecLen(&items)); WriteFmtLn("[DEBUG] Empty array test passed - no items added");
} else {
WriteFmtLn("[DEBUG] Empty array test FAILED - {} items found", VecLen(&items));
success = false;
}
if (VecLen(&data) == 0) {
WriteFmtLn("[DEBUG] Empty array with whitespace test passed");
} else {
WriteFmtLn("[DEBUG] Empty array with whitespace test FAILED"); WriteFmtLn("[DEBUG] Empty array with whitespace test passed");
} else {
WriteFmtLn("[DEBUG] Empty array with whitespace test FAILED");
success = false;
} });
WriteFmtLn("[DEBUG] Escape sequences - escaped: '{}'\n", obj.escaped);
WriteFmtLn("[DEBUG] Escape sequences - backslash: '{}'\n", obj.backslash);
WriteFmtLn("[DEBUG] Escape sequences - newline length: {}\n", StrLen(&obj.newline));
WriteFmtLn("[DEBUG] Escape sequences - escaped: '{}'\n", obj.escaped);
WriteFmtLn("[DEBUG] Escape sequences - backslash: '{}'\n", obj.backslash);
WriteFmtLn("[DEBUG] Escape sequences - newline length: {}\n", StrLen(&obj.newline));
WriteFmtLn("[DEBUG] Escape sequences - tab length: {}\n", StrLen(&obj.tab)); WriteFmtLn("[DEBUG] Escape sequences - escaped: '{}'\n", obj.escaped);
WriteFmtLn("[DEBUG] Escape sequences - backslash: '{}'\n", obj.backslash);
WriteFmtLn("[DEBUG] Escape sequences - newline length: {}\n", StrLen(&obj.newline));
WriteFmtLn("[DEBUG] Escape sequences - tab length: {}\n", StrLen(&obj.tab)); WriteFmtLn("[DEBUG] Escape sequences - backslash: '{}'\n", obj.backslash);
WriteFmtLn("[DEBUG] Escape sequences - newline length: {}\n", StrLen(&obj.newline));
WriteFmtLn("[DEBUG] Escape sequences - tab length: {}\n", StrLen(&obj.tab));
// Basic validation that strings were parsed
// Test 10: Nested empty containers
bool test_nested_empty_containers(void) {
WriteFmtLn("Testing nested empty containers\n");
DefaultAllocator alloc = DefaultAllocatorInit();
if (!result) {
WriteFmtLn("[DEBUG] JSON comparison failed");
WriteFmt("[DEBUG] Expected: '");
for (u64 i = 0; i < StrLen(&expected_clean); i++) { WriteFmt("{c}", StrBegin(&expected_clean)[i]);
}
WriteFmtLn("'");
WriteFmt("[DEBUG] Got: '"); WriteFmt("{c}", StrBegin(&output_clean)[i]);
}
WriteFmtLn("'");
} // Test 1: Empty object writing
bool test_empty_object_writing(void) {
WriteFmtLn("Testing empty object writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 2: Empty array writing
bool test_empty_array_writing(void) {
WriteFmtLn("Testing empty array writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 3: Empty string writing
bool test_empty_string_writing(void) {
WriteFmtLn("Testing empty string writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 4: Negative numbers writing
bool test_negative_numbers_writing(void) {
WriteFmtLn("Testing negative numbers writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 5: Large numbers writing
bool test_large_numbers_writing(void) {
WriteFmtLn("Testing large numbers writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // For large numbers, just check that valid JSON was produced
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Large numbers test passed - produced valid JSON structure");
} else {
WriteFmtLn("[DEBUG] Large numbers test FAILED - invalid JSON structure"); WriteFmtLn("[DEBUG] Large numbers test passed - produced valid JSON structure");
} else {
WriteFmtLn("[DEBUG] Large numbers test FAILED - invalid JSON structure");
success = false;
} }
WriteFmtLn("[DEBUG] Large numbers JSON: {}", json);
StrDeinit(&json); // Test 6: Zero values writing
bool test_zero_values_writing(void) {
WriteFmtLn("Testing zero values writing\n");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 7: Special characters writing
bool test_special_characters_writing(void) {
WriteFmtLn("Testing special characters writing");
DefaultAllocator alloc = DefaultAllocatorInit(); });
WriteFmtLn("[DEBUG] Special characters JSON: {}", json);
// Just verify that valid JSON structure was produced
// Just verify that valid JSON structure was produced
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Special characters test passed - produced valid JSON");
} else {
WriteFmtLn("[DEBUG] Special characters test FAILED - invalid JSON structure"); WriteFmtLn("[DEBUG] Special characters test passed - produced valid JSON");
} else {
WriteFmtLn("[DEBUG] Special characters test FAILED - invalid JSON structure");
success = false;
} // Test 8: Escape sequences writing
bool test_escape_sequences_writing(void) {
WriteFmtLn("Testing escape sequences writing");
DefaultAllocator alloc = DefaultAllocatorInit(); });
WriteFmtLn("[DEBUG] Escape sequences JSON: {}", json);
// Verify valid JSON structure was produced
// Verify valid JSON structure was produced
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Escape sequences test passed - produced valid JSON");
} else {
WriteFmtLn("[DEBUG] Escape sequences test FAILED - invalid JSON structure"); WriteFmtLn("[DEBUG] Escape sequences test passed - produced valid JSON");
} else {
WriteFmtLn("[DEBUG] Escape sequences test FAILED - invalid JSON structure");
success = false;
} // Test 9: Nested empty containers writing
bool test_nested_empty_containers_writing(void) {
WriteFmtLn("Testing nested empty containers writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 10: Mixed empty and filled containers writing
bool test_mixed_empty_and_filled_writing(void) {
WriteFmtLn("Testing mixed empty and filled containers writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 11: Boundary integers writing
bool test_boundary_integers_writing(void) {
WriteFmtLn("Testing boundary integers writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Test 12: Boundary floats writing
bool test_boundary_floats_writing(void) {
WriteFmtLn("Testing boundary floats writing");
DefaultAllocator alloc = DefaultAllocatorInit(); // Check for reasonable float formatting (exact precision may vary)
if (StrLen(&json) > 0 && StrBegin(&json)[0] == '{' && StrBegin(&json)[StrLen(&json) - 1] == '}') {
WriteFmtLn("[DEBUG] Boundary floats test passed - JSON: {}", json);
} else {
WriteFmtLn("[DEBUG] Boundary floats test FAILED"); WriteFmtLn("[DEBUG] Boundary floats test passed - JSON: {}", json);
} else {
WriteFmtLn("[DEBUG] Boundary floats test FAILED");
success = false;
} // Test 13: Single values writing (minimal valid JSON objects)
bool test_single_values_writing(void) {
WriteFmtLn("Testing single values writing");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:90:
// Test 1: Simple value round-trip
bool test_simple_roundtrip(void) {
WriteFmtLn("Testing simple value round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:113:
});
WriteFmtLn("[DEBUG] Generated JSON: {}", json);
// Read back from JSON
- In
RoundTrip.c:134:
if (original.count == parsed.count && original.temperature == parsed.temperature &&
original.enabled == parsed.enabled && StrCmp(&original.message, &parsed.message) == 0) {
WriteFmtLn("[DEBUG] Simple round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Simple round-trip test FAILED");- In
RoundTrip.c:136:
WriteFmtLn("[DEBUG] Simple round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Simple round-trip test FAILED");
WriteFmtLn(
"[DEBUG] Original: count={}, temp={}, enabled={}, msg='{}'",- In
RoundTrip.c:137:
} else {
WriteFmtLn("[DEBUG] Simple round-trip test FAILED");
WriteFmtLn(
"[DEBUG] Original: count={}, temp={}, enabled={}, msg='{}'",
original.count,- In
RoundTrip.c:144:
StrBegin(&original.message)
);
WriteFmtLn(
"[DEBUG] Parsed: count={}, temp={}, enabled={}, msg='{}'",
parsed.count,- In
RoundTrip.c:163:
// Test 2: Numeric precision round-trip
bool test_numeric_roundtrip(void) {
WriteFmtLn("Testing numeric precision round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:190:
});
WriteFmtLn("[DEBUG] Numeric JSON: {}", json);
// Read back from JSON
- In
RoundTrip.c:223:
if (ints_match && floats_match) {
WriteFmtLn("[DEBUG] Numeric round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Numeric round-trip test FAILED");- In
RoundTrip.c:225:
WriteFmtLn("[DEBUG] Numeric round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Numeric round-trip test FAILED");
WriteFmtLn("[DEBUG] Integers match: {}", ints_match ? "true" : "false");
WriteFmtLn("[DEBUG] Floats match: {}", floats_match ? "true" : "false");- In
RoundTrip.c:226:
} else {
WriteFmtLn("[DEBUG] Numeric round-trip test FAILED");
WriteFmtLn("[DEBUG] Integers match: {}", ints_match ? "true" : "false");
WriteFmtLn("[DEBUG] Floats match: {}", floats_match ? "true" : "false");
success = false;- In
RoundTrip.c:227:
WriteFmtLn("[DEBUG] Numeric round-trip test FAILED");
WriteFmtLn("[DEBUG] Integers match: {}", ints_match ? "true" : "false");
WriteFmtLn("[DEBUG] Floats match: {}", floats_match ? "true" : "false");
success = false;
}- In
RoundTrip.c:238:
// Test 3: Boolean round-trip
bool test_boolean_roundtrip(void) {
WriteFmtLn("Testing boolean round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:280:
if (original.flag1 == parsed.flag1 && original.flag2 == parsed.flag2 && original.flag3 == parsed.flag3 &&
original.flag4 == parsed.flag4) {
WriteFmtLn("[DEBUG] Boolean round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Boolean round-trip test FAILED");- In
RoundTrip.c:282:
WriteFmtLn("[DEBUG] Boolean round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Boolean round-trip test FAILED");
success = false;
}- In
RoundTrip.c:293:
// Test 4: String round-trip
bool test_string_roundtrip(void) {
WriteFmtLn("Testing string round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:341:
StrCmp(&original.with_spaces, &parsed.with_spaces) == 0 &&
StrCmp(&original.with_special, &parsed.with_special) == 0) {
WriteFmtLn("[DEBUG] String round-trip test passed");
} else {
WriteFmtLn("[DEBUG] String round-trip test FAILED");- In
RoundTrip.c:343:
WriteFmtLn("[DEBUG] String round-trip test passed");
} else {
WriteFmtLn("[DEBUG] String round-trip test FAILED");
success = false;
}- In
RoundTrip.c:363:
// Test 5: Array round-trip
bool test_array_roundtrip(void) {
WriteFmtLn("Testing array round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:439:
if (numbers_match && strings_match) {
WriteFmtLn("[DEBUG] Array round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Array round-trip test FAILED");- In
RoundTrip.c:441:
WriteFmtLn("[DEBUG] Array round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Array round-trip test FAILED");
WriteFmtLn(
"[DEBUG] Numbers match: {} (orig {}, parsed {})\n",- In
RoundTrip.c:442:
} else {
WriteFmtLn("[DEBUG] Array round-trip test FAILED");
WriteFmtLn(
"[DEBUG] Numbers match: {} (orig {}, parsed {})\n",
numbers_match ? "true" : "false",- In
RoundTrip.c:448:
VecLen(&parsed_numbers)
);
WriteFmtLn(
"[DEBUG] Strings match: {} (orig {}, parsed {})\n",
strings_match ? "true" : "false",- In
RoundTrip.c:469:
// Test 6: Nested object round-trip
bool test_nested_object_roundtrip(void) {
WriteFmtLn("Testing nested object round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:506:
// Compare
if (compare_persons(&original_person, &parsed_person)) {
WriteFmtLn("[DEBUG] Nested object round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Nested object round-trip test FAILED");- In
RoundTrip.c:508:
WriteFmtLn("[DEBUG] Nested object round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Nested object round-trip test FAILED");
success = false;
}- In
RoundTrip.c:522:
// Test 7: Complex data round-trip
bool test_complex_data_roundtrip(void) {
WriteFmtLn("Testing complex data round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:580:
});
WriteFmtLn("[DEBUG] Complex JSON length: {}", json);
// Read back from JSON
- In
RoundTrip.c:648:
if (user_match && config_match && numbers_match && flags_match) {
WriteFmtLn("[DEBUG] Complex data round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Complex data round-trip test FAILED");- In
RoundTrip.c:650:
WriteFmtLn("[DEBUG] Complex data round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Complex data round-trip test FAILED");
WriteFmtLn("[DEBUG] User match: {}", user_match ? "true" : "false");
WriteFmtLn("[DEBUG] Config match: {}", config_match ? "true" : "false");- In
RoundTrip.c:651:
} else {
WriteFmtLn("[DEBUG] Complex data round-trip test FAILED");
WriteFmtLn("[DEBUG] User match: {}", user_match ? "true" : "false");
WriteFmtLn("[DEBUG] Config match: {}", config_match ? "true" : "false");
WriteFmtLn("[DEBUG] Numbers match: {}", numbers_match ? "true" : "false");- In
RoundTrip.c:652:
WriteFmtLn("[DEBUG] Complex data round-trip test FAILED");
WriteFmtLn("[DEBUG] User match: {}", user_match ? "true" : "false");
WriteFmtLn("[DEBUG] Config match: {}", config_match ? "true" : "false");
WriteFmtLn("[DEBUG] Numbers match: {}", numbers_match ? "true" : "false");
WriteFmtLn("[DEBUG] Flags match: {}", flags_match ? "true" : "false");- In
RoundTrip.c:653:
WriteFmtLn("[DEBUG] User match: {}", user_match ? "true" : "false");
WriteFmtLn("[DEBUG] Config match: {}", config_match ? "true" : "false");
WriteFmtLn("[DEBUG] Numbers match: {}", numbers_match ? "true" : "false");
WriteFmtLn("[DEBUG] Flags match: {}", flags_match ? "true" : "false");
success = false;- In
RoundTrip.c:654:
WriteFmtLn("[DEBUG] Config match: {}", config_match ? "true" : "false");
WriteFmtLn("[DEBUG] Numbers match: {}", numbers_match ? "true" : "false");
WriteFmtLn("[DEBUG] Flags match: {}", flags_match ? "true" : "false");
success = false;
}- In
RoundTrip.c:668:
// Test 8: Empty containers round-trip
bool test_empty_containers_roundtrip(void) {
WriteFmtLn("Testing empty containers round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:719:
if (StrLen(&parsed_str) == 0 && VecLen(&parsed_numbers) == 0 && VecLen(&parsed_strings) == 0 &&
!found_empty_object) { // Empty object should not execute the content
WriteFmtLn("[DEBUG] Empty containers round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Empty containers round-trip test FAILED");- In
RoundTrip.c:721:
WriteFmtLn("[DEBUG] Empty containers round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Empty containers round-trip test FAILED");
WriteFmtLn(
"[DEBUG] String length: {}, numbers: {}, strings: {}, found_obj: {}\n",- In
RoundTrip.c:722:
} else {
WriteFmtLn("[DEBUG] Empty containers round-trip test FAILED");
WriteFmtLn(
"[DEBUG] String length: {}, numbers: {}, strings: {}, found_obj: {}\n",
StrLen(&parsed_str),- In
RoundTrip.c:746:
// Test 9: Edge cases round-trip
bool test_edge_cases_roundtrip(void) {
WriteFmtLn("Testing edge cases round-trip");
DefaultAllocator alloc = DefaultAllocatorInit();- In
RoundTrip.c:797:
original.zero_float == parsed.zero_float && original.true_val == parsed.true_val &&
original.false_val == parsed.false_val) {
WriteFmtLn("[DEBUG] Edge cases round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Edge cases round-trip test FAILED");- In
RoundTrip.c:799:
WriteFmtLn("[DEBUG] Edge cases round-trip test passed");
} else {
WriteFmtLn("[DEBUG] Edge cases round-trip test FAILED");
success = false;
}- In
Vec.Remove.c:31:
bool test_vec_pop_back(void) {
WriteFmtLn("Testing VecPopBack");
// Create a vector of integers
- In
Vec.Remove.c:79:
// Test VecPopFront function
bool test_vec_pop_front(void) {
WriteFmtLn("Testing VecPopFront");
// Create a vector of integers
- In
Vec.Remove.c:127:
// Test VecDelete function
bool test_vec_delete(void) {
WriteFmtLn("Testing VecDelete");
// Create a vector of integers
- In
Vec.Remove.c:175:
// Test VecDeleteFast function
bool test_vec_delete_fast(void) {
WriteFmtLn("Testing VecDeleteFast");
// Create a vector of integers
- In
Vec.Remove.c:212:
// Test VecDeleteRange function
bool test_vec_delete_range(void) {
WriteFmtLn("Testing VecDeleteRange");
// Create a vector of integers
- In
Vec.Remove.c:248:
// Test VecDeleteRangeFast
bool test_vec_delete_range_fast(void) {
WriteFmtLn("Testing VecDeleteRangeFast");
// Create a vector of integers
- In
Vec.Remove.c:324:
// Test VecDeleteLast function
bool test_vec_delete_last(void) {
WriteFmtLn("Testing VecDeleteLast");
// Create a vector of integers
- In
Vec.Remove.c:370:
// Test L-value standard delete operations
bool test_lvalue_delete_operations(void) {
WriteFmtLn("Testing L-value standard delete operations");
// Create a vector of integers
- In
Vec.Remove.c:406:
// Test R-value standard delete operations
bool test_rvalue_delete_operations(void) {
WriteFmtLn("Testing R-value standard delete operations");
// Create a vector of integers
- In
Vec.Remove.c:441:
// Test L-value fast delete operations
bool test_lvalue_fast_delete_operations(void) {
WriteFmtLn("Testing L-value fast delete operations");
// Create a vector of integers
- In
Vec.Remove.c:491:
// Check that the value at the deleted position is now the last value
result = result && (VecAt(&vec, fast_index) == lastValue);
WriteFmtLn(
"Value at deleted position ({}) is now {} (expected {})\n",
fast_index,- In
Vec.Remove.c:510:
result = result && found;
if (!found) {
WriteFmtLn("Value {} should be present but was not found", expected_values[i]);
}
}- In
Vec.Remove.c:522:
// Test R-value fast delete operations
bool test_rvalue_fast_delete_operations(void) {
WriteFmtLn("Testing R-value fast delete operations");
// Create a vector of integers
- In
Vec.Remove.c:573:
// Check that the value at the deleted position is now the last value
result = result && (VecAt(&vec, 2) == lastValue);
WriteFmtLn("Value at deleted position (2) is now {} (expected {})\n", VecAt(&vec, 2), lastValue);
// Verify all expected values (except the deleted one and the moved one) are still present
- In
Vec.Remove.c:587:
result = result && found;
if (!found) {
WriteFmtLn("Value {} should be present but was not found", expected_values[i]);
}
}- In
Vec.Remove.c:599:
// Test L-value delete range operations
bool test_lvalue_delete_range_operations(void) {
WriteFmtLn("Testing L-value delete range operations");
// Create a vector of integers
- In
Vec.Remove.c:636:
// Test R-value delete range operations
bool test_rvalue_delete_range_operations(void) {
WriteFmtLn("Testing R-value delete range operations");
// Create a vector of integers
- In
Vec.Remove.c:671:
// Test L-value fast delete range operations
bool test_lvalue_fast_delete_range_operations(void) {
WriteFmtLn("Testing L-value fast delete range operations");
// Create a vector of integers
- In
Vec.Remove.c:722:
result = result && !found;
if (found) {
WriteFmtLn("Value {} should be deleted but was found", valuesToDelete[i]);
}
}- In
Vec.Remove.c:738:
result = result && found;
if (!found) {
WriteFmtLn("Value {} should be present but was not found", remainingValues[i]);
}
}- In
Vec.Remove.c:750:
// Test R-value fast delete range operations
bool test_rvalue_fast_delete_range_operations(void) {
WriteFmtLn("Testing R-value fast delete range operations");
// Create a vector of integers
- In
Vec.Remove.c:799:
result = result && !found;
if (found) {
WriteFmtLn("Value {} should be deleted but was found", valuesToDelete[i]);
}
}- In
Vec.Remove.c:815:
result = result && found;
if (!found) {
WriteFmtLn("Value {} should be present but was not found", remainingValues[i]);
}
} DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecAnd");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecOr");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecXor");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecNot");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecShiftLeft");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecShiftRight");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecRotateLeft");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecRotateRight");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecReverse");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec shift edge cases");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec rotate edge cases");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec bitwise operations edge cases");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVecReverse edge cases");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec comprehensive bitwise operations");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec comprehensive shift operations");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec comprehensive rotate operations");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec bitwise identity operations");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec bitwise commutative properties");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec bitwise operations with large patterns");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); // Deadend tests
bool test_bitvec_bitwise_null_failures(void) {
WriteFmtLn("Testing BitVec bitwise NULL pointer handling");
// Test NULL bitvec pointer - should abort
DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec bitwise operations NULL handling");
BitVec bv = BitVecInit(ALLOCATOR_OF(&alloc));
bool test_bitvec_reverse_null_failures(void) {
WriteFmtLn("Testing BitVec reverse NULL handling");
// Test NULL pointer - should abort
// NEW: Additional deadend tests
bool test_bitvec_shift_ops_null_failures(void) {
WriteFmtLn("Testing BitVec shift operations NULL handling");
// Test NULL pointer for shift right - should abort
bool test_bitvec_rotate_ops_null_failures(void) {
WriteFmtLn("Testing BitVec rotate operations NULL handling");
// Test NULL pointer for rotate - should abort
DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec AND with NULL result handling");
BitVec bv1 = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec OR with NULL operand handling");
BitVec result = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec XOR with NULL second operand handling");
BitVec result = BitVecInit(ALLOCATOR_OF(&alloc)); DefaultAllocator alloc = DefaultAllocatorInit();
WriteFmtLn("Testing BitVec NOT with NULL handling");
BitVec result = BitVecInit(ALLOCATOR_OF(&alloc)); // Main function that runs all tests
int main(void) {
WriteFmtLn("[INFO] Starting BitVec.BitWise tests");
// Array of normal test functions
Last updated on