Skip to content

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)
                    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();
    // Test 1: Simple value round-trip
    bool test_simple_roundtrip(void) {
        WriteFmtLn("Testing simple value round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        });
    
        WriteFmtLn("[DEBUG] Generated JSON: {}", json);
    
        // Read back from JSON
        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");
            WriteFmtLn("[DEBUG] Simple round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Simple round-trip test FAILED");
            WriteFmtLn(
                "[DEBUG] Original: count={}, temp={}, enabled={}, msg='{}'",
        } else {
            WriteFmtLn("[DEBUG] Simple round-trip test FAILED");
            WriteFmtLn(
                "[DEBUG] Original: count={}, temp={}, enabled={}, msg='{}'",
                original.count,
                StrBegin(&original.message)
            );
            WriteFmtLn(
                "[DEBUG] Parsed: count={}, temp={}, enabled={}, msg='{}'",
                parsed.count,
    // Test 2: Numeric precision round-trip
    bool test_numeric_roundtrip(void) {
        WriteFmtLn("Testing numeric precision round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        });
    
        WriteFmtLn("[DEBUG] Numeric JSON: {}", json);
    
        // Read back from JSON
    
        if (ints_match && floats_match) {
            WriteFmtLn("[DEBUG] Numeric round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Numeric round-trip test FAILED");
            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");
        } 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;
            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;
        }
    // Test 3: Boolean round-trip
    bool test_boolean_roundtrip(void) {
        WriteFmtLn("Testing boolean round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        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");
            WriteFmtLn("[DEBUG] Boolean round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Boolean round-trip test FAILED");
            success = false;
        }
    // Test 4: String round-trip
    bool test_string_roundtrip(void) {
        WriteFmtLn("Testing string round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
            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");
            WriteFmtLn("[DEBUG] String round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] String round-trip test FAILED");
            success = false;
        }
    // Test 5: Array round-trip
    bool test_array_roundtrip(void) {
        WriteFmtLn("Testing array round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        if (numbers_match && strings_match) {
            WriteFmtLn("[DEBUG] Array round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Array round-trip test FAILED");
            WriteFmtLn("[DEBUG] Array round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Array round-trip test FAILED");
            WriteFmtLn(
                "[DEBUG] Numbers match: {} (orig {}, parsed {})\n",
        } else {
            WriteFmtLn("[DEBUG] Array round-trip test FAILED");
            WriteFmtLn(
                "[DEBUG] Numbers match: {} (orig {}, parsed {})\n",
                numbers_match ? "true" : "false",
                VecLen(&parsed_numbers)
            );
            WriteFmtLn(
                "[DEBUG] Strings match: {} (orig {}, parsed {})\n",
                strings_match ? "true" : "false",
    // Test 6: Nested object round-trip
    bool test_nested_object_roundtrip(void) {
        WriteFmtLn("Testing nested object round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        // 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");
            WriteFmtLn("[DEBUG] Nested object round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Nested object round-trip test FAILED");
            success = false;
        }
    // Test 7: Complex data round-trip
    bool test_complex_data_roundtrip(void) {
        WriteFmtLn("Testing complex data round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        });
    
        WriteFmtLn("[DEBUG] Complex JSON length: {}", json);
    
        // Read back from JSON
    
        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");
            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");
        } 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");
            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");
            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;
            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;
        }
    // Test 8: Empty containers round-trip
    bool test_empty_containers_roundtrip(void) {
        WriteFmtLn("Testing empty containers round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
        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");
            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",
        } else {
            WriteFmtLn("[DEBUG] Empty containers round-trip test FAILED");
            WriteFmtLn(
                "[DEBUG] String length: {}, numbers: {}, strings: {}, found_obj: {}\n",
                StrLen(&parsed_str),
    // Test 9: Edge cases round-trip
    bool test_edge_cases_roundtrip(void) {
        WriteFmtLn("Testing edge cases round-trip");
    
        DefaultAllocator alloc = DefaultAllocatorInit();
            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");
            WriteFmtLn("[DEBUG] Edge cases round-trip test passed");
        } else {
            WriteFmtLn("[DEBUG] Edge cases round-trip test FAILED");
            success = false;
        }
    
    bool test_vec_pop_back(void) {
        WriteFmtLn("Testing VecPopBack");
    
        // Create a vector of integers
    // Test VecPopFront function
    bool test_vec_pop_front(void) {
        WriteFmtLn("Testing VecPopFront");
    
        // Create a vector of integers
    // Test VecDelete function
    bool test_vec_delete(void) {
        WriteFmtLn("Testing VecDelete");
    
        // Create a vector of integers
    // Test VecDeleteFast function
    bool test_vec_delete_fast(void) {
        WriteFmtLn("Testing VecDeleteFast");
    
        // Create a vector of integers
    // Test VecDeleteRange function
    bool test_vec_delete_range(void) {
        WriteFmtLn("Testing VecDeleteRange");
    
        // Create a vector of integers
    // Test VecDeleteRangeFast
    bool test_vec_delete_range_fast(void) {
        WriteFmtLn("Testing VecDeleteRangeFast");
    
        // Create a vector of integers
    // Test VecDeleteLast function
    bool test_vec_delete_last(void) {
        WriteFmtLn("Testing VecDeleteLast");
    
        // Create a vector of integers
    // Test L-value standard delete operations
    bool test_lvalue_delete_operations(void) {
        WriteFmtLn("Testing L-value standard delete operations");
    
        // Create a vector of integers
    // Test R-value standard delete operations
    bool test_rvalue_delete_operations(void) {
        WriteFmtLn("Testing R-value standard delete operations");
    
        // Create a vector of integers
    // 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
        // 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,
            result = result && found;
            if (!found) {
                WriteFmtLn("Value {} should be present but was not found", expected_values[i]);
            }
        }
    // 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
        // 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
            result = result && found;
            if (!found) {
                WriteFmtLn("Value {} should be present but was not found", expected_values[i]);
            }
        }
    // 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
    // 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
    // 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
            result = result && !found;
            if (found) {
                WriteFmtLn("Value {} should be deleted but was found", valuesToDelete[i]);
            }
        }
            result = result && found;
            if (!found) {
                WriteFmtLn("Value {} should be present but was not found", remainingValues[i]);
            }
        }
    // 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
            result = result && !found;
            if (found) {
                WriteFmtLn("Value {} should be deleted but was found", valuesToDelete[i]);
            }
        }
            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