bool
- Type
- August 22, 2025
Table of Contents
bool
bool
Description
Function pointer type for test functions.
Success
Function returns true if test passed, false if failed.
Failure
Function cannot fail - always returns boolean result.
Usage example (Cross-references)
- In
Types.h:101
:
#ifndef __cplusplus
# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201710L
# ifndef bool
typedef i8 bool;
# endif
- In
Types.h:102
:
# if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201710L
# ifndef bool
typedef i8 bool;
# endif
- In
Sys.h:255
:
/// TAGS: System, Process, Status
///
bool SysGetProcessExitCode(SysProcInfo *proc_info, i32 *exit_code);
///
- In
Sys.h:267
:
/// TAGS: System, Process, Control
///
bool SysTerminateProcess(SysProcInfo *proc_info);
///
- In
JSON.h:92
:
/// TAGS: Number, Union, DataType, JSON, NumericType
typedef struct Number {
bool is_float;
union {
f64 f;
- In
JSON.h:176
:
/// TAGS: JSON, Boolean, Parsing
///
StrIter JReadBool(StrIter si, bool* b);
///
- In
JSON.h:187
:
/// FAILURE : Returns original `StrIter` if "null" not found
///
StrIter JReadNull(StrIter si, bool* is_null);
///
- In
JSON.h:353
:
#define JR_BOOL(si, b) \
do { \
bool my_b = 0; \
si = JReadBool((si), &my_b); \
(b) = my_b; \
- In
JSON.h:376
:
do { \
if (!StrCmpZstr(&key, (k))) { \
bool my_b = 0; \
si = JReadBool((si), &my_b); \
(b) = my_b; \
- In
JSON.h:424
:
si = JSkipWhitespace(si); \
\
bool expect_comma = false; \
bool failed = false; \
\
- In
JSON.h:425
:
\
bool expect_comma = false; \
bool failed = false; \
\
/* while not at the end of array. */ \
- In
JSON.h:517
:
\
StrIter read_si; \
bool expect_comma = false; \
bool failed = false; \
\
- In
JSON.h:518
:
StrIter read_si; \
bool expect_comma = false; \
bool failed = false; \
\
/* while not at the end of object. */ \
- In
JSON.h:673
:
#define JW_OBJ(j, writer) \
do { \
bool ___is_first___ = true; \
(void)___is_first___; \
StrPushBack(&(j), '{'); \
- In
JSON.h:730
:
#define JW_ARR(j, arr, item, writer) \
do { \
bool ___is_first___ = true; \
(void)___is_first___; \
StrPushBack(&(j), '['); \
- In
Io.h:206
:
/// TAGS: Formatting, I/O, String
///
bool StrWriteFmtInternal(Str *o, const char *fmt, TypeSpecificIO *args, size argc);
///
- In
Log.h:99
:
///
/// TAGS: Logging, Initialization, System
void LogInit(bool redirect);
///
- In
File.h:47
:
/// TAGS: Read, File, I/O, Utility, Helper
///
bool ReadCompleteFile(const char *filename, char **data, size *file_size, size *capacity);
#endif // MISRA_FILE_H
- In
Common.h:31
:
// from src to dst.
typedef bool (*GenericCopyInit)(void *dst, void *src);
typedef void (*GenericCopyDeinit)(void *copy);
typedef i32 (*GenericCompare)(const void *first, const void *second);
- In
Ops.h:106
:
/// FAILURE : Returns false.
///
bool StrStartsWithZstr(const Str* s, const char* prefix);
///
- In
Ops.h:117
:
/// FAILURE : Returns false.
///
bool StrEndsWithZstr(const Str* s, const char* suffix);
///
- In
Ops.h:129
:
/// FAILURE : Returns false.
///
bool StrStartsWithCstr(const Str* s, const char* prefix, size prefix_len);
///
- In
Ops.h:141
:
/// FAILURE : Returns false.
///
bool StrEndsWithCstr(const Str* s, const char* suffix, size suffix_len);
///
- In
Ops.h:152
:
/// FAILURE : Returns false.
///
bool StrStartsWith(const Str* s, const Str* prefix);
///
- In
Ops.h:163
:
/// FAILURE : Returns false.
///
bool StrEndsWith(const Str* s, const Str* suffix);
//
- In
Convert.h:19
:
typedef struct {
u8 base; ///< Base (2-36)
bool uppercase; ///< Use uppercase letters for bases > 10
bool use_prefix; ///< Add prefix (0x, 0b, 0o)
bool pad_zeros; ///< Pad with leading zeros
- In
Convert.h:20
:
u8 base; ///< Base (2-36)
bool uppercase; ///< Use uppercase letters for bases > 10
bool use_prefix; ///< Add prefix (0x, 0b, 0o)
bool pad_zeros; ///< Pad with leading zeros
u8 min_width; ///< Minimum field width
- In
Convert.h:21
:
bool uppercase; ///< Use uppercase letters for bases > 10
bool use_prefix; ///< Add prefix (0x, 0b, 0o)
bool pad_zeros; ///< Pad with leading zeros
u8 min_width; ///< Minimum field width
} StrIntFormat;
- In
Convert.h:28
:
typedef struct {
u8 precision; ///< Decimal places (0-17)
bool force_sci; ///< Force scientific notation
bool uppercase; ///< Use uppercase E in scientific notation
bool trim_zeros; ///< Remove trailing zeros
- In
Convert.h:29
:
u8 precision; ///< Decimal places (0-17)
bool force_sci; ///< Force scientific notation
bool uppercase; ///< Use uppercase E in scientific notation
bool trim_zeros; ///< Remove trailing zeros
bool always_sign; ///< Always show + for positive numbers
- In
Convert.h:30
:
bool force_sci; ///< Force scientific notation
bool uppercase; ///< Use uppercase E in scientific notation
bool trim_zeros; ///< Remove trailing zeros
bool always_sign; ///< Always show + for positive numbers
} StrFloatFormat;
- In
Convert.h:31
:
bool uppercase; ///< Use uppercase E in scientific notation
bool trim_zeros; ///< Remove trailing zeros
bool always_sign; ///< Always show + for positive numbers
} StrFloatFormat;
- In
Convert.h:36
:
/// Configuration for parsing
typedef struct {
bool strict; ///< Strict parsing (no trailing chars)
bool trim_space; ///< Trim leading/trailing whitespace
u8 base; ///< Base for integers (0 = auto-detect)
- In
Convert.h:37
:
typedef struct {
bool strict; ///< Strict parsing (no trailing chars)
bool trim_space; ///< Trim leading/trailing whitespace
u8 base; ///< Base for integers (0 = auto-detect)
} StrParseConfig;
- In
Convert.h:92
:
/// FAILURE : Returns false if conversion fails
///
bool StrToU64(const Str* str, u64* value, const StrParseConfig* config);
///
- In
Convert.h:104
:
/// FAILURE : Returns false if conversion fails
///
bool StrToI64(const Str* str, i64* value, const StrParseConfig* config);
///
- In
Convert.h:116
:
/// FAILURE : Returns false if conversion fails
///
bool StrToF64(const Str* str, f64* value, const StrParseConfig* config);
- In
Init.h:134
:
/// FAILURE : false
///
bool StrInitCopy(Str* dst, const Str* src);
#ifdef __cplusplus
- In
Remove.h:46
:
/// TAGS: Remove, BitVec, First, Value
///
bool BitVecRemoveFirst(BitVec *bv, bool value);
///
- In
Remove.h:62
:
/// TAGS: Remove, BitVec, Last, Value
///
bool BitVecRemoveLast(BitVec *bv, bool value);
///
- In
Remove.h:78
:
/// TAGS: Remove, BitVec, All, Value
///
u64 BitVecRemoveAll(BitVec *bv, bool value);
///
- In
Remove.h:93
:
/// TAGS: BitVec, Pop, Remove, Last
///
bool BitVecPop(BitVec *bv);
///
- In
Remove.h:109
:
/// TAGS: BitVec, Remove, Shift, Single
///
bool BitVecRemove(BitVec *bv, u64 idx);
#ifdef __cplusplus
- In
Compare.h:33
:
/// TAGS: BitVec, Compare, Range, Equal
///
bool BitVecEqualsRange(BitVec *bv1, u64 start1, BitVec *bv2, u64 start2, u64 len);
///
- In
Compare.h:67
:
/// TAGS: BitVec, Compare, Subset, Set
///
bool BitVecIsSubset(BitVec *bv1, BitVec *bv2);
///
- In
Compare.h:83
:
/// TAGS: BitVec, Compare, Superset, Set
///
bool BitVecIsSuperset(BitVec *bv1, BitVec *bv2);
///
- In
Compare.h:98
:
/// TAGS: BitVec, Compare, Disjoint, Set
///
bool BitVecDisjoint(BitVec *bv1, BitVec *bv2);
///
- In
Compare.h:113
:
/// TAGS: BitVec, Compare, Overlaps, Set
///
bool BitVecOverlaps(BitVec *bv1, BitVec *bv2);
///
- In
Compare.h:129
:
/// TAGS: BitVec, Equals, Compare, Test
///
bool BitVecEquals(BitVec *bv1, BitVec *bv2);
///
- In
Compare.h:206
:
/// TAGS: BitVec, Sorted, Order, Check
///
bool BitVecIsSorted(BitVec *bv);
#ifdef __cplusplus
- In
Pattern.h:30
:
/// TAGS: BitVec, Pattern, StartsWith, Match
///
bool BitVecStartsWith(BitVec *bv, BitVec *prefix);
///
- In
Pattern.h:45
:
/// TAGS: BitVec, Pattern, EndsWith, Match
///
bool BitVecEndsWith(BitVec *bv, BitVec *suffix);
///
- In
Pattern.h:61
:
/// TAGS: BitVec, Pattern, ContainsAt, Position
///
bool BitVecContainsAt(BitVec *bv, BitVec *pattern, u64 idx);
///
- In
Pattern.h:158
:
/// TAGS: BitVec, Pattern, Replace, Modify
///
bool BitVecReplace(BitVec *bv, BitVec *old_pattern, BitVec *new_pattern);
///
- In
Pattern.h:191
:
/// TAGS: BitVec, Pattern, Match, Wildcard
///
bool BitVecMatches(BitVec *bv, BitVec *pattern, BitVec *wildcard);
///
- In
Pattern.h:224
:
/// TAGS: BitVec, Pattern, Regex, Match
///
bool BitVecRegexMatch(BitVec *bv, const char *pattern);
///
- In
Foreach.h:37
:
if ((bv)->length > 0) { \
for ((idx) = 0; (idx) < (bv)->length; ++(idx)) { \
bool var = BitVecGet(bv, idx); \
{ body } \
if ((idx) >= (bv)->length) { \
- In
Foreach.h:63
:
if ((bv)->length > 0) { \
for (idx = (bv)->length - 1; (idx) < (bv)->length; --(idx)) { \
bool var = BitVecGet(bv, idx); \
{ body } \
if ((idx) >= (bv)->length) { \
- In
Foreach.h:162
:
); \
} \
bool var = BitVecGet(bv, idx); \
{ body } \
} \
- In
Foreach.h:211
:
/// TAGS: BitVec, RunLength, Analysis, Pattern
///
u64 BitVecRunLengths(BitVec *bv, u64 *runs, bool *values, u64 max_runs);
#ifdef __cplusplus
- In
Access.h:29
:
/// TAGS: BitVec, Access, Get, Boolean
///
bool BitVecGet(BitVec *bv, u64 idx);
///
- In
Access.h:44
:
/// TAGS: BitVec, Access, Set, Boolean
///
void BitVecSet(BitVec *bv, u64 idx, bool value);
///
- In
Access.h:159
:
/// TAGS: BitVec, Find, Search, Access
///
u64 BitVecFind(BitVec *bv, bool value);
///
- In
Access.h:174
:
/// TAGS: BitVec, FindLast, Search, Access
///
u64 BitVecFindLast(BitVec *bv, bool value);
///
- In
Access.h:189
:
/// TAGS: BitVec, All, Check, Predicate
///
bool BitVecAll(BitVec *bv, bool value);
///
- In
Access.h:204
:
/// TAGS: BitVec, Any, Check, Predicate
///
bool BitVecAny(BitVec *bv, bool value);
///
- In
Access.h:219
:
/// TAGS: BitVec, None, Check, Predicate
///
bool BitVecNone(BitVec *bv, bool value);
///
- In
Access.h:234
:
/// TAGS: BitVec, LongestRun, Analysis, Sequence
///
u64 BitVecLongestRun(BitVec *bv, bool value);
#ifdef __cplusplus
- In
Insert.h:31
:
/// TAGS: Insert, BitVec, Range, Multiple
///
void BitVecInsertRange(BitVec *bv, u64 idx, u64 count, bool value);
///
- In
Insert.h:78
:
/// TAGS: BitVec, Push, Append, Insert
///
void BitVecPush(BitVec *bv, bool value);
///
- In
Insert.h:93
:
/// TAGS: BitVec, Insert, Shift, Single
///
void BitVecInsert(BitVec *bv, u64 idx, bool value);
#ifdef __cplusplus
- In
Sys.c:48
:
PROCESS_INFORMATION pi;
DWORD exit_code;
bool completed;
#else
pid_t pid;
- In
Sys.c:52
:
pid_t pid;
int exit_code;
bool completed;
#endif
};
- In
Sys.c:446
:
// Check if argument needs quotes
bool needs_quotes = false;
for (size j = 0; j < arg->length; j++) {
if (arg->data[j] == ' ') {
- In
Sys.c:717
:
}
bool SysGetProcessExitCode(SysProcInfo* proc_info, i32* exit_code) {
if (!proc_info || !exit_code) {
return false;
- In
Sys.c:730
:
}
bool SysTerminateProcess(SysProcInfo* proc_info) {
if (!proc_info) {
return false;
- In
JSON.c:23
:
StrIter read_si;
bool expect_comma = false;
// while not at the end of object.
- In
JSON.c:106
:
StrIter read_si;
bool expect_comma = false;
// while not at the end of array.
- In
JSON.c:288
:
Str ns = StrInit();
bool is_neg = false;
if (StrIterPeek(&si) == '-') {
is_neg = true;
- In
JSON.c:294
:
}
bool is_flt = false;
bool has_exp = false;
bool has_exp_plus_minus = false;
- In
JSON.c:295
:
bool is_flt = false;
bool has_exp = false;
bool has_exp_plus_minus = false;
bool is_parsing = true;
- In
JSON.c:296
:
bool is_flt = false;
bool has_exp = false;
bool has_exp_plus_minus = false;
bool is_parsing = true;
- In
JSON.c:297
:
bool has_exp = false;
bool has_exp_plus_minus = false;
bool is_parsing = true;
while (is_parsing && StrIterRemainingLength(&si) && StrIterPeek(&si)) {
- In
JSON.c:459
:
}
StrIter JReadBool(StrIter si, bool* b) {
if (!StrIterRemainingLength(&si)) {
return si;
- In
JSON.c:508
:
}
StrIter JReadNull(StrIter si, bool* is_null) {
if (!StrIterRemainingLength(&si)) {
return si;
- In
JSON.c:555
:
if (StrIterPeek(&si) == 't' || StrIterPeek(&si) == 'f') {
StrIter before_si = si;
bool b;
si = JReadBool(si, &b);
- In
JSON.c:572
:
if (StrIterPeek(&si) == 'n') {
StrIter before_si = si;
bool n;
si = JReadNull(si, &n);
- In
Log.c:18
:
static SysMutex *log_mutex = NULL;
void LogInit(bool redirect) {
if (redirect) {
// Get the current time
- In
File.c:15
:
#include <Misra/Types.h>
bool ReadCompleteFile(const char *filename, char **data, size *file_size, size *capacity) {
if (!filename || !data || !file_size || !capacity) {
LOG_ERROR("invalid arguments.");
- In
Io.c:69
:
// Helper function to parse format specifiers
// {[(alignment/endianness)[alignment-width/raw-read-width]](specifier)}
static bool ParseFormatSpec(const char* spec, u32 len, FmtInfo* fi) {
if (!spec || !fi) {
LOG_FATAL("Invalid arguments to ParseFormatSpec");
- In
Io.c:217
:
}
bool StrWriteFmtInternal(Str* o, const char* fmt, TypeSpecificIO* args, size argc) {
if (!o || !fmt) {
LOG_FATAL("Invalid arguments");
- In
Io.c:600
:
fpos_t start_pos;
bool can_rollback = false;
// store the position we start reading with
- In
Io.c:652
:
}
bool is_caps = (flags & FMT_FLAG_CAPS) != 0;
bool force_case = (flags & FMT_FLAG_FORCE_CASE) != 0;
- In
Io.c:653
:
bool is_caps = (flags & FMT_FLAG_CAPS) != 0;
bool force_case = (flags & FMT_FLAG_FORCE_CASE) != 0;
// Process bytes in big-endian order (most significant byte first)
- In
Io.c:687
:
}
bool is_caps = (flags & FMT_FLAG_CAPS) != 0;
bool force_case = (flags & FMT_FLAG_FORCE_CASE) != 0;
- In
Io.c:688
:
bool is_caps = (flags & FMT_FLAG_CAPS) != 0;
bool force_case = (flags & FMT_FLAG_FORCE_CASE) != 0;
while (len--) {
- In
Io.c:731
:
size bytes_read = 0;
const char* current = i;
bool force_case = fmt_info && (fmt_info->flags & FMT_FLAG_FORCE_CASE) != 0;
bool is_caps = fmt_info && (fmt_info->flags & FMT_FLAG_CAPS) != 0;
- In
Io.c:732
:
const char* current = i;
bool force_case = fmt_info && (fmt_info->flags & FMT_FLAG_FORCE_CASE) != 0;
bool is_caps = fmt_info && (fmt_info->flags & FMT_FLAG_CAPS) != 0;
while (bytes_read < buffer_size && *current && !IS_SPACE(*current)) {
- In
Io.c:946
:
// Use StrFromU64 directly with the appropriate base
bool use_prefix = (base != 10); // Add prefix for non-decimal bases
StrIntFormat config = {.base = base, .uppercase = (fmt_info->flags & FMT_FLAG_CAPS) != 0, .use_prefix = use_prefix};
StrFromU64(&temp, *v, &config);
- In
Io.c:1038
:
// Use StrFromI64 directly with the appropriate base
bool use_prefix = (base != 10); // Add prefix for non-decimal bases
StrIntFormat config = {.base = base, .uppercase = (fmt_info->flags & FMT_FLAG_CAPS) != 0, .use_prefix = use_prefix};
StrFromI64(&temp, *v, &config);
- In
Io.c:1258
:
// Check for case conversion flags
bool force_case = fmt_info && (fmt_info->flags & FMT_FLAG_FORCE_CASE) != 0;
bool is_caps = fmt_info && (fmt_info->flags & FMT_FLAG_CAPS) != 0;
- In
Io.c:1259
:
// Check for case conversion flags
bool force_case = fmt_info && (fmt_info->flags & FMT_FLAG_FORCE_CASE) != 0;
bool is_caps = fmt_info && (fmt_info->flags & FMT_FLAG_CAPS) != 0;
// Skip leading whitespace
- In
Io.c:1354
:
// Helper function to check if a character is valid for number parsing
static bool IsValidNumberChar(char c, bool is_first_char, bool allow_decimal) {
// Allow digits
if (IS_DIGIT(c))
- In
Io.c:1394
:
// Create a helper function to check if the parsed string contains only valid numeric characters
static bool IsValidNumericString(const Str* str, bool allow_float) {
if (!str || !str->data)
return false;
- In
Io.c:1424
:
// Check for decimal, octal, hex, or binary prefix
bool is_hex = false;
bool is_bin = false;
bool is_oct = false;
- In
Io.c:1425
:
// Check for decimal, octal, hex, or binary prefix
bool is_hex = false;
bool is_bin = false;
bool is_oct = false;
- In
Io.c:1426
:
bool is_hex = false;
bool is_bin = false;
bool is_oct = false;
if (str->length > 2 && str->data[0] == '0') {
- In
Io.c:1439
:
// For floating point, we need to track decimal point and scientific notation
bool has_decimal = false;
bool has_exp = false;
- In
Io.c:1440
:
// For floating point, we need to track decimal point and scientific notation
bool has_decimal = false;
bool has_exp = false;
// Check each character
- In
Io.c:1559
:
const char* start = i;
size pos = 0;
bool has_decimal = false; // Track if we've seen a decimal point
// Parse character by character
- In
Io.c:2458
:
const char* start = i;
size pos = 0;
bool has_decimal = false; // Track if we've seen a decimal point
// Parse character by character
- In
BitVec.c:179
:
// Copy all bits
for (u64 i = 0; i < bv->length; i++) {
bool bit = BitVecGet(bv, i);
BitVecSet(&clone, i, bit);
}
- In
BitVec.c:186
:
}
bool BitVecGet(BitVec *bitvec, u64 idx) {
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
- In
BitVec.c:197
:
}
void BitVecSet(BitVec *bitvec, u64 idx, bool value) {
ValidateBitVec(bitvec);
if (idx >= bitvec->length) {
- In
BitVec.c:223
:
}
void BitVecPush(BitVec *bitvec, bool value) {
ValidateBitVec(bitvec);
if (bitvec->length >= bitvec->capacity) {
- In
BitVec.c:234
:
}
bool BitVecPop(BitVec *bitvec) {
ValidateBitVec(bitvec);
if (bitvec->length == 0) {
- In
BitVec.c:239
:
LOG_FATAL("Cannot pop from empty bitvector");
}
bool value = BitVecGet(bitvec, bitvec->length - 1);
BitVecResize(bitvec, bitvec->length - 1);
return value;
- In
BitVec.c:244
:
}
void BitVecInsert(BitVec *bitvec, u64 idx, bool value) {
ValidateBitVec(bitvec);
if (idx > bitvec->length) {
- In
BitVec.c:254
:
// Shift bits right from idx to end
for (u64 i = bitvec->length - 1; i > idx; i--) {
bool bit = BitVecGet(bitvec, i - 1);
BitVecSet(bitvec, i, bit);
}
- In
BitVec.c:261
:
}
void BitVecInsertRange(BitVec *bv, u64 idx, u64 count, bool value) {
ValidateBitVec(bv);
if (idx > bv->length) {
- In
BitVec.c:277
:
for (u64 i = old_length; i > idx;) {
i--;
bool bit = BitVecGet(bv, i);
BitVecSet(bv, i + count, bit);
}
- In
BitVec.c:304
:
for (u64 i = old_length; i > idx;) {
i--;
bool bit = BitVecGet(bv, i);
BitVecSet(bv, i + other->length, bit);
}
- In
BitVec.c:310
:
// Insert bits from other bitvector
for (u64 i = 0; i < other->length; i++) {
bool bit = BitVecGet(other, i);
BitVecSet(bv, idx + i, bit);
}
- In
BitVec.c:331
:
for (u64 i = old_length; i > idx;) {
i--;
bool bit = BitVecGet(bv, i);
BitVecSet(bv, i + pattern_bits, bit);
}
- In
BitVec.c:337
:
// Insert bits from pattern (LSB first)
for (u64 i = 0; i < pattern_bits; i++) {
bool bit = (pattern & (1u << i)) != 0;
BitVecSet(bv, idx + i, bit);
}
- In
BitVec.c:342
:
}
bool BitVecRemove(BitVec *bv, u64 idx) {
ValidateBitVec(bv);
if (idx >= bv->length) {
- In
BitVec.c:349
:
// Get the bit value before removing it
bool removed_bit = BitVecGet(bv, idx);
// Shift bits left from idx+1 to end
- In
BitVec.c:353
:
// Shift bits left from idx+1 to end
for (u64 i = idx; i < bv->length - 1; i++) {
bool bit = BitVecGet(bv, i + 1);
BitVecSet(bv, i, bit);
}
- In
BitVec.c:377
:
// Shift bits left to close the gap
for (u64 i = idx + count; i < bv->length; i++) {
bool bit = BitVecGet(bv, i);
BitVecSet(bv, i - count, bit);
}
- In
BitVec.c:385
:
}
bool BitVecRemoveFirst(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:397
:
}
bool BitVecRemoveLast(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:409
:
}
u64 BitVecRemoveAll(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:417
:
// Compact the bitvector by copying only bits that don't match the value
for (u64 read_idx = 0; read_idx < bv->length; read_idx++) {
bool bit = BitVecGet(bv, read_idx);
if (bit != value) {
// Keep this bit
- In
BitVec.c:463
:
for (u64 i = 0; i < min_len; i++) {
bool bit_a = BitVecGet(a, i);
bool bit_b = BitVecGet(b, i);
BitVecSet(result, i, bit_a && bit_b);
- In
BitVec.c:464
:
for (u64 i = 0; i < min_len; i++) {
bool bit_a = BitVecGet(a, i);
bool bit_b = BitVecGet(b, i);
BitVecSet(result, i, bit_a && bit_b);
}
- In
BitVec.c:478
:
for (u64 i = 0; i < max_len; i++) {
bool bit_a = i < a->length ? BitVecGet(a, i) : false;
bool bit_b = i < b->length ? BitVecGet(b, i) : false;
BitVecSet(result, i, bit_a || bit_b);
- In
BitVec.c:479
:
for (u64 i = 0; i < max_len; i++) {
bool bit_a = i < a->length ? BitVecGet(a, i) : false;
bool bit_b = i < b->length ? BitVecGet(b, i) : false;
BitVecSet(result, i, bit_a || bit_b);
}
- In
BitVec.c:493
:
for (u64 i = 0; i < max_len; i++) {
bool bit_a = i < a->length ? BitVecGet(a, i) : false;
bool bit_b = i < b->length ? BitVecGet(b, i) : false;
BitVecSet(result, i, bit_a != bit_b);
- In
BitVec.c:494
:
for (u64 i = 0; i < max_len; i++) {
bool bit_a = i < a->length ? BitVecGet(a, i) : false;
bool bit_b = i < b->length ? BitVecGet(b, i) : false;
BitVecSet(result, i, bit_a != bit_b);
}
- In
BitVec.c:506
:
for (u64 i = 0; i < bitvec->length; i++) {
bool bit = BitVecGet(bitvec, i);
BitVecSet(result, i, !bit);
}
- In
BitVec.c:512
:
// Comparison functions
bool BitVecEquals(BitVec *bv1, BitVec *bv2) {
ValidateBitVec(bv1);
ValidateBitVec(bv2);
- In
BitVec.c:523
:
}
bool BitVecEqualsRange(BitVec *bv1, u64 start1, BitVec *bv2, u64 start2, u64 len) {
ValidateBitVec(bv1);
ValidateBitVec(bv2);
- In
BitVec.c:578
:
// Compare bit by bit in the specified range
for (u64 i = 0; i < len; i++) {
bool bit1 = BitVecGet(bv1, start1 + i);
bool bit2 = BitVecGet(bv2, start2 + i);
- In
BitVec.c:579
:
for (u64 i = 0; i < len; i++) {
bool bit1 = BitVecGet(bv1, start1 + i);
bool bit2 = BitVecGet(bv2, start2 + i);
if (bit1 != bit2) {
- In
BitVec.c:601
:
for (u64 i = max_len; i > 0;) {
i--;
bool bit1 = i < bv1->length ? BitVecGet(bv1, i) : false;
bool bit2 = i < bv2->length ? BitVecGet(bv2, i) : false;
- In
BitVec.c:602
:
i--;
bool bit1 = i < bv1->length ? BitVecGet(bv1, i) : false;
bool bit2 = i < bv2->length ? BitVecGet(bv2, i) : false;
if (bit1 != bit2) {
- In
BitVec.c:637
:
// Get sign bits (MSB)
bool sign1 = bv1->length > 0 ? BitVecGet(bv1, bv1->length - 1) : false;
bool sign2 = bv2->length > 0 ? BitVecGet(bv2, bv2->length - 1) : false;
- In
BitVec.c:638
:
// Get sign bits (MSB)
bool sign1 = bv1->length > 0 ? BitVecGet(bv1, bv1->length - 1) : false;
bool sign2 = bv2->length > 0 ? BitVecGet(bv2, bv2->length - 1) : false;
// If signs differ, negative < positive
- In
BitVec.c:656
:
}
bool BitVecIsSubset(BitVec *bv1, BitVec *bv2) {
ValidateBitVec(bv1);
ValidateBitVec(bv2);
- In
BitVec.c:664
:
for (u64 i = 0; i < max_len; i++) {
bool bit1 = i < bv1->length ? BitVecGet(bv1, i) : false;
bool bit2 = i < bv2->length ? BitVecGet(bv2, i) : false;
- In
BitVec.c:665
:
for (u64 i = 0; i < max_len; i++) {
bool bit1 = i < bv1->length ? BitVecGet(bv1, i) : false;
bool bit2 = i < bv2->length ? BitVecGet(bv2, i) : false;
// If bv1 has a 1-bit where bv2 has a 0-bit, bv1 is not a subset
- In
BitVec.c:676
:
}
bool BitVecIsSuperset(BitVec *bv1, BitVec *bv2) {
return BitVecIsSubset(bv2, bv1);
}
- In
BitVec.c:680
:
}
bool BitVecDisjoint(BitVec *bv1, BitVec *bv2) {
ValidateBitVec(bv1);
ValidateBitVec(bv2);
- In
BitVec.c:696
:
}
bool BitVecOverlaps(BitVec *bv1, BitVec *bv2) {
return !BitVecDisjoint(bv1, bv2);
}
- In
BitVec.c:703
:
bool BitVecIsSorted(BitVec *bv) {
ValidateBitVec(bv);
- In
BitVec.c:707
:
// Sorted means all 0s come before all 1s
bool found_one = false;
for (u64 i = 0; i < bv->length; i++) {
- In
BitVec.c:710
:
for (u64 i = 0; i < bv->length; i++) {
bool bit = BitVecGet(bv, i);
if (bit) {
- In
BitVec.c:815
:
u64 byte_idx = i / 8;
u64 bit_offset = i % 8;
bool bit = (bytes[byte_idx] & (1u << bit_offset)) != 0;
BitVecSet(&result, i, bit);
}
- In
BitVec.c:857
:
// Convert integer to bits (LSB first)
for (u64 i = 0; i < bits; i++) {
bool bit = (value & (1ULL << i)) != 0;
BitVecSet(&result, i, bit);
}
- In
BitVec.c:879
:
// Shift bits left (move bits to higher indices)
for (u64 i = bv->length - 1; i >= positions; i--) {
bool bit = BitVecGet(bv, i - positions);
BitVecSet(bv, i, bit);
}
- In
BitVec.c:903
:
// Shift bits right (move bits to lower indices)
for (u64 i = 0; i < bv->length - positions; i++) {
bool bit = BitVecGet(bv, i + positions);
BitVecSet(bv, i, bit);
}
- In
BitVec.c:930
:
for (u64 i = 0; i < bv->length; i++) {
u64 src_idx = (i + positions) % bv->length;
bool bit = BitVecGet(&temp, src_idx);
BitVecSet(bv, i, bit);
}
- In
BitVec.c:954
:
for (u64 i = 0; i < bv->length; i++) {
u64 src_idx = (i + bv->length - positions) % bv->length;
bool bit = BitVecGet(&temp, src_idx);
BitVecSet(bv, i, bit);
}
- In
BitVec.c:970
:
for (u64 i = 0; i < bv->length / 2; i++) {
u64 j = bv->length - 1 - i;
bool bit_i = BitVecGet(bv, i);
bool bit_j = BitVecGet(bv, j);
BitVecSet(bv, i, bit_j);
- In
BitVec.c:971
:
u64 j = bv->length - 1 - i;
bool bit_i = BitVecGet(bv, i);
bool bit_j = BitVecGet(bv, j);
BitVecSet(bv, i, bit_j);
BitVecSet(bv, j, bit_i);
- In
BitVec.c:979
:
// Missing Access functions implementation
u64 BitVecFind(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:990
:
}
u64 BitVecFindLast(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:1007
:
}
bool BitVecAll(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:1018
:
}
bool BitVecAny(BitVec *bv, bool value) {
ValidateBitVec(bv);
return BitVecFind(bv, value) != SIZE_MAX;
- In
BitVec.c:1023
:
}
bool BitVecNone(BitVec *bv, bool value) {
return !BitVecAny(bv, value);
}
- In
BitVec.c:1027
:
}
u64 BitVecLongestRun(BitVec *bv, bool value) {
ValidateBitVec(bv);
- In
BitVec.c:1114
:
// Foreach functions
u64 BitVecRunLengths(BitVec *bv, u64 *runs, bool *values, u64 max_runs) {
ValidateBitVec(bv);
if (!runs || !values || max_runs == 0) {
- In
BitVec.c:1126
:
u64 run_count = 0;
u64 current_run_length = 1;
bool current_value = BitVecGet(bv, 0);
for (u64 i = 1; i < bv->length; i++) {
- In
BitVec.c:1129
:
for (u64 i = 1; i < bv->length; i++) {
bool bit = BitVecGet(bv, i);
if (bit == current_value) {
current_run_length++;
- In
BitVec.c:1198
:
for (u64 i = 0; i < max_length; i++) {
bool bit1 = (i < bv1->length) ? BitVecGet(bv1, i) : false;
bool bit2 = (i < bv2->length) ? BitVecGet(bv2, i) : false;
- In
BitVec.c:1199
:
for (u64 i = 0; i < max_length; i++) {
bool bit1 = (i < bv1->length) ? BitVecGet(bv1, i) : false;
bool bit2 = (i < bv2->length) ? BitVecGet(bv2, i) : false;
if (bit1 || bit2) {
- In
BitVec.c:1399
:
// Missing Pattern functions implementation
bool BitVecStartsWith(BitVec *bv, BitVec *prefix) {
ValidateBitVec(bv);
ValidateBitVec(prefix);
- In
BitVec.c:1410
:
}
bool BitVecEndsWith(BitVec *bv, BitVec *suffix) {
ValidateBitVec(bv);
ValidateBitVec(suffix);
- In
BitVec.c:1424
:
bool BitVecContainsAt(BitVec *bv, BitVec *pattern, u64 idx) {
ValidateBitVec(bv);
ValidateBitVec(pattern);
- In
BitVec.c:1479
:
}
bool BitVecReplace(BitVec *bv, BitVec *old_pattern, BitVec *new_pattern) {
ValidateBitVec(bv);
ValidateBitVec(old_pattern);
- In
BitVec.c:1510
:
while (search_pos < bv->length) {
// Find next occurrence
bool found = false;
u64 match_pos = SIZE_MAX;
- In
BitVec.c:1541
:
}
bool BitVecMatches(BitVec *bv, BitVec *pattern, BitVec *wildcard) {
ValidateBitVec(bv);
ValidateBitVec(pattern);
- In
BitVec.c:1587
:
}
bool BitVecRegexMatch(BitVec *bv, const char *pattern) {
ValidateBitVec(bv);
if (!pattern) {
- In
BitVec.c:1599
:
// Convert bitvector to string for regex matching
Str bv_str = BitVecToStr(bv);
bool result = false;
// Very basic pattern matching - just check if pattern is substring
- In
Str.c:70
:
}
bool StrInitCopy(Str* dst, const Str* src) {
ValidateStr(src);
- In
Str.c:147
:
// Helper function to check if char is in strip_chars
static inline bool is_strip_char(char c, const char* strip_chars) {
const char* p = strip_chars;
while (*p) {
- In
Str.c:185
:
}
static inline bool starts_with(const char* data, size data_len, const char* prefix, size prefix_len) {
return data_len >= prefix_len && MemCompare(data, prefix, prefix_len) == 0;
}
- In
Str.c:189
:
}
static inline bool ends_with(const char* data, size data_len, const char* suffix, size suffix_len) {
return data_len >= suffix_len && MemCompare(data + data_len - suffix_len, suffix, suffix_len) == 0;
}
- In
Str.c:193
:
}
bool StrStartsWithZstr(const Str* s, const char* prefix) {
ValidateStr(s);
return starts_with(s->data, s->length, prefix, ZstrLen(prefix));
- In
Str.c:198
:
}
bool StrEndsWithZstr(const Str* s, const char* suffix) {
ValidateStr(s);
return ends_with(s->data, s->length, suffix, ZstrLen(suffix));
- In
Str.c:203
:
}
bool StrStartsWithCstr(const Str* s, const char* prefix, size prefix_len) {
ValidateStr(s);
return starts_with(s->data, s->length, prefix, prefix_len);
- In
Str.c:208
:
}
bool StrEndsWithCstr(const Str* s, const char* suffix, size suffix_len) {
ValidateStr(s);
return ends_with(s->data, s->length, suffix, suffix_len);
- In
Str.c:213
:
}
bool StrStartsWith(const Str* s, const Str* prefix) {
ValidateStr(s);
return starts_with(s->data, s->length, prefix->data, prefix->length);
- In
Str.c:218
:
}
bool StrEndsWith(const Str* s, const Str* suffix) {
ValidateStr(s);
return ends_with(s->data, s->length, suffix->data, suffix->length);
- In
Str.c:265
:
// Helper function to convert a single digit to character
static inline char digit_to_char(u8 digit, bool uppercase) {
if (digit < 10)
return '0' + digit;
- In
Str.c:272
:
// Helper function to convert character to digit
static inline bool char_to_digit(char c, u8* digit, u8 base) {
if (IS_DIGIT(c)) {
*digit = c - '0';
- In
Str.c:286
:
// Helper function to validate base values
static inline bool is_valid_base(u8 base) {
return base != 1 && base <= 36;
}
- In
Str.c:388
:
// Handle negative numbers
bool is_negative = value < 0;
u64 abs_value;
- In
Str.c:454
:
// Simple implementation for now
bool use_sci = config->force_sci || (value != 0.0 && (value < 0.0001 || value >= 1e7));
if (use_sci) {
- In
Str.c:567
:
}
bool StrToU64(const Str* str, u64* value, const StrParseConfig* config) {
ValidateStr(str);
- In
Str.c:617
:
// Convert digits
u64 result = 0;
bool have_digits = false;
while (pos < str->length) {
- In
Str.c:657
:
}
bool StrToI64(const Str* str, i64* value, const StrParseConfig* config) {
ValidateStr(str);
- In
Str.c:680
:
// Handle sign
bool negative = false;
if (str->data[pos] == '-') {
negative = true;
- In
Str.c:721
:
}
bool StrToF64(const Str* str, f64* value, const StrParseConfig* config) {
ValidateStr(str);
- In
Str.c:764
:
// Handle sign
bool negative = false;
if (str->data[pos] == '-') {
negative = true;
- In
Str.c:788
:
// Parse number
f64 result = 0.0;
bool have_digits = false;
// Parse integer part
- In
Str.c:814
:
pos++;
bool exp_negative = false;
if (pos < str->length) {
if (str->data[pos] == '-') {
- In
Str.c:825
:
i32 exponent = 0;
bool have_exp_digits = false;
while (pos < str->length && IS_DIGIT(str->data[pos])) {
- In
MisraEnum.c:56
:
StrIter json = StrIterFromStr(code);
Str enum_name = StrInit();
bool to_from_str = false;
EnumEntry invalid_enum = {0};
Str name;
u32 age;
bool is_active;
f64 salary;
} Person;
typedef struct Config {
bool debug_mode;
u32 timeout;
Str log_level;
// Function prototypes
bool test_simple_string_writing(void);
bool test_simple_numbers_writing(void);
bool test_simple_boolean_writing(void);
// Function prototypes
bool test_simple_string_writing(void);
bool test_simple_numbers_writing(void);
bool test_simple_boolean_writing(void);
bool test_simple_person_object_writing(void);
bool test_simple_string_writing(void);
bool test_simple_numbers_writing(void);
bool test_simple_boolean_writing(void);
bool test_simple_person_object_writing(void);
bool test_simple_config_object_writing(void);
bool test_simple_numbers_writing(void);
bool test_simple_boolean_writing(void);
bool test_simple_person_object_writing(void);
bool test_simple_config_object_writing(void);
bool test_simple_array_of_strings_writing(void);
bool test_simple_boolean_writing(void);
bool test_simple_person_object_writing(void);
bool test_simple_config_object_writing(void);
bool test_simple_array_of_strings_writing(void);
bool test_simple_nested_object_writing(void);
bool test_simple_person_object_writing(void);
bool test_simple_config_object_writing(void);
bool test_simple_array_of_strings_writing(void);
bool test_simple_nested_object_writing(void);
bool test_simple_product_with_tags_writing(void);
bool test_simple_config_object_writing(void);
bool test_simple_array_of_strings_writing(void);
bool test_simple_nested_object_writing(void);
bool test_simple_product_with_tags_writing(void);
bool test_simple_array_of_strings_writing(void);
bool test_simple_nested_object_writing(void);
bool test_simple_product_with_tags_writing(void);
// Helper function to compare expected JSON strings (removes spaces for comparison)
// Helper function to compare expected JSON strings (removes spaces for comparison)
bool compare_json_output(const Str* output, const char* expected) {
// Create a copy of expected without spaces for comparison
Str expected_str = StrInitFromZstr(expected);
}
bool result = StrCmp(&output_clean, &expected_clean) == 0;
if (!result) {
// Test 1: Simple string writing
bool test_simple_string_writing(void) {
printf("Testing simple string writing\n");
printf("Testing simple string writing\n");
bool success = true;
Str json = StrInit();
// Test 2: Simple number writing
bool test_simple_numbers_writing(void) {
printf("Testing simple number writing\n");
printf("Testing simple number writing\n");
bool success = true;
Str json = StrInit();
// Test 3: Simple boolean writing
bool test_simple_boolean_writing(void) {
printf("Testing simple boolean writing\n");
printf("Testing simple boolean writing\n");
bool success = true;
Str json = StrInit();
Str json = StrInit();
bool enabled = true;
bool visible = false;
bool enabled = true;
bool visible = false;
JW_OBJ(json, {
// Test 4: Simple person object writing
bool test_simple_person_object_writing(void) {
printf("Testing simple person object writing\n");
printf("Testing simple person object writing\n");
bool success = true;
Str json = StrInit();
// Test 5: Simple config object writing
bool test_simple_config_object_writing(void) {
printf("Testing simple config object writing\n");
printf("Testing simple config object writing\n");
bool success = true;
Str json = StrInit();
// Test 6: Simple array of strings writing
bool test_simple_array_of_strings_writing(void) {
printf("Testing simple array of strings writing\n");
printf("Testing simple array of strings writing\n");
bool success = true;
Str json = StrInit();
// Test 7: Simple nested object writing
bool test_simple_nested_object_writing(void) {
printf("Testing simple nested object writing\n");
printf("Testing simple nested object writing\n");
bool success = true;
Str json = StrInit();
Str email;
} user;
bool active;
} data = {
{StrInitFromZstr("Charlie"), StrInitFromZstr("charlie@example.com")},
// Test 8: Simple product with tags array writing
bool test_simple_product_with_tags_writing(void) {
printf("Testing simple product with tags array writing\n");
printf("Testing simple product with tags array writing\n");
bool success = true;
Str json = StrInit();
- In
Read.Simple.c:16
:
Str name;
u32 age;
bool is_active;
f64 salary;
} Person;
- In
Read.Simple.c:21
:
typedef struct Config {
bool debug_mode;
u32 timeout;
Str log_level;
- In
Read.Simple.c:48
:
// Function prototypes
bool test_simple_string_parsing(void);
bool test_simple_numbers(void);
bool test_simple_boolean(void);
- In
Read.Simple.c:49
:
// Function prototypes
bool test_simple_string_parsing(void);
bool test_simple_numbers(void);
bool test_simple_boolean(void);
bool test_simple_person_object(void);
- In
Read.Simple.c:50
:
bool test_simple_string_parsing(void);
bool test_simple_numbers(void);
bool test_simple_boolean(void);
bool test_simple_person_object(void);
bool test_simple_config_object(void);
- In
Read.Simple.c:51
:
bool test_simple_numbers(void);
bool test_simple_boolean(void);
bool test_simple_person_object(void);
bool test_simple_config_object(void);
bool test_simple_array_of_strings(void);
- In
Read.Simple.c:52
:
bool test_simple_boolean(void);
bool test_simple_person_object(void);
bool test_simple_config_object(void);
bool test_simple_array_of_strings(void);
bool test_simple_nested_object(void);
- In
Read.Simple.c:53
:
bool test_simple_person_object(void);
bool test_simple_config_object(void);
bool test_simple_array_of_strings(void);
bool test_simple_nested_object(void);
bool test_simple_product_with_tags(void);
- In
Read.Simple.c:54
:
bool test_simple_config_object(void);
bool test_simple_array_of_strings(void);
bool test_simple_nested_object(void);
bool test_simple_product_with_tags(void);
- In
Read.Simple.c:55
:
bool test_simple_array_of_strings(void);
bool test_simple_nested_object(void);
bool test_simple_product_with_tags(void);
// Test 1: Simple string parsing
- In
Read.Simple.c:58
:
// Test 1: Simple string parsing
bool test_simple_string_parsing(void) {
printf("Testing simple string parsing\n");
- In
Read.Simple.c:61
:
printf("Testing simple string parsing\n");
bool success = true;
Str json = StrInitFromZstr("{\"name\": \"Alice\", \"city\": \"New York\"}");
StrIter si = StrIterFromStr(json);
- In
Read.Simple.c:98
:
// Test 2: Simple number parsing
bool test_simple_numbers(void) {
printf("Testing simple number parsing\n");
printf("Testing simple number parsing\n");
bool success = true;
Str json = StrInitFromZstr("{\"count\": 42, \"score\": 95.5, \"year\": 2024}");
StrIter si = StrIterFromStr(json);
// Test 3: Simple boolean parsing
bool test_simple_boolean(void) {
printf("Testing simple boolean parsing\n");
printf("Testing simple boolean parsing\n");
bool success = true;
Str json = StrInitFromZstr("{\"enabled\": true, \"visible\": false}");
StrIter si = StrIterFromStr(json);
StrIter si = StrIterFromStr(json);
bool enabled = false;
bool visible = true;
bool enabled = false;
bool visible = true;
JR_OBJ(si, {
// Test 4: Simple person object
bool test_simple_person_object(void) {
printf("Testing simple person object\n");
printf("Testing simple person object\n");
bool success = true;
Str json =
StrInitFromZstr("{\"id\": 1001, \"name\": \"Bob\", \"age\": 25, \"is_active\": true, \"salary\": 50000.0}");
// Test 5: Simple config object
bool test_simple_config_object(void) {
printf("Testing simple config object\n");
printf("Testing simple config object\n");
bool success = true;
Str json = StrInitFromZstr("{\"debug_mode\": false, \"timeout\": 30, \"log_level\": \"INFO\"}");
StrIter si = StrIterFromStr(json);
// Test 6: Simple array of strings
bool test_simple_array_of_strings(void) {
printf("Testing simple array of strings\n");
printf("Testing simple array of strings\n");
bool success = true;
Str json = StrInitFromZstr("{\"languages\": [\"C\", \"Python\", \"Rust\"]}");
StrIter si = StrIterFromStr(json);
// Test 7: Simple nested object (1 level)
bool test_simple_nested_object(void) {
printf("Testing simple nested object\n");
printf("Testing simple nested object\n");
bool success = true;
Str json =
StrInitFromZstr("{\"user\": {\"name\": \"Charlie\", \"email\": \"charlie@example.com\"}, \"active\": true}");
Str email;
} user;
bool active;
} data = {
{StrInit(), StrInit()},
// Test 8: Simple product with tags array
bool test_simple_product_with_tags(void) {
printf("Testing simple product with tags array\n");
printf("Testing simple product with tags array\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"id\": 12345, \"name\": \"Laptop\", \"price\": 999.99, \"tags\": [\"electronics\", \"computers\", "
// Helper function to compare JSON output (removes spaces for comparison)
bool compare_json_output(const Str* output, const char* expected) {
// Create a copy of expected without spaces for comparison
Str expected_str = StrInitFromZstr(expected);
}
bool result = StrCmp(&output_clean, &expected_clean) == 0;
if (!result) {
// Function prototypes
bool test_empty_object_writing(void);
bool test_empty_array_writing(void);
bool test_empty_string_writing(void);
// Function prototypes
bool test_empty_object_writing(void);
bool test_empty_array_writing(void);
bool test_empty_string_writing(void);
bool test_negative_numbers_writing(void);
bool test_empty_object_writing(void);
bool test_empty_array_writing(void);
bool test_empty_string_writing(void);
bool test_negative_numbers_writing(void);
bool test_large_numbers_writing(void);
bool test_empty_array_writing(void);
bool test_empty_string_writing(void);
bool test_negative_numbers_writing(void);
bool test_large_numbers_writing(void);
bool test_zero_values_writing(void);
bool test_empty_string_writing(void);
bool test_negative_numbers_writing(void);
bool test_large_numbers_writing(void);
bool test_zero_values_writing(void);
bool test_special_characters_writing(void);
bool test_negative_numbers_writing(void);
bool test_large_numbers_writing(void);
bool test_zero_values_writing(void);
bool test_special_characters_writing(void);
bool test_escape_sequences_writing(void);
bool test_large_numbers_writing(void);
bool test_zero_values_writing(void);
bool test_special_characters_writing(void);
bool test_escape_sequences_writing(void);
bool test_nested_empty_containers_writing(void);
bool test_zero_values_writing(void);
bool test_special_characters_writing(void);
bool test_escape_sequences_writing(void);
bool test_nested_empty_containers_writing(void);
bool test_mixed_empty_and_filled_writing(void);
bool test_special_characters_writing(void);
bool test_escape_sequences_writing(void);
bool test_nested_empty_containers_writing(void);
bool test_mixed_empty_and_filled_writing(void);
bool test_boundary_integers_writing(void);
bool test_escape_sequences_writing(void);
bool test_nested_empty_containers_writing(void);
bool test_mixed_empty_and_filled_writing(void);
bool test_boundary_integers_writing(void);
bool test_boundary_floats_writing(void);
bool test_nested_empty_containers_writing(void);
bool test_mixed_empty_and_filled_writing(void);
bool test_boundary_integers_writing(void);
bool test_boundary_floats_writing(void);
bool test_single_values_writing(void);
bool test_mixed_empty_and_filled_writing(void);
bool test_boundary_integers_writing(void);
bool test_boundary_floats_writing(void);
bool test_single_values_writing(void);
bool test_boundary_integers_writing(void);
bool test_boundary_floats_writing(void);
bool test_single_values_writing(void);
// Test 1: Empty object writing
// Test 1: Empty object writing
bool test_empty_object_writing(void) {
printf("Testing empty object writing\n");
printf("Testing empty object writing\n");
bool success = true;
Str json = StrInit();
// Test 2: Empty array writing
bool test_empty_array_writing(void) {
printf("Testing empty array writing\n");
printf("Testing empty array writing\n");
bool success = true;
Str json = StrInit();
// Test 3: Empty string writing
bool test_empty_string_writing(void) {
printf("Testing empty string writing\n");
printf("Testing empty string writing\n");
bool success = true;
Str json = StrInit();
// Test 4: Negative numbers writing
bool test_negative_numbers_writing(void) {
printf("Testing negative numbers writing\n");
printf("Testing negative numbers writing\n");
bool success = true;
Str json = StrInit();
// Test 5: Large numbers writing
bool test_large_numbers_writing(void) {
printf("Testing large numbers writing\n");
printf("Testing large numbers writing\n");
bool success = true;
Str json = StrInit();
// Test 6: Zero values writing
bool test_zero_values_writing(void) {
printf("Testing zero values writing\n");
printf("Testing zero values writing\n");
bool success = true;
Str json = StrInit();
i32 int_zero = 0;
f64 float_zero = 0.0;
bool bool_false = false;
JW_OBJ(json, {
// Test 7: Special characters writing
bool test_special_characters_writing(void) {
printf("Testing special characters writing\n");
printf("Testing special characters writing\n");
bool success = true;
Str json = StrInit();
// Test 8: Escape sequences writing
bool test_escape_sequences_writing(void) {
printf("Testing escape sequences writing\n");
printf("Testing escape sequences writing\n");
bool success = true;
Str json = StrInit();
// Test 9: Nested empty containers writing
bool test_nested_empty_containers_writing(void) {
printf("Testing nested empty containers writing\n");
printf("Testing nested empty containers writing\n");
bool success = true;
Str json = StrInit();
// Test 10: Mixed empty and filled containers writing
bool test_mixed_empty_and_filled_writing(void) {
printf("Testing mixed empty and filled containers writing\n");
printf("Testing mixed empty and filled containers writing\n");
bool success = true;
Str json = StrInit();
// Test 11: Boundary integers writing
bool test_boundary_integers_writing(void) {
printf("Testing boundary integers writing\n");
printf("Testing boundary integers writing\n");
bool success = true;
Str json = StrInit();
// Test 12: Boundary floats writing
bool test_boundary_floats_writing(void) {
printf("Testing boundary floats writing\n");
printf("Testing boundary floats writing\n");
bool success = true;
Str json = StrInit();
// Test 13: Single values writing (minimal valid JSON objects)
bool test_single_values_writing(void) {
printf("Testing single values writing\n");
printf("Testing single values writing\n");
bool success = true;
Str json1 = StrInit();
Str json2 = StrInit();
// Single boolean
bool single_bool = true;
JW_OBJ(json3, { JW_BOOL_KV(json3, "flag", single_bool); });
f64 large_float;
f64 small_float;
bool is_valid;
Vec(Str) empty_array;
Vec(i64) numbers;
// Function prototypes
bool test_empty_object_reading(void);
bool test_empty_array_reading(void);
bool test_empty_string_reading(void);
// Function prototypes
bool test_empty_object_reading(void);
bool test_empty_array_reading(void);
bool test_empty_string_reading(void);
bool test_negative_numbers_reading(void);
bool test_empty_object_reading(void);
bool test_empty_array_reading(void);
bool test_empty_string_reading(void);
bool test_negative_numbers_reading(void);
bool test_large_numbers_reading(void);
bool test_empty_array_reading(void);
bool test_empty_string_reading(void);
bool test_negative_numbers_reading(void);
bool test_large_numbers_reading(void);
bool test_zero_values_reading(void);
bool test_empty_string_reading(void);
bool test_negative_numbers_reading(void);
bool test_large_numbers_reading(void);
bool test_zero_values_reading(void);
bool test_special_characters_in_strings(void);
bool test_negative_numbers_reading(void);
bool test_large_numbers_reading(void);
bool test_zero_values_reading(void);
bool test_special_characters_in_strings(void);
bool test_escape_sequences_reading(void);
bool test_large_numbers_reading(void);
bool test_zero_values_reading(void);
bool test_special_characters_in_strings(void);
bool test_escape_sequences_reading(void);
bool test_whitespace_variations_reading(void);
bool test_zero_values_reading(void);
bool test_special_characters_in_strings(void);
bool test_escape_sequences_reading(void);
bool test_whitespace_variations_reading(void);
bool test_nested_empty_containers(void);
bool test_special_characters_in_strings(void);
bool test_escape_sequences_reading(void);
bool test_whitespace_variations_reading(void);
bool test_nested_empty_containers(void);
bool test_mixed_empty_and_filled(void);
bool test_escape_sequences_reading(void);
bool test_whitespace_variations_reading(void);
bool test_nested_empty_containers(void);
bool test_mixed_empty_and_filled(void);
bool test_boundary_integers(void);
bool test_whitespace_variations_reading(void);
bool test_nested_empty_containers(void);
bool test_mixed_empty_and_filled(void);
bool test_boundary_integers(void);
bool test_boundary_floats(void);
bool test_nested_empty_containers(void);
bool test_mixed_empty_and_filled(void);
bool test_boundary_integers(void);
bool test_boundary_floats(void);
bool test_mixed_empty_and_filled(void);
bool test_boundary_integers(void);
bool test_boundary_floats(void);
// Test 1: Empty object reading
// Test 1: Empty object reading
bool test_empty_object_reading(void) {
printf("Testing empty object reading\n");
printf("Testing empty object reading\n");
bool success = true;
// Test completely empty object
struct {
bool found_anything;
} obj1;
obj1.found_anything = false; // Start as true to test it gets properly handled
struct {
bool found_anything;
} obj2;
obj2.found_anything = false;
// Test 2: Empty array reading
bool test_empty_array_reading(void) {
printf("Testing empty array reading\n");
printf("Testing empty array reading\n");
bool success = true;
// Test completely empty array
// Test 3: Empty string reading
bool test_empty_string_reading(void) {
printf("Testing empty string reading\n");
printf("Testing empty string reading\n");
bool success = true;
Str json = StrInitFromZstr("{\"name\":\"\",\"description\":\"\"}");
// Test 4: Negative numbers reading
bool test_negative_numbers_reading(void) {
printf("Testing negative numbers reading\n");
printf("Testing negative numbers reading\n");
bool success = true;
Str json = StrInitFromZstr("{\"temp\":-25,\"balance\":-1000.50,\"delta\":-0.001}");
// Test 5: Large numbers reading
bool test_large_numbers_reading(void) {
printf("Testing large numbers reading\n");
printf("Testing large numbers reading\n");
bool success = true;
Str json = StrInitFromZstr(
// Test 6: Zero values reading
bool test_zero_values_reading(void) {
printf("Testing zero values reading\n");
printf("Testing zero values reading\n");
bool success = true;
Str json = StrInitFromZstr("{\"int_zero\":0,\"float_zero\":0.0,\"bool_false\":false}");
i32 int_zero;
f64 float_zero;
bool bool_false;
} obj = {999, 999.0, true}; // Initialize with non-zero values
if (obj.int_zero == 0 && obj.float_zero == 0.0 && obj.bool_false == false) {
printf(
"[DEBUG] Zero values test passed - int: %d, float: %f, bool: %s\n",
obj.int_zero,
obj.float_zero,
} else {
printf(
"[DEBUG] Zero values test FAILED - int: %d, float: %f, bool: %s\n",
obj.int_zero,
obj.float_zero,
// Test 7: Special characters in strings
bool test_special_characters_in_strings(void) {
printf("Testing special characters in strings\n");
printf("Testing special characters in strings\n");
bool success = true;
// Test with various special characters that might be problematic
// Test 8: Escape sequences reading
bool test_escape_sequences_reading(void) {
printf("Testing escape sequences reading\n");
printf("Testing escape sequences reading\n");
bool success = true;
Str json =
// Test 9: Whitespace variations reading
bool test_whitespace_variations_reading(void) {
printf("Testing whitespace variations reading\n");
printf("Testing whitespace variations reading\n");
bool success = true;
// Test with lots of different whitespace patterns
Str name;
i32 value;
bool flag;
} obj = {StrInit(), 0, false};
// Test 10: Nested empty containers
bool test_nested_empty_containers(void) {
printf("Testing nested empty containers\n");
printf("Testing nested empty containers\n");
bool success = true;
Str json = StrInitFromZstr("{\"outer\":{},\"list\":[],\"deep\":{\"inner\":{}}}");
struct {
bool found_outer;
bool found_list;
bool found_deep;
struct {
bool found_outer;
bool found_list;
bool found_deep;
bool found_inner;
bool found_outer;
bool found_list;
bool found_deep;
bool found_inner;
} obj = {false, false, false, false};
bool found_list;
bool found_deep;
bool found_inner;
} obj = {false, false, false, false};
// Test 11: Mixed empty and filled containers
bool test_mixed_empty_and_filled(void) {
printf("Testing mixed empty and filled containers\n");
printf("Testing mixed empty and filled containers\n");
bool success = true;
Str json = StrInitFromZstr("{\"empty_obj\":{},\"filled_obj\":{\"x\":1},\"empty_arr\":[],\"filled_arr\":[1,2]}");
// Test 12: Boundary integers
bool test_boundary_integers(void) {
printf("Testing boundary integers\n");
printf("Testing boundary integers\n");
bool success = true;
// Using smaller values that are safer to work with
// Test 13: Boundary floats
bool test_boundary_floats(void) {
printf("Testing boundary floats\n");
printf("Testing boundary floats\n");
bool success = true;
Str json = StrInitFromZstr("{\"tiny\":0.000001,\"huge\":999999.999999,\"zero\":0.0,\"negative_tiny\":-0.000001}");
Str function_name;
Str sha256;
bool debug;
Str function_mangled_name;
} AnnSymbol;
typedef struct ApiResponse {
bool status;
Str message;
AnnSymbols data;
// Helper function to compare JSON output (removes whitespace for comparison)
bool compare_json_output(const Str* output, const char* expected) {
Str expected_str = StrInitFromZstr(expected);
Str output_clean = StrInit();
}
bool result = StrCmp(&output_clean, &expected_clean) == 0;
if (!result) {
// Function prototypes
bool test_two_level_nesting_writing(void);
bool test_three_level_nesting_writing(void);
bool test_complex_api_response_writing(void);
// Function prototypes
bool test_two_level_nesting_writing(void);
bool test_three_level_nesting_writing(void);
bool test_complex_api_response_writing(void);
bool test_function_info_array_writing(void);
bool test_two_level_nesting_writing(void);
bool test_three_level_nesting_writing(void);
bool test_complex_api_response_writing(void);
bool test_function_info_array_writing(void);
bool test_search_results_with_tags_writing(void);
bool test_three_level_nesting_writing(void);
bool test_complex_api_response_writing(void);
bool test_function_info_array_writing(void);
bool test_search_results_with_tags_writing(void);
bool test_dynamic_object_keys_writing(void);
bool test_complex_api_response_writing(void);
bool test_function_info_array_writing(void);
bool test_search_results_with_tags_writing(void);
bool test_dynamic_object_keys_writing(void);
bool test_deeply_nested_structure_writing(void);
bool test_function_info_array_writing(void);
bool test_search_results_with_tags_writing(void);
bool test_dynamic_object_keys_writing(void);
bool test_deeply_nested_structure_writing(void);
bool test_mixed_array_types_writing(void);
bool test_search_results_with_tags_writing(void);
bool test_dynamic_object_keys_writing(void);
bool test_deeply_nested_structure_writing(void);
bool test_mixed_array_types_writing(void);
bool test_dynamic_object_keys_writing(void);
bool test_deeply_nested_structure_writing(void);
bool test_mixed_array_types_writing(void);
// Test 1: Two-level nesting writing
// Test 1: Two-level nesting writing
bool test_two_level_nesting_writing(void) {
printf("Testing two-level nesting writing\n");
printf("Testing two-level nesting writing\n");
bool success = true;
Str json = StrInit();
// Test 2: Three-level nesting writing
bool test_three_level_nesting_writing(void) {
printf("Testing three-level nesting writing\n");
printf("Testing three-level nesting writing\n");
bool success = true;
Str json = StrInit();
// Test 3: Complex API response writing
bool test_complex_api_response_writing(void) {
printf("Testing complex API response writing\n");
printf("Testing complex API response writing\n");
bool success = true;
Str json = StrInit();
// Test 4: Function info array writing
bool test_function_info_array_writing(void) {
printf("Testing function info array writing\n");
printf("Testing function info array writing\n");
bool success = true;
Str json = StrInit();
// Test 5: Search results with tags writing
bool test_search_results_with_tags_writing(void) {
printf("Testing search results with tags writing\n");
printf("Testing search results with tags writing\n");
bool success = true;
Str json = StrInit();
// Test 6: Dynamic object keys writing
bool test_dynamic_object_keys_writing(void) {
printf("Testing dynamic object keys writing\n");
printf("Testing dynamic object keys writing\n");
bool success = true;
Str json = StrInit();
// Test 7: Deeply nested structure writing
bool test_deeply_nested_structure_writing(void) {
printf("Testing deeply nested structure writing\n");
printf("Testing deeply nested structure writing\n");
bool success = true;
Str json = StrInit();
// Test 8: Mixed array types writing
bool test_mixed_array_types_writing(void) {
printf("Testing mixed array types writing\n");
printf("Testing mixed array types writing\n");
bool success = true;
Str json = StrInit();
VecPushBack(&strings, str3);
Vec(bool) booleans = VecInit();
bool bool1 = true, bool2 = false, bool3 = true;
VecPushBack(&booleans, bool1);
Vec(bool) booleans = VecInit();
bool bool1 = true, bool2 = false, bool3 = true;
VecPushBack(&booleans, bool1);
VecPushBack(&booleans, bool2);
- In
RoundTrip.c:17
:
Str name;
u32 age;
bool is_active;
f64 salary;
} TestPerson;
- In
RoundTrip.c:22
:
typedef struct TestConfig {
bool debug_mode;
u32 timeout;
Str log_level;
- In
RoundTrip.c:32
:
TestConfig config;
Vec(i32) numbers;
Vec(bool) flags;
} ComplexData;
- In
RoundTrip.c:53
:
// Function prototypes
bool test_simple_roundtrip(void);
bool test_numeric_roundtrip(void);
bool test_boolean_roundtrip(void);
- In
RoundTrip.c:54
:
// Function prototypes
bool test_simple_roundtrip(void);
bool test_numeric_roundtrip(void);
bool test_boolean_roundtrip(void);
bool test_string_roundtrip(void);
- In
RoundTrip.c:55
:
bool test_simple_roundtrip(void);
bool test_numeric_roundtrip(void);
bool test_boolean_roundtrip(void);
bool test_string_roundtrip(void);
bool test_array_roundtrip(void);
- In
RoundTrip.c:56
:
bool test_numeric_roundtrip(void);
bool test_boolean_roundtrip(void);
bool test_string_roundtrip(void);
bool test_array_roundtrip(void);
bool test_nested_object_roundtrip(void);
- In
RoundTrip.c:57
:
bool test_boolean_roundtrip(void);
bool test_string_roundtrip(void);
bool test_array_roundtrip(void);
bool test_nested_object_roundtrip(void);
bool test_complex_data_roundtrip(void);
- In
RoundTrip.c:58
:
bool test_string_roundtrip(void);
bool test_array_roundtrip(void);
bool test_nested_object_roundtrip(void);
bool test_complex_data_roundtrip(void);
bool test_empty_containers_roundtrip(void);
- In
RoundTrip.c:59
:
bool test_array_roundtrip(void);
bool test_nested_object_roundtrip(void);
bool test_complex_data_roundtrip(void);
bool test_empty_containers_roundtrip(void);
bool test_edge_cases_roundtrip(void);
- In
RoundTrip.c:60
:
bool test_nested_object_roundtrip(void);
bool test_complex_data_roundtrip(void);
bool test_empty_containers_roundtrip(void);
bool test_edge_cases_roundtrip(void);
- In
RoundTrip.c:61
:
bool test_complex_data_roundtrip(void);
bool test_empty_containers_roundtrip(void);
bool test_edge_cases_roundtrip(void);
// Helper function to compare persons
- In
RoundTrip.c:64
:
// Helper function to compare persons
bool compare_persons(const TestPerson* a, const TestPerson* b) {
return a->id == b->id && StrCmp(&a->name, &b->name) == 0 && a->age == b->age && a->is_active == b->is_active &&
a->salary == b->salary;
- In
RoundTrip.c:70
:
// Helper function to compare configs
bool compare_configs(const TestConfig* a, const TestConfig* b) {
if (a->debug_mode != b->debug_mode || a->timeout != b->timeout || StrCmp(&a->log_level, &b->log_level) != 0 ||
VecLen(&a->features) != VecLen(&b->features)) {
- In
RoundTrip.c:85
:
// Test 1: Simple value round-trip
bool test_simple_roundtrip(void) {
printf("Testing simple value round-trip\n");
- In
RoundTrip.c:88
:
printf("Testing simple value round-trip\n");
bool success = true;
// Original data
- In
RoundTrip.c:94
:
i32 count;
f64 temperature;
bool enabled;
Str message;
} original = {42, 25.5, true, StrInitFromZstr("hello world")};
- In
RoundTrip.c:113
:
i32 count;
f64 temperature;
bool enabled;
Str message;
} parsed = {0, 0.0, false, StrInit()};
- In
RoundTrip.c:155
:
// Test 2: Numeric precision round-trip
bool test_numeric_roundtrip(void) {
printf("Testing numeric precision round-trip\n");
- In
RoundTrip.c:158
:
printf("Testing numeric precision round-trip\n");
bool success = true;
// Original data with various numeric edge cases
- In
RoundTrip.c:204
:
// Compare values (allowing small float precision differences)
bool ints_match =
(original.big_int == parsed.big_int && original.negative_int == parsed.negative_int &&
original.zero_int == parsed.zero_int);
- In
RoundTrip.c:208
:
original.zero_int == parsed.zero_int);
bool floats_match =
(fabs(original.precise_float - parsed.precise_float) < 0.000001 &&
fabs(original.small_float - parsed.small_float) < 0.0000001 &&
- In
RoundTrip.c:227
:
// Test 3: Boolean round-trip
bool test_boolean_roundtrip(void) {
printf("Testing boolean round-trip\n");
- In
RoundTrip.c:230
:
printf("Testing boolean round-trip\n");
bool success = true;
// Original data
- In
RoundTrip.c:234
:
// Original data
struct {
bool flag1;
bool flag2;
bool flag3;
- In
RoundTrip.c:235
:
struct {
bool flag1;
bool flag2;
bool flag3;
bool flag4;
- In
RoundTrip.c:236
:
bool flag1;
bool flag2;
bool flag3;
bool flag4;
} original = {true, false, true, false};
- In
RoundTrip.c:237
:
bool flag2;
bool flag3;
bool flag4;
} original = {true, false, true, false};
- In
RoundTrip.c:251
:
// Read back from JSON
struct {
bool flag1;
bool flag2;
bool flag3;
- In
RoundTrip.c:252
:
struct {
bool flag1;
bool flag2;
bool flag3;
bool flag4;
- In
RoundTrip.c:253
:
bool flag1;
bool flag2;
bool flag3;
bool flag4;
} parsed = {false, true, false, true}; // Initialize with opposite values
- In
RoundTrip.c:254
:
bool flag2;
bool flag3;
bool flag4;
} parsed = {false, true, false, true}; // Initialize with opposite values
- In
RoundTrip.c:279
:
// Test 4: String round-trip
bool test_string_roundtrip(void) {
printf("Testing string round-trip\n");
- In
RoundTrip.c:282
:
printf("Testing string round-trip\n");
bool success = true;
// Original data with various string types
- In
RoundTrip.c:346
:
// Test 5: Array round-trip
bool test_array_roundtrip(void) {
printf("Testing array round-trip\n");
- In
RoundTrip.c:349
:
printf("Testing array round-trip\n");
bool success = true;
// Original data
- In
RoundTrip.c:398
:
// Compare arrays
bool numbers_match = (VecLen(&original_numbers) == VecLen(&parsed_numbers));
if (numbers_match) {
for (size i = 0; i < VecLen(&original_numbers); i++) {
- In
RoundTrip.c:408
:
}
bool strings_match = (VecLen(&original_strings) == VecLen(&parsed_strings));
if (strings_match) {
for (size i = 0; i < VecLen(&original_strings); i++) {
- In
RoundTrip.c:449
:
// Test 6: Nested object round-trip
bool test_nested_object_roundtrip(void) {
printf("Testing nested object round-trip\n");
- In
RoundTrip.c:452
:
printf("Testing nested object round-trip\n");
bool success = true;
// Original data
- In
RoundTrip.c:499
:
// Test 7: Complex data round-trip
bool test_complex_data_roundtrip(void) {
printf("Testing complex data round-trip\n");
- In
RoundTrip.c:502
:
printf("Testing complex data round-trip\n");
bool success = true;
// Create complex original data
- In
RoundTrip.c:531
:
original.flags = VecInitT(original.flags);
bool bools[3] = {true, false, true};
for (size i = 0; i < 3; i++) {
VecPushBack(&original.flags, bools[i]);
- In
RoundTrip.c:593
:
});
JR_ARR_KV(si, "flags", {
bool flag = false;
JR_BOOL(si, flag);
VecPushBack(&parsed.flags, flag);
- In
RoundTrip.c:600
:
// Compare complex data
bool user_match = compare_persons(&original.user, &parsed.user);
bool config_match = compare_configs(&original.config, &parsed.config);
- In
RoundTrip.c:601
:
// Compare complex data
bool user_match = compare_persons(&original.user, &parsed.user);
bool config_match = compare_configs(&original.config, &parsed.config);
bool numbers_match = (VecLen(&original.numbers) == VecLen(&parsed.numbers));
- In
RoundTrip.c:603
:
bool config_match = compare_configs(&original.config, &parsed.config);
bool numbers_match = (VecLen(&original.numbers) == VecLen(&parsed.numbers));
if (numbers_match) {
for (size i = 0; i < VecLen(&original.numbers); i++) {
- In
RoundTrip.c:613
:
}
bool flags_match = (VecLen(&original.flags) == VecLen(&parsed.flags));
if (flags_match) {
for (size i = 0; i < VecLen(&original.flags); i++) {
- In
RoundTrip.c:642
:
// Test 8: Empty containers round-trip
bool test_empty_containers_roundtrip(void) {
printf("Testing empty containers round-trip\n");
- In
RoundTrip.c:645
:
printf("Testing empty containers round-trip\n");
bool success = true;
// Original empty data
- In
RoundTrip.c:671
:
Vec(Str) parsed_strings = VecInitWithDeepCopy(NULL, StrDeinit);
Str parsed_str = StrInit();
bool found_empty_object = false;
StrIter si = StrIterFromStr(json);
- In
RoundTrip.c:717
:
// Test 9: Edge cases round-trip
bool test_edge_cases_roundtrip(void) {
printf("Testing edge cases round-trip\n");
- In
RoundTrip.c:720
:
printf("Testing edge cases round-trip\n");
bool success = true;
// Edge case data
- In
RoundTrip.c:728
:
i64 zero;
f64 zero_float;
bool true_val;
bool false_val;
} original = {2147483647LL, -2147483648LL, 0, 0.0, true, false};
- In
RoundTrip.c:729
:
f64 zero_float;
bool true_val;
bool false_val;
} original = {2147483647LL, -2147483648LL, 0, 0.0, true, false};
- In
RoundTrip.c:749
:
i64 zero;
f64 zero_float;
bool true_val;
bool false_val;
} parsed = {0, 0, 999, 999.0, false, true}; // Initialize with different values
- In
RoundTrip.c:750
:
f64 zero_float;
bool true_val;
bool false_val;
} parsed = {0, 0, 999, 999.0, false, true}; // Initialize with different values
- In
Read.Nested.c:21
:
Str function_name;
Str sha256;
bool debug;
Str function_mangled_name;
} AnnSymbol;
- In
Read.Nested.c:28
:
typedef struct ApiResponse {
bool status;
Str message;
AnnSymbols data;
- In
Read.Nested.c:90
:
// Function prototypes
bool test_basic_iterator_functionality(void);
bool test_simple_json_object(void);
bool test_two_level_nesting(void);
- In
Read.Nested.c:91
:
// Function prototypes
bool test_basic_iterator_functionality(void);
bool test_simple_json_object(void);
bool test_two_level_nesting(void);
bool test_three_level_nesting(void);
- In
Read.Nested.c:92
:
bool test_basic_iterator_functionality(void);
bool test_simple_json_object(void);
bool test_two_level_nesting(void);
bool test_three_level_nesting(void);
bool test_dynamic_key_parsing(void);
- In
Read.Nested.c:93
:
bool test_simple_json_object(void);
bool test_two_level_nesting(void);
bool test_three_level_nesting(void);
bool test_dynamic_key_parsing(void);
bool test_complex_api_response(void);
- In
Read.Nested.c:94
:
bool test_two_level_nesting(void);
bool test_three_level_nesting(void);
bool test_dynamic_key_parsing(void);
bool test_complex_api_response(void);
bool test_function_info_parsing(void);
- In
Read.Nested.c:95
:
bool test_three_level_nesting(void);
bool test_dynamic_key_parsing(void);
bool test_complex_api_response(void);
bool test_function_info_parsing(void);
bool test_model_info_parsing(void);
- In
Read.Nested.c:96
:
bool test_dynamic_key_parsing(void);
bool test_complex_api_response(void);
bool test_function_info_parsing(void);
bool test_model_info_parsing(void);
bool test_search_results_with_tags(void);
- In
Read.Nested.c:97
:
bool test_complex_api_response(void);
bool test_function_info_parsing(void);
bool test_model_info_parsing(void);
bool test_search_results_with_tags(void);
bool test_conditional_parsing(void);
- In
Read.Nested.c:98
:
bool test_function_info_parsing(void);
bool test_model_info_parsing(void);
bool test_search_results_with_tags(void);
bool test_conditional_parsing(void);
bool test_status_response_pattern(void);
- In
Read.Nested.c:99
:
bool test_model_info_parsing(void);
bool test_search_results_with_tags(void);
bool test_conditional_parsing(void);
bool test_status_response_pattern(void);
bool test_search_results_with_tags(void);
bool test_conditional_parsing(void);
bool test_status_response_pattern(void);
// Test basic iterator functionality
// Test basic iterator functionality
bool test_basic_iterator_functionality(void) {
printf("Testing basic iterator functionality\n");
StrIter si = StrIterFromStr(json);
bool success = true;
if (!StrIterRemainingLength(&si)) {
// Test simple JSON object (1 level)
bool test_simple_json_object(void) {
printf("Testing simple JSON object (1 level)\n");
printf("Testing simple JSON object (1 level)\n");
bool success = true;
Str json = StrInitFromZstr("{\"id\": 12345, \"name\": \"test\", \"active\": true, \"score\": 98.5}");
StrIter si = StrIterFromStr(json);
u64 id;
Str name;
bool active;
f64 score;
} data = {0, StrInit(), false, 0.0};
// Test two-level nesting
bool test_two_level_nesting(void) {
printf("Testing two-level nesting\n");
printf("Testing two-level nesting\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"user\": {\"id\": 123, \"profile\": {\"name\": \"Alice\", \"age\": 30}}, \"status\": \"active\"}"
// Test three-level nesting
bool test_three_level_nesting(void) {
printf("Testing three-level nesting\n");
printf("Testing three-level nesting\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"company\": {\"departments\": {\"engineering\": {\"head\": \"John\", \"count\": 25, \"budget\": 150000.0}}, "
// Test dynamic key parsing (like your example) - Fixed initialization
bool test_dynamic_key_parsing(void) {
printf("Testing dynamic key parsing\n");
printf("Testing dynamic key parsing\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"functions\": {\"12345\": {\"67890\": {\"distance\": 0.85, \"name\": \"main\"}}, \"54321\": {\"98765\": "
// Test complex API response similar to your example - Fixed initialization
bool test_complex_api_response(void) {
printf("Testing complex API response structure\n");
printf("Testing complex API response structure\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"status\": true, \"message\": \"Success\", \"data\": {\"12345\": {\"67890\": {\"distance\": 0.85, "
// Test function info parsing
bool test_function_info_parsing(void) {
printf("Testing function info parsing\n");
printf("Testing function info parsing\n");
bool success = true;
Str json = StrInitFromZstr("{\"id\": 12345, \"name\": \"test_func\", \"size\": 1024, \"vaddr\": 4096}");
StrIter si = StrIterFromStr(json);
// Test model info parsing
bool test_model_info_parsing(void) {
printf("Testing model info parsing\n");
printf("Testing model info parsing\n");
bool success = true;
Str json = StrInitFromZstr("{\"id\": 54321, \"name\": \"test_model\"}");
StrIter si = StrIterFromStr(json);
// Test search results with tags - Fixed implementation
bool test_search_results_with_tags(void) {
printf("Testing search results with tags\n");
printf("Testing search results with tags\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"binary_id\": 888, \"binary_name\": \"test_binary\", \"analysis_id\": 999, \"sha256\": \"abc123\", "
// Test conditional parsing
bool test_conditional_parsing(void) {
printf("Testing conditional parsing\n");
printf("Testing conditional parsing\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"status\": true, \"message\": \"Success\", \"data\": {\"12345\": {\"67890\": {\"distance\": 0.85, "
// Test status response pattern
bool test_status_response_pattern(void) {
printf("Testing status response pattern\n");
printf("Testing status response pattern\n");
bool success = true;
Str json = StrInitFromZstr(
"{\"status\": true, \"message\": \"Success\", \"data\": {\"12345\": {\"67890\": {\"distance\": 0.85, "
- In
Str.Type.c:11
:
// Function prototypes
bool test_str_type(void);
bool test_strs_type(void);
bool test_validate_str(void);
- In
Str.Type.c:12
:
// Function prototypes
bool test_str_type(void);
bool test_strs_type(void);
bool test_validate_str(void);
bool test_validate_strs(void);
- In
Str.Type.c:13
:
bool test_str_type(void);
bool test_strs_type(void);
bool test_validate_str(void);
bool test_validate_strs(void);
- In
Str.Type.c:14
:
bool test_strs_type(void);
bool test_validate_str(void);
bool test_validate_strs(void);
// Deadend test prototypes (tests that should crash/abort)
- In
Str.Type.c:17
:
// Deadend test prototypes (tests that should crash/abort)
bool test_validate_invalid_str(void);
bool test_validate_invalid_strs(void);
- In
Str.Type.c:18
:
// Deadend test prototypes (tests that should crash/abort)
bool test_validate_invalid_str(void);
bool test_validate_invalid_strs(void);
// Test Str type definition
- In
Str.Type.c:21
:
// Test Str type definition
bool test_str_type(void) {
printf("Testing Str type definition\n");
- In
Str.Type.c:34
:
StrPushBack(&s, 'o');
bool result = (s.length == 5 && ZstrCompare(s.data, "Hello") == 0);
StrDeinit(&s);
- In
Str.Type.c:41
:
// Test Strs type definition
bool test_strs_type(void) {
printf("Testing Strs type definition\n");
- In
Str.Type.c:55
:
// Check that it behaves like a Vec of Str objects
bool result = (sv.length == 2);
// Check the content of the strings
- In
Str.Type.c:71
:
// Test ValidateStr macro
bool test_validate_str(void) {
printf("Testing ValidateStr macro\n");
- In
Str.Type.c:84
:
// framework, we would use something like a death test for this.
bool result = true; // If we got here, the validation didn't crash
StrDeinit(&s);
- In
Str.Type.c:91
:
// Test ValidateStrs macro
bool test_validate_strs(void) {
printf("Testing ValidateStrs macro\n");
- In
Str.Type.c:103
:
// will abort the program if the object is invalid.
bool result = true; // If we got here, the validation didn't crash
VecDeinit(&sv);
- In
Str.Type.c:110
:
// Deadend test: Test ValidateStr with invalid string (should crash/abort)
bool test_validate_invalid_str(void) {
printf("Testing ValidateStr with invalid string (should abort)\n");
- In
Str.Type.c:129
:
// Deadend test: Test ValidateStrs with invalid Strs (should crash/abort)
bool test_validate_invalid_strs(void) {
printf("Testing ValidateStrs with invalid Strs (should abort)\n");
- In
Str.Convert.c:12
:
// Function prototypes
bool test_str_from_u64(void);
bool test_str_from_i64(void);
bool test_str_from_f64(void);
- In
Str.Convert.c:13
:
// Function prototypes
bool test_str_from_u64(void);
bool test_str_from_i64(void);
bool test_str_from_f64(void);
bool test_str_to_u64(void);
- In
Str.Convert.c:14
:
bool test_str_from_u64(void);
bool test_str_from_i64(void);
bool test_str_from_f64(void);
bool test_str_to_u64(void);
bool test_str_to_i64(void);
- In
Str.Convert.c:15
:
bool test_str_from_i64(void);
bool test_str_from_f64(void);
bool test_str_to_u64(void);
bool test_str_to_i64(void);
bool test_str_to_f64(void);
- In
Str.Convert.c:16
:
bool test_str_from_f64(void);
bool test_str_to_u64(void);
bool test_str_to_i64(void);
bool test_str_to_f64(void);
bool test_str_round_trip_conversions(void);
- In
Str.Convert.c:17
:
bool test_str_to_u64(void);
bool test_str_to_i64(void);
bool test_str_to_f64(void);
bool test_str_round_trip_conversions(void);
bool test_str_edge_case_conversions(void);
- In
Str.Convert.c:18
:
bool test_str_to_i64(void);
bool test_str_to_f64(void);
bool test_str_round_trip_conversions(void);
bool test_str_edge_case_conversions(void);
bool test_str_precision_limits(void);
- In
Str.Convert.c:19
:
bool test_str_to_f64(void);
bool test_str_round_trip_conversions(void);
bool test_str_edge_case_conversions(void);
bool test_str_precision_limits(void);
bool test_str_all_base_support(void);
- In
Str.Convert.c:20
:
bool test_str_round_trip_conversions(void);
bool test_str_edge_case_conversions(void);
bool test_str_precision_limits(void);
bool test_str_all_base_support(void);
bool test_str_large_scale_conversions(void);
- In
Str.Convert.c:21
:
bool test_str_edge_case_conversions(void);
bool test_str_precision_limits(void);
bool test_str_all_base_support(void);
bool test_str_large_scale_conversions(void);
bool test_str_conversion_null_failures(void);
- In
Str.Convert.c:22
:
bool test_str_precision_limits(void);
bool test_str_all_base_support(void);
bool test_str_large_scale_conversions(void);
bool test_str_conversion_null_failures(void);
bool test_str_conversion_bounds_failures(void);
- In
Str.Convert.c:23
:
bool test_str_all_base_support(void);
bool test_str_large_scale_conversions(void);
bool test_str_conversion_null_failures(void);
bool test_str_conversion_bounds_failures(void);
bool test_str_conversion_invalid_input_failures(void);
- In
Str.Convert.c:24
:
bool test_str_large_scale_conversions(void);
bool test_str_conversion_null_failures(void);
bool test_str_conversion_bounds_failures(void);
bool test_str_conversion_invalid_input_failures(void);
- In
Str.Convert.c:25
:
bool test_str_conversion_null_failures(void);
bool test_str_conversion_bounds_failures(void);
bool test_str_conversion_invalid_input_failures(void);
// Test StrFromU64 function
- In
Str.Convert.c:28
:
// Test StrFromU64 function
bool test_str_from_u64(void) {
printf("Testing StrFromU64\n");
- In
Str.Convert.c:36
:
StrIntFormat config = {.base = 10, .uppercase = false};
StrFromU64(&s, 12345, &config);
bool result = (ZstrCompare(s.data, "12345") == 0);
if (!result) {
printf(" FAIL: Expected '12345', got '%s'\n", s.data);
- In
Str.Convert.c:91
:
// Test StrFromI64 function
bool test_str_from_i64(void) {
printf("Testing StrFromI64\n");
- In
Str.Convert.c:99
:
StrIntFormat config = {.base = 10, .uppercase = false};
StrFromI64(&s, 12345, &config);
bool result = (ZstrCompare(s.data, "12345") == 0);
if (!result) {
printf(" FAIL: Expected '12345', got '%s'\n", s.data);
// Test StrFromF64 function
bool test_str_from_f64(void) {
printf("Testing StrFromF64\n");
StrFloatFormat config = {.precision = 2, .force_sci = false, .uppercase = false};
StrFromF64(&s, 123.0, &config);
bool result = (ZstrCompare(s.data, "123.00") == 0);
if (!result) {
printf(" FAIL: Expected '123.00', got '%s'\n", s.data);
// Test StrToU64 function
bool test_str_to_u64(void) {
printf("Testing StrToU64\n");
Str s = StrInitFromZstr("12345");
u64 value = 0;
bool success = StrToU64(&s, &value, NULL);
bool result = (success && value == 12345);
u64 value = 0;
bool success = StrToU64(&s, &value, NULL);
bool result = (success && value == 12345);
// Test hexadecimal conversion with explicit base
// Test StrToI64 function
bool test_str_to_i64(void) {
printf("Testing StrToI64\n");
Str s = StrInitFromZstr("12345");
i64 value = 0;
bool success = StrToI64(&s, &value, NULL);
bool result = (success && value == 12345);
i64 value = 0;
bool success = StrToI64(&s, &value, NULL);
bool result = (success && value == 12345);
// Test negative decimal conversion
// Test StrToF64 function
bool test_str_to_f64(void) {
printf("Testing StrToF64\n");
Str s = StrInitFromZstr("123");
f64 value = 0.0;
bool success = StrToF64(&s, &value, NULL);
bool result = (success && fabs(value - 123.0) < 0.0001);
f64 value = 0.0;
bool success = StrToF64(&s, &value, NULL);
bool result = (success && fabs(value - 123.0) < 0.0001);
// Test fractional conversion
// Round-trip conversion tests
bool test_str_round_trip_conversions(void) {
printf("Testing Str round-trip conversions\n");
printf("Testing Str round-trip conversions\n");
bool result = true;
// Test integer round-trips
StrFromU64(&s, u64_values[i], &config);
u64 recovered_u64 = 0;
bool success = StrToU64(&s, &recovered_u64, NULL);
result = result && success && (recovered_u64 == u64_values[i]);
StrFromI64(&s, i64_values[i], &config);
i64 recovered_i64 = 0;
bool success = StrToI64(&s, &recovered_i64, NULL);
result = result && success && (recovered_i64 == i64_values[i]);
StrFromF64(&s, f64_values[i], &config);
f64 recovered_f64 = 0.0;
bool success = StrToF64(&s, &recovered_f64, NULL);
// Allow for precision loss
// Edge case conversion tests
bool test_str_edge_case_conversions(void) {
printf("Testing Str edge case conversions\n");
printf("Testing Str edge case conversions\n");
bool result = true;
// Test base boundary conditions
// For bases with prefixes, use auto-detect. For others, use explicit base parsing
StrParseConfig parse_config = {.base = base};
bool success = StrToU64(&s, &recovered, config.use_prefix ? NULL : &parse_config);
result = result && success && (recovered == base);
StrFromU64(&s, UINT64_MAX, &config);
u64 recovered_max = 0;
bool success = StrToU64(&s, &recovered_max, NULL);
result = result && success && (recovered_max == UINT64_MAX);
u64 value = 0;
StrParseConfig config = {.base = prefix_tests[i].base};
bool success = StrToU64(&test_str, &value, prefix_tests[i].base == 0 ? NULL : &config);
result = result && success && (value == prefix_tests[i].expected);
StrDeinit(&test_str);
// Precision limits testing
bool test_str_precision_limits(void) {
printf("Testing Str precision limits\n");
printf("Testing Str precision limits\n");
bool result = true;
// Test floating point precision boundaries
StrFloatFormat config = {.precision = 3, .force_sci = true, .uppercase = false};
StrFromF64(&s, sci_values[i], &config);
bool has_e = (strchr(s.data, 'e') != NULL);
result = result && has_e;
config = (StrFloatFormat) {.precision = 3, .force_sci = true, .uppercase = true};
StrFromF64(&s, sci_values[i], &config);
bool has_E = (strchr(s.data, 'E') != NULL);
result = result && has_E;
u64 recovered = 0;
StrParseConfig pconfig = {.base = base};
bool success = StrToU64(&s, &recovered, &pconfig); // Can now use explicit base with prefixes
result = result && success && (recovered == large_value);
// Large-scale conversion tests
bool test_str_all_base_support(void) {
printf("Testing Str all bases 2-36 support\n");
printf("Testing Str all bases 2-36 support\n");
bool result = true;
// Test value to convert across all bases
u64 recovered = 0;
StrParseConfig parse_config = {.base = base};
bool success = StrToU64(&s, &recovered, &parse_config);
result = result && success && (recovered == test_value);
u64 recovered = 0;
StrParseConfig parse_config = {.base = base};
bool success = StrToU64(&s, &recovered, &parse_config);
result = result && success && (recovered == test_value);
u64 recovered = 0;
StrParseConfig parse_config = {.base = base};
bool success = StrToU64(&s, &recovered, &parse_config);
result = result && success && (recovered == test_values[i]);
}
bool test_str_large_scale_conversions(void) {
printf("Testing Str large-scale conversions\n");
printf("Testing Str large-scale conversions\n");
bool result = true;
// Test many values for consistency
u64 recovered = 0;
bool success = StrToU64(&s, &recovered, NULL);
result = result && success && (recovered == test_value);
f64 recovered = 0.0;
bool success = StrToF64(&s, &recovered, NULL);
// Allow for floating point precision issues
Str long_str = StrInitFromZstr(long_number);
u64 long_value = 0;
bool success = StrToU64(&long_str, &long_value, NULL);
// This might overflow, but should handle gracefully
result = result && (success || !success); // Either succeeds or fails gracefully
// Deadend tests for NULL pointer handling
bool test_str_conversion_null_failures(void) {
printf("Testing Str conversion NULL pointer handling\n");
}
bool test_str_conversion_bounds_failures(void) {
printf("Testing Str conversion bounds failures\n");
}
bool test_str_conversion_invalid_input_failures(void) {
printf("Testing Str conversion invalid input failures\n");
// Function prototypes
bool test_bitvec_foreach_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
// Function prototypes
bool test_bitvec_foreach_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_invalid_usage(void);
// BitVecRunLengths test prototypes
// BitVecRunLengths test prototypes
bool test_bitvec_run_lengths_basic(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
// BitVecRunLengths test prototypes
bool test_bitvec_run_lengths_basic(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_basic(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
// Test BitVecForeachIdx macro
bool test_bitvec_foreach_idx(void) {
printf("Testing BitVecForeachIdx macro\n");
// Test forward iteration with index
u64 count = 0;
bool pattern_correct = true;
BitVecForeachIdx(&bv, bit, idx, {
});
bool result = (count == 4) && pattern_correct;
// Clean up
// Test BitVecForeach macro
bool test_bitvec_foreach(void) {
printf("Testing BitVecForeach macro\n");
});
bool result = (true_count == 2) && (false_count == 1);
// Clean up
// Test BitVecForeachReverseIdx macro
bool test_bitvec_foreach_reverse_idx(void) {
printf("Testing BitVecForeachReverseIdx macro\n");
// Test reverse iteration with index
u64 count = 0;
bool first_bit_is_false = false; // Should be last bit when iterating in reverse
BitVecForeachReverseIdx(&bv, bit, idx, {
});
bool result = (count == 4) && first_bit_is_false;
// Clean up
// Test BitVecForeachReverse macro
bool test_bitvec_foreach_reverse(void) {
printf("Testing BitVecForeachReverse macro\n");
// Test reverse iteration
u64 count = 0;
bool first_is_true = false; // Should be the last bit (true)
BitVecForeachReverse(&bv, bit, {
});
bool result = (count == 3) && first_is_true;
// Clean up
// Test BitVecForeachInRangeIdx macro
bool test_bitvec_foreach_in_range_idx(void) {
printf("Testing BitVecForeachInRangeIdx macro\n");
// Test range iteration from index 1 to 4 (exclusive)
u64 count = 0;
bool range_correct = true;
BitVecForeachInRangeIdx(&bv, bit, idx, 1, 4, {
});
bool result = (count == 3) && range_correct;
// Clean up
// Test BitVecForeachInRange macro
bool test_bitvec_foreach_in_range(void) {
printf("Testing BitVecForeachInRange macro\n");
});
bool result = (true_count == 2) && (false_count == 0);
// Clean up
// Edge case tests
bool test_bitvec_foreach_edge_cases(void) {
printf("Testing BitVec foreach edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
int count = 0;
}
bool test_bitvec_foreach_idx_edge_cases(void) {
printf("Testing BitVec foreach idx edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
u64 last_idx = SIZE_MAX;
}
bool test_bitvec_foreach_reverse_edge_cases(void) {
printf("Testing BitVec foreach reverse edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test reverse foreach on empty bitvec
BitVecPush(&bv, true); // idx 2
bool expected_sequence[] = {true, false, true}; // Reverse order
int seq_idx = 0;
BitVecForeachReverse(&bv, bit, {
}
bool test_bitvec_foreach_range_edge_cases(void) {
printf("Testing BitVec foreach range edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Setup test data
}
bool test_bitvec_foreach_stress_test(void) {
printf("Testing BitVec foreach stress test\n");
printf("Testing BitVec foreach stress test\n");
bool result = true;
for (int sz = 0; sz < 100; sz += 10) {
// BitVecRunLengths test implementations
bool test_bitvec_run_lengths_basic(void) {
printf("Testing BitVecRunLengths basic functionality\n");
BitVec bv = BitVecInit();
bool result = true;
// Test pattern: 11100101 (3 true, 2 false, 1 true, 1 false, 1 true)
u64 runs[10];
bool values[10];
u64 count = BitVecRunLengths(&bv, runs, values, 10);
}
bool test_bitvec_run_lengths_edge_cases(void) {
printf("Testing BitVecRunLengths edge cases\n");
printf("Testing BitVecRunLengths edge cases\n");
bool result = true;
// Test 1: Empty bitvector
BitVec empty_bv = BitVecInit();
u64 runs[5];
bool values[5];
u64 count = BitVecRunLengths(&empty_bv, runs, values, 5);
result = result && (count == 0);
}
u64 alt_runs[10];
bool alt_values[10];
count = BitVecRunLengths(&alternating_bv, alt_runs, alt_values, 10);
result = result && (count == 7); // Each bit is its own run
}
bool test_bitvec_run_lengths_boundary_conditions(void) {
printf("Testing BitVecRunLengths boundary conditions\n");
BitVec bv = BitVecInit();
bool result = true;
// Create pattern with many runs: 10101010 (8 runs)
// Test with limited max_runs
u64 runs[3];
bool values[3];
u64 count = BitVecRunLengths(&bv, runs, values, 3);
// Test with exact number of runs needed
u64 large_runs[8];
bool large_values[8];
count = BitVecRunLengths(&bv, large_runs, large_values, 8);
result = result && (count == 8);
}
bool test_bitvec_run_lengths_stress_test(void) {
printf("Testing BitVecRunLengths stress test\n");
printf("Testing BitVecRunLengths stress test\n");
bool result = true;
// Test with large bitvector
// Pattern: blocks of 5 same bits, alternating true/false
for (int block = 0; block < 100; block++) {
bool value = (block % 2 == 0);
for (int i = 0; i < 5; i++) {
BitVecPush(&large_bv, value);
u64 runs[200];
bool values[200];
u64 count = BitVecRunLengths(&large_bv, runs, values, 200);
// Pattern: 1111000011100010000111 (variable length runs)
// Run 1: 4 trues, Run 2: 4 falses, Run 3: 3 trues, Run 4: 3 falses, Run 5: 1 true, Run 6: 4 falses, Run 7: 3 trues
bool pattern[] = {1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1};
int pattern_len = sizeof(pattern) / sizeof(pattern[0]);
u64 small_runs[10];
bool small_values[10];
count = BitVecRunLengths(&large_bv, small_runs, small_values, 10);
// Deadend tests for BitVecRunLengths
bool test_bitvec_run_lengths_null_bv(void) {
printf("Testing BitVecRunLengths with NULL bitvector\n");
u64 runs[5];
bool values[5];
// This should cause LOG_FATAL and terminate the program
}
bool test_bitvec_run_lengths_null_runs(void) {
printf("Testing BitVecRunLengths with NULL runs array\n");
BitVec bv = BitVecInit();
BitVecPush(&bv, true);
bool values[5];
// This should cause LOG_FATAL and terminate the program
}
bool test_bitvec_run_lengths_null_values(void) {
printf("Testing BitVecRunLengths with NULL values array\n");
}
bool test_bitvec_run_lengths_zero_max_runs(void) {
printf("Testing BitVecRunLengths with zero max_runs\n");
BitVecPush(&bv, true);
u64 runs[5];
bool values[5];
// This should cause LOG_FATAL and terminate the program
// with invalid macro usage scenarios
bool test_bitvec_foreach_invalid_usage(void) {
printf("Testing BitVec foreach with invalid bitvec\n");
// Function prototypes
bool test_vec_foreach(void);
bool test_vec_foreach_idx(void);
bool test_vec_foreach_ptr(void);
// Function prototypes
bool test_vec_foreach(void);
bool test_vec_foreach_idx(void);
bool test_vec_foreach_ptr(void);
bool test_vec_foreach_ptr_idx(void);
bool test_vec_foreach(void);
bool test_vec_foreach_idx(void);
bool test_vec_foreach_ptr(void);
bool test_vec_foreach_ptr_idx(void);
bool test_vec_foreach_reverse(void);
bool test_vec_foreach_idx(void);
bool test_vec_foreach_ptr(void);
bool test_vec_foreach_ptr_idx(void);
bool test_vec_foreach_reverse(void);
bool test_vec_foreach_reverse_idx(void);
bool test_vec_foreach_ptr(void);
bool test_vec_foreach_ptr_idx(void);
bool test_vec_foreach_reverse(void);
bool test_vec_foreach_reverse_idx(void);
bool test_vec_foreach_ptr_reverse(void);
bool test_vec_foreach_ptr_idx(void);
bool test_vec_foreach_reverse(void);
bool test_vec_foreach_reverse_idx(void);
bool test_vec_foreach_ptr_reverse(void);
bool test_vec_foreach_ptr_reverse_idx(void);
bool test_vec_foreach_reverse(void);
bool test_vec_foreach_reverse_idx(void);
bool test_vec_foreach_ptr_reverse(void);
bool test_vec_foreach_ptr_reverse_idx(void);
bool test_vec_foreach_reverse_idx(void);
bool test_vec_foreach_ptr_reverse(void);
bool test_vec_foreach_ptr_reverse_idx(void);
// Test VecForeach macro
// Test VecForeach macro
bool test_vec_foreach(void) {
printf("Testing VecForeach\n");
// Check the sum
bool result = (sum == 150); // 10 + 20 + 30 + 40 + 50 = 150
// Use VecForeach to double each value
// Test VecForeachIdx macro
bool test_vec_foreach_idx(void) {
printf("Testing VecForeachIdx\n");
// Use VecForeachIdx to verify indices and values
bool result = true;
VecForeachIdx(&vec, item, idx, { result = result && (item == values[idx]); });
// Test VecForeachPtr macro
bool test_vec_foreach_ptr(void) {
printf("Testing VecForeachPtr\n");
// Check that the values in the vector are doubled
bool result = true;
for (size i = 0; i < vec.length; i++) {
result = result && (VecAt(&vec, i) == values[i] * 2);
// Test VecForeachPtrIdx macro
bool test_vec_foreach_ptr_idx(void) {
printf("Testing VecForeachPtrIdx\n");
// Check that the values in the vector are set to their indices
bool result = true;
for (size i = 0; i < vec.length; i++) {
result = result && (VecAt(&vec, i) == i);
// Test VecForeachReverse macro
bool test_vec_foreach_reverse(void) {
printf("Testing VecForeachReverse\n");
// Check that the reversed array is correct
bool result = true;
for (int i = 0; i < 5; i++) {
result = result && (reversed[i] == values[4 - i]);
// Test VecForeachReverseIdx macro
bool test_vec_foreach_reverse_idx(void) {
printf("Testing VecForeachReverseIdx\n");
// Use VecForeachReverseIdx to verify indices are correct in reverse
bool result = true;
VecForeachReverseIdx(&vec, item, idx, {
result = result && (item == values[idx]);
// Test VecForeachPtrReverse macro
bool test_vec_foreach_ptr_reverse(void) {
printf("Testing VecForeachPtrReverse\n");
// (50+1, 40+2, 30+3, 20+4, 10+5)
int expected[] = {15, 24, 33, 42, 51};
bool result = true;
for (size i = 0; i < vec.length; i++) {
result = result && (VecAt(&vec, i) == expected[i]);
// Test VecForeachPtrReverseIdx macro
bool test_vec_foreach_ptr_reverse_idx(void) {
printf("Testing VecForeachPtrReverseIdx\n");
// Final vector: [100, 101, 102, 103, 104]
int expected[] = {100, 101, 102, 103, 104};
bool result = true;
for (size i = 0; i < vec.length; i++) {
result = result && (VecAt(&vec, i) == expected[i]);
- In
Vec.Access.c:10
:
// Function prototypes
bool test_vec_at(void);
bool test_vec_ptr_at(void);
bool test_vec_first_last(void);
- In
Vec.Access.c:11
:
// Function prototypes
bool test_vec_at(void);
bool test_vec_ptr_at(void);
bool test_vec_first_last(void);
bool test_vec_begin_end(void);
- In
Vec.Access.c:12
:
bool test_vec_at(void);
bool test_vec_ptr_at(void);
bool test_vec_first_last(void);
bool test_vec_begin_end(void);
bool test_vec_size_len(void);
- In
Vec.Access.c:13
:
bool test_vec_ptr_at(void);
bool test_vec_first_last(void);
bool test_vec_begin_end(void);
bool test_vec_size_len(void);
bool test_vec_aligned_offset_at(void);
- In
Vec.Access.c:14
:
bool test_vec_first_last(void);
bool test_vec_begin_end(void);
bool test_vec_size_len(void);
bool test_vec_aligned_offset_at(void);
- In
Vec.Access.c:15
:
bool test_vec_begin_end(void);
bool test_vec_size_len(void);
bool test_vec_aligned_offset_at(void);
// Test VecAt function
- In
Vec.Access.c:18
:
// Test VecAt function
bool test_vec_at(void) {
printf("Testing VecAt\n");
- In
Vec.Access.c:33
:
// Check values using VecAt
bool result = (VecAt(&vec, 0) == 10);
result = result && (VecAt(&vec, 1) == 20);
result = result && (VecAt(&vec, 2) == 30);
- In
Vec.Access.c:50
:
// Test VecPtrAt function
bool test_vec_ptr_at(void) {
printf("Testing VecPtrAt\n");
- In
Vec.Access.c:68
:
// Check values through pointers
bool result = (*ptr0 == 10);
result = result && (*ptr1 == 20);
result = result && (*ptr2 == 30);
- In
Vec.Access.c:87
:
// Test VecFirst and VecLast functions
bool test_vec_first_last(void) {
printf("Testing VecFirst and VecLast\n");
- In
Vec.Access.c:100
:
// Check first and last elements
bool result = (VecFirst(&vec) == 10);
result = result && (VecLast(&vec) == 30);
- In
Vec.Access.c:118
:
// Test VecBegin and VecEnd functions
bool test_vec_begin_end(void) {
printf("Testing VecBegin and VecEnd\n");
- In
Vec.Access.c:135
:
// Check that begin points to the first element
bool result = (*begin == 10);
// Check that end - begin equals the size of the vector
- In
Vec.Access.c:148
:
// Test VecSize and VecLen functions
bool test_vec_size_len(void) {
printf("Testing VecSize and VecLen\n");
- In
Vec.Access.c:158
:
size vec_size = VecSize(&vec);
size vec_len = VecLen(&vec);
bool result = (vec_size == 0);
result = result && (vec_len == 0);
- In
Vec.Access.c:198
:
// Test VecAlignedOffsetAt function
bool test_vec_aligned_offset_at(void) {
printf("Testing VecAlignedOffsetAt\n");
- In
Vec.Access.c:206
:
// Check offsets
bool result = (VecAlignedOffsetAt(&vec, 0) == 0);
result = result && (VecAlignedOffsetAt(&vec, 1) == sizeof(int));
result = result && (VecAlignedOffsetAt(&vec, 2) == 2 * sizeof(int));
- In
Str.Memory.c:10
:
// Function prototypes
bool test_str_try_reduce_space(void);
bool test_str_swap_char_at(void);
bool test_str_resize(void);
- In
Str.Memory.c:11
:
// Function prototypes
bool test_str_try_reduce_space(void);
bool test_str_swap_char_at(void);
bool test_str_resize(void);
bool test_str_reserve(void);
- In
Str.Memory.c:12
:
bool test_str_try_reduce_space(void);
bool test_str_swap_char_at(void);
bool test_str_resize(void);
bool test_str_reserve(void);
bool test_str_clear(void);
- In
Str.Memory.c:13
:
bool test_str_swap_char_at(void);
bool test_str_resize(void);
bool test_str_reserve(void);
bool test_str_clear(void);
bool test_str_reverse(void);
- In
Str.Memory.c:14
:
bool test_str_resize(void);
bool test_str_reserve(void);
bool test_str_clear(void);
bool test_str_reverse(void);
- In
Str.Memory.c:15
:
bool test_str_reserve(void);
bool test_str_clear(void);
bool test_str_reverse(void);
// Test StrTryReduceSpace function
- In
Str.Memory.c:18
:
// Test StrTryReduceSpace function
bool test_str_try_reduce_space(void) {
printf("Testing StrTryReduceSpace\n");
- In
Str.Memory.c:30
:
// Original capacity should be at least 100
bool result = (s.capacity >= 100);
// Try to reduce space
- In
Str.Memory.c:43
:
// Test StrSwapCharAt function
bool test_str_swap_char_at(void) {
printf("Testing StrSwapCharAt\n");
- In
Str.Memory.c:52
:
// Check that the characters were swapped
bool result = (s.data[0] == 'o' && s.data[4] == 'H');
// Swap 'e' and 'l'
- In
Str.Memory.c:65
:
// Test StrResize function
bool test_str_resize(void) {
printf("Testing StrResize\n");
- In
Str.Memory.c:71
:
// Initial length should be 5
bool result = (s.length == 5);
// Resize to a smaller length
- In
Str.Memory.c:91
:
// Test StrReserve function
bool test_str_reserve(void) {
printf("Testing StrReserve\n");
- In
Str.Memory.c:100
:
// Capacity should now be at least 100
bool result = (s.capacity >= 100);
// Length should still be 0
- In
Str.Memory.c:116
:
// Test StrClear function
bool test_str_clear(void) {
printf("Testing StrClear\n");
- In
Str.Memory.c:122
:
// Initial length should be 13
bool result = (s.length == 13);
// Clear the string
- In
Str.Memory.c:138
:
// Test StrReverse function
bool test_str_reverse(void) {
printf("Testing StrReverse\n");
- In
Str.Memory.c:147
:
// Check that the string was reversed
bool result = (ZstrCompare(s.data, "olleH") == 0);
// Test with an even-length string
- In
BitVec.Init.c:10
:
// Function prototypes
bool test_bitvec_init(void);
bool test_bitvec_deinit(void);
bool test_bitvec_reserve(void);
- In
BitVec.Init.c:11
:
// Function prototypes
bool test_bitvec_init(void);
bool test_bitvec_deinit(void);
bool test_bitvec_reserve(void);
bool test_bitvec_clear(void);
- In
BitVec.Init.c:12
:
bool test_bitvec_init(void);
bool test_bitvec_deinit(void);
bool test_bitvec_reserve(void);
bool test_bitvec_clear(void);
bool test_bitvec_resize(void);
- In
BitVec.Init.c:13
:
bool test_bitvec_deinit(void);
bool test_bitvec_reserve(void);
bool test_bitvec_clear(void);
bool test_bitvec_resize(void);
bool test_bitvec_init_edge_cases(void);
- In
BitVec.Init.c:14
:
bool test_bitvec_reserve(void);
bool test_bitvec_clear(void);
bool test_bitvec_resize(void);
bool test_bitvec_init_edge_cases(void);
bool test_bitvec_deinit_edge_cases(void);
- In
BitVec.Init.c:15
:
bool test_bitvec_clear(void);
bool test_bitvec_resize(void);
bool test_bitvec_init_edge_cases(void);
bool test_bitvec_deinit_edge_cases(void);
bool test_bitvec_reserve_edge_cases(void);
- In
BitVec.Init.c:16
:
bool test_bitvec_resize(void);
bool test_bitvec_init_edge_cases(void);
bool test_bitvec_deinit_edge_cases(void);
bool test_bitvec_reserve_edge_cases(void);
bool test_bitvec_clear_edge_cases(void);
- In
BitVec.Init.c:17
:
bool test_bitvec_init_edge_cases(void);
bool test_bitvec_deinit_edge_cases(void);
bool test_bitvec_reserve_edge_cases(void);
bool test_bitvec_clear_edge_cases(void);
bool test_bitvec_resize_edge_cases(void);
- In
BitVec.Init.c:18
:
bool test_bitvec_deinit_edge_cases(void);
bool test_bitvec_reserve_edge_cases(void);
bool test_bitvec_clear_edge_cases(void);
bool test_bitvec_resize_edge_cases(void);
bool test_bitvec_multiple_cycles(void);
- In
BitVec.Init.c:19
:
bool test_bitvec_reserve_edge_cases(void);
bool test_bitvec_clear_edge_cases(void);
bool test_bitvec_resize_edge_cases(void);
bool test_bitvec_multiple_cycles(void);
- In
BitVec.Init.c:20
:
bool test_bitvec_clear_edge_cases(void);
bool test_bitvec_resize_edge_cases(void);
bool test_bitvec_multiple_cycles(void);
// Test BitVecInit function
- In
BitVec.Init.c:23
:
// Test BitVecInit function
bool test_bitvec_init(void) {
printf("Testing BitVecInit\n");
- In
BitVec.Init.c:30
:
// Check initial state
bool result = (bv.length == 0);
result = result && (bv.capacity == 0);
result = result && (bv.data == NULL);
- In
BitVec.Init.c:42
:
// Test BitVecDeinit function
bool test_bitvec_deinit(void) {
printf("Testing BitVecDeinit\n");
- In
BitVec.Init.c:53
:
// Check that data was allocated
bool result = (bv.length == 3) && (bv.data != NULL);
// Deinitialize
- In
BitVec.Init.c:70
:
// Test BitVecReserve function
bool test_bitvec_reserve(void) {
printf("Testing BitVecReserve\n");
- In
BitVec.Init.c:79
:
// Check that capacity was increased
bool result = (bv.capacity >= 50);
result = result && (bv.length == 0); // Length should still be 0
result = result && (bv.data != NULL); // Memory should be allocated
// Test BitVecClear function
bool test_bitvec_clear(void) {
printf("Testing BitVecClear\n");
// Check initial state
bool result = (bv.length == 4) && (bv.data != NULL);
u64 original_capacity = bv.capacity;
// Test BitVecReu64 function
bool test_bitvec_resize(void) {
printf("Testing BitVecResize\n");
// Check that length was increased and new bits have the default value
bool result = (bv.length == 6);
result = result && (BitVecGet(&bv, 0) == true); // Original data
result = result && (BitVecGet(&bv, 1) == false); // Original data
// Edge case tests - boundary conditions and unusual but valid inputs
bool test_bitvec_init_edge_cases(void) {
printf("Testing BitVecInit edge cases\n");
BitVec bv3 = BitVecInit();
bool result = (bv1.length == 0) && (bv2.length == 0) && (bv3.length == 0);
result = result && (bv1.data == NULL) && (bv2.data == NULL) && (bv3.data == NULL);
}
bool test_bitvec_reserve_edge_cases(void) {
printf("Testing BitVecReserve edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test reserving 0 (should be safe no-op)
}
bool test_bitvec_resize_edge_cases(void) {
printf("Testing BitVecReu64 edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test reu64 to 0 (should clear but keep memory)
}
bool test_bitvec_clear_edge_cases(void) {
printf("Testing BitVecClear edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test clear on empty bitvec
}
bool test_bitvec_multiple_cycles(void) {
printf("Testing BitVec multiple init/deinit cycles\n");
printf("Testing BitVec multiple init/deinit cycles\n");
bool result = true;
// Test multiple init/deinit cycles
// Deadend tests - verify expected failures occur gracefully
bool test_bitvec_null_pointer_failures(void) {
printf("Testing BitVec NULL pointer handling\n");
}
bool test_bitvec_invalid_operations(void) {
printf("Testing BitVec invalid operations\n");
}
bool test_bitvec_set_operations_failures(void) {
printf("Testing BitVec set operations on invalid indices\n");
- In
Vec.Insert.c:11
:
// Function prototypes
bool test_vec_push_back(void);
bool test_vec_push_front(void);
bool test_vec_insert(void);
- In
Vec.Insert.c:12
:
// Function prototypes
bool test_vec_push_back(void);
bool test_vec_push_front(void);
bool test_vec_insert(void);
bool test_vec_push_back_arr(void);
- In
Vec.Insert.c:13
:
bool test_vec_push_back(void);
bool test_vec_push_front(void);
bool test_vec_insert(void);
bool test_vec_push_back_arr(void);
bool test_vec_push_front_arr(void);
- In
Vec.Insert.c:14
:
bool test_vec_push_front(void);
bool test_vec_insert(void);
bool test_vec_push_back_arr(void);
bool test_vec_push_front_arr(void);
bool test_vec_push_arr(void);
- In
Vec.Insert.c:15
:
bool test_vec_insert(void);
bool test_vec_push_back_arr(void);
bool test_vec_push_front_arr(void);
bool test_vec_push_arr(void);
bool test_vec_insert_range(void);
- In
Vec.Insert.c:16
:
bool test_vec_push_back_arr(void);
bool test_vec_push_front_arr(void);
bool test_vec_push_arr(void);
bool test_vec_insert_range(void);
bool test_vec_merge(void);
- In
Vec.Insert.c:17
:
bool test_vec_push_front_arr(void);
bool test_vec_push_arr(void);
bool test_vec_insert_range(void);
bool test_vec_merge(void);
bool test_lvalue_rvalue_operations(void);
- In
Vec.Insert.c:18
:
bool test_vec_push_arr(void);
bool test_vec_insert_range(void);
bool test_vec_merge(void);
bool test_lvalue_rvalue_operations(void);
bool test_lvalue_memset_after_insertion(void);
- In
Vec.Insert.c:19
:
bool test_vec_insert_range(void);
bool test_vec_merge(void);
bool test_lvalue_rvalue_operations(void);
bool test_lvalue_memset_after_insertion(void);
- In
Vec.Insert.c:20
:
bool test_vec_merge(void);
bool test_lvalue_rvalue_operations(void);
bool test_lvalue_memset_after_insertion(void);
// Test VecPushBack function
- In
Vec.Insert.c:23
:
// Test VecPushBack function
bool test_vec_push_back(void) {
printf("Testing VecPushBack\n");
- In
Vec.Insert.c:37
:
// Check length
bool result = (vec.length == 5);
// Check elements in order
- In
Vec.Insert.c:51
:
// Test VecPushFront function
bool test_vec_push_front(void) {
printf("Testing VecPushFront\n");
- In
Vec.Insert.c:65
:
// Check length
bool result = (vec.length == 5);
// Check elements in reverse order (since we pushed to front)
- In
Vec.Insert.c:79
:
// Test VecInsert function
bool test_vec_insert(void) {
printf("Testing VecInsert\n");
- In
Vec.Insert.c:90
:
// Check first element
bool result = (vec.length == 1 && VecAt(&vec, 0) == 10);
// Insert at the end
- In
Vec.Insert.c:114
:
// Test VecPushBackArr function
bool test_vec_push_back_arr(void) {
printf("Testing VecPushBackArr\n");
- In
Vec.Insert.c:126
:
// Check length
bool result = (vec.length == 5);
// Check elements in order
- In
Vec.Insert.c:155
:
// Test VecPushFrontArr function
bool test_vec_push_front_arr(void) {
printf("Testing VecPushFrontArr\n");
- In
Vec.Insert.c:167
:
// Check length
bool result = (vec.length == 5);
// Check elements in order
- In
Vec.Insert.c:196
:
// Test VecInsertRange function for inserting at a specific index
bool test_vec_push_arr(void) {
printf("Testing VecInsertRange at specific index\n");
- In
Vec.Insert.c:212
:
// Check length
bool result = (vec.length == 5);
// Expected result: [10, 30, 40, 50, 20]
- In
Vec.Insert.c:229
:
// Test VecInsertRange function for inserting from another vector
bool test_vec_insert_range(void) {
printf("Testing VecInsertRange from another vector\n");
- In
Vec.Insert.c:249
:
// Check length
bool result = (vec.length == 6);
// Expected result: [10, 40, 50, 60, 20, 30]
- In
Vec.Insert.c:267
:
// Test VecMerge function
bool test_vec_merge(void) {
printf("Testing VecMerge\n");
- In
Vec.Insert.c:289
:
// Check lengths
bool result = (vec1.length == 6);
result = result && (vec2.length == 3); // VecMergeR doesn't modify source vector
- In
Vec.Insert.c:308
:
// Test L-value and R-value operations
bool test_lvalue_rvalue_operations(void) {
printf("Testing L-value and R-value operations\n");
- In
Vec.Insert.c:319
:
// Check that the element was added
bool result = (vec.length == 1 && VecAt(&vec, 0) == 42);
// Test L-value insert operations
- In
Vec.Insert.c:391
:
// Test that L-value insertions properly memset values to 0 after insertion
bool test_lvalue_memset_after_insertion(void) {
printf("Testing L-value memset after insertion\n");
- In
Vec.Insert.c:401
:
int val1 = 10;
VecPushBackL(&vec, val1);
bool result = (val1 == 0); // Should be memset to 0
// Test VecPushFrontL
// Function prototypes
bool test_bitvec_shrink_to_fit(void);
bool test_bitvec_set_capacity(void);
bool test_bitvec_swap(void);
// Function prototypes
bool test_bitvec_shrink_to_fit(void);
bool test_bitvec_set_capacity(void);
bool test_bitvec_swap(void);
bool test_bitvec_clone(void);
bool test_bitvec_shrink_to_fit(void);
bool test_bitvec_set_capacity(void);
bool test_bitvec_swap(void);
bool test_bitvec_clone(void);
bool test_bitvec_shrink_to_fit_edge_cases(void);
bool test_bitvec_set_capacity(void);
bool test_bitvec_swap(void);
bool test_bitvec_clone(void);
bool test_bitvec_shrink_to_fit_edge_cases(void);
bool test_bitvec_set_capacity_edge_cases(void);
bool test_bitvec_swap(void);
bool test_bitvec_clone(void);
bool test_bitvec_shrink_to_fit_edge_cases(void);
bool test_bitvec_set_capacity_edge_cases(void);
bool test_bitvec_swap_edge_cases(void);
bool test_bitvec_clone(void);
bool test_bitvec_shrink_to_fit_edge_cases(void);
bool test_bitvec_set_capacity_edge_cases(void);
bool test_bitvec_swap_edge_cases(void);
bool test_bitvec_clone_edge_cases(void);
bool test_bitvec_shrink_to_fit_edge_cases(void);
bool test_bitvec_set_capacity_edge_cases(void);
bool test_bitvec_swap_edge_cases(void);
bool test_bitvec_clone_edge_cases(void);
bool test_bitvec_memory_stress_test(void);
bool test_bitvec_set_capacity_edge_cases(void);
bool test_bitvec_swap_edge_cases(void);
bool test_bitvec_clone_edge_cases(void);
bool test_bitvec_memory_stress_test(void);
bool test_bitvec_memory_null_failures(void);
bool test_bitvec_swap_edge_cases(void);
bool test_bitvec_clone_edge_cases(void);
bool test_bitvec_memory_stress_test(void);
bool test_bitvec_memory_null_failures(void);
bool test_bitvec_swap_null_failures(void);
bool test_bitvec_clone_edge_cases(void);
bool test_bitvec_memory_stress_test(void);
bool test_bitvec_memory_null_failures(void);
bool test_bitvec_swap_null_failures(void);
bool test_bitvec_clone_null_failures(void);
bool test_bitvec_memory_stress_test(void);
bool test_bitvec_memory_null_failures(void);
bool test_bitvec_swap_null_failures(void);
bool test_bitvec_clone_null_failures(void);
bool test_bitvec_memory_null_failures(void);
bool test_bitvec_swap_null_failures(void);
bool test_bitvec_clone_null_failures(void);
// Test BitVecShrinkToFit function
// Test BitVecShrinkToFit function
bool test_bitvec_shrink_to_fit(void) {
printf("Testing BitVecShrinkToFit\n");
// Check that capacity is larger than length
u64 initial_capacity = bv.capacity;
bool result = (initial_capacity >= 100) && (bv.length == 3);
// Shrink to fit
// Test BitVecReserve function (replacing BitVecSetCapacity)
bool test_bitvec_set_capacity(void) {
printf("Testing BitVecReserve\n");
// Check that capacity was set correctly
bool result = (bv.capacity >= 50) && (bv.length == 2);
// Check that data is still intact
// Test BitVecSwap function
bool test_bitvec_swap(void) {
printf("Testing BitVecSwap\n");
// Check that they swapped
bool result = (bv1.length == bv2_orig_length) && (bv2.length == bv1_orig_length);
// Check bv1 (should now have bv2's original content)
// Test BitVecClone function
bool test_bitvec_clone(void) {
printf("Testing BitVecClone\n");
// Check that clone has same content as original
bool result = (clone.length == original.length);
for (u64 i = 0; i < original.length; i++) {
// Edge case tests
bool test_bitvec_shrink_to_fit_edge_cases(void) {
printf("Testing BitVecShrinkToFit edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test shrink on empty bitvec
}
bool test_bitvec_set_capacity_edge_cases(void) {
printf("Testing BitVecReserve edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test set capacity on empty bitvec
}
bool test_bitvec_swap_edge_cases(void) {
printf("Testing BitVecSwap edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test swap with both empty
}
bool test_bitvec_clone_edge_cases(void) {
printf("Testing BitVecClone edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test clone empty bitvec
}
bool test_bitvec_memory_stress_test(void) {
printf("Testing BitVec memory stress test\n");
printf("Testing BitVec memory stress test\n");
bool result = true;
// Test multiple clone/swap/reu64 cycles
// Deadend tests
bool test_bitvec_memory_null_failures(void) {
printf("Testing BitVec memory NULL pointer handling\n");
}
bool test_bitvec_swap_null_failures(void) {
printf("Testing BitVec swap NULL handling\n");
}
bool test_bitvec_clone_null_failures(void) {
printf("Testing BitVec clone NULL handling\n");
- In
Vec.Type.c:16
:
// Function prototypes
bool test_vec_type_basic(void);
bool test_vec_validate(void);
- In
Vec.Type.c:17
:
// Function prototypes
bool test_vec_type_basic(void);
bool test_vec_validate(void);
// Test basic Vec type functionality
- In
Vec.Type.c:20
:
// Test basic Vec type functionality
bool test_vec_type_basic(void) {
printf("Testing basic Vec type functionality\n");
- In
Vec.Type.c:28
:
// Check initial state
bool result =
(vec.length == 0 && vec.capacity == 0 && vec.data == NULL && vec.alignment == 1 && vec.copy_init == NULL &&
vec.copy_deinit == NULL);
- In
Vec.Type.c:50
:
// Test ValidateVec macro
bool test_vec_validate(void) {
printf("Testing ValidateVec macro\n");
- In
Vec.Memory.c:10
:
// Function prototypes
bool test_vec_try_reduce_space(void);
bool test_vec_resize(void);
bool test_vec_reserve(void);
- In
Vec.Memory.c:11
:
// Function prototypes
bool test_vec_try_reduce_space(void);
bool test_vec_resize(void);
bool test_vec_reserve(void);
bool test_vec_clear(void);
- In
Vec.Memory.c:12
:
bool test_vec_try_reduce_space(void);
bool test_vec_resize(void);
bool test_vec_reserve(void);
bool test_vec_clear(void);
- In
Vec.Memory.c:13
:
bool test_vec_resize(void);
bool test_vec_reserve(void);
bool test_vec_clear(void);
// Test VecTryReduceSpace function
- In
Vec.Memory.c:16
:
// Test VecTryReduceSpace function
bool test_vec_try_reduce_space(void) {
printf("Testing VecTryReduceSpace\n");
- In
Vec.Memory.c:33
:
// Original capacity should be at least 100
bool result = (vec.capacity >= 100);
// Try to reduce space
- In
Vec.Memory.c:53
:
// Test VecResize function
bool test_vec_resize(void) {
printf("Testing VecResize\n");
- In
Vec.Memory.c:67
:
// Initial length should be 5
bool result = (vec.length == 5);
// Resize to a smaller length
- In
Vec.Memory.c:98
:
// Test VecReserve function
bool test_vec_reserve(void) {
printf("Testing VecReserve\n");
- In
Vec.Memory.c:106
:
// Initial capacity should be 0
bool result = (vec.capacity == 0);
// Reserve space for 50 elements
- In
Vec.Memory.c:142
:
// Test VecClear function
bool test_vec_clear(void) {
printf("Testing VecClear\n");
- In
Vec.Memory.c:156
:
// Initial length should be 5
bool result = (vec.length == 5);
// Remember the capacity
// Function prototypes
bool test_bitvec_get(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
// Function prototypes
bool test_bitvec_get(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_get(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
// Test BitVecGet function
// Test BitVecGet function
bool test_bitvec_get(void) {
printf("Testing BitVecGet\n");
// Test getting bits
bool result = (BitVecGet(&bv, 0) == true) && (BitVecGet(&bv, 1) == false) && (BitVecGet(&bv, 2) == true) &&
(BitVecGet(&bv, 3) == false);
// Test BitVecSet function
bool test_bitvec_set(void) {
printf("Testing BitVecSet\n");
// Test getting the set bits
bool result = (BitVecGet(&bv, 0) == true) && (BitVecGet(&bv, 1) == false) && (BitVecGet(&bv, 2) == true) &&
(BitVecGet(&bv, 3) == false);
// Test BitVecFlip function
bool test_bitvec_flip(void) {
printf("Testing BitVecFlip\n");
// Test the flipped bits
bool result = (BitVecGet(&bv, 0) == false) && // was true, now false
(BitVecGet(&bv, 1) == true) && // was false, now true
(BitVecGet(&bv, 2) == true) && // unchanged
// Test BitVecLength and BitVecCapacity functions
bool test_bitvec_length_capacity(void) {
printf("Testing BitVecLength and BitVecCapacity\n");
// Initially empty
bool result = (BitVecLen(&bv) == 0);
// Push some bits
// Test BitVecCount functions
bool test_bitvec_count_operations(void) {
printf("Testing BitVecCount operations\n");
// Count true and false bits
bool result = (BitVecCountOnes(&bv) == 3) && (BitVecCountZeros(&bv) == 2);
BitVecDeinit(&bv);
// Edge case tests for BitVecGet
bool test_bitvec_get_edge_cases(void) {
printf("Testing BitVecGet edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test with single bit
// Edge case tests for BitVecSet
bool test_bitvec_set_edge_cases(void) {
printf("Testing BitVecSet edge cases\n");
BitVecResize(&bv, 1);
BitVecSet(&bv, 0, true);
bool result = (BitVecGet(&bv, 0) == true);
// Set same bit to false
// Edge case tests for BitVecFlip
bool test_bitvec_flip_edge_cases(void) {
printf("Testing BitVecFlip edge cases\n");
BitVecPush(&bv, false);
BitVecFlip(&bv, 0);
bool result = (BitVecGet(&bv, 0) == true);
// Flip it again
// Edge case tests for BitVecCount
bool test_bitvec_count_edge_cases(void) {
printf("Testing BitVecCount edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector
// Test multiple operations together
bool test_bitvec_access_multiple_operations(void) {
printf("Testing BitVec multiple access operations\n");
BitVec bv = BitVecInit();
bool result = true;
// Create pattern using different methods
// Test with large patterns
bool test_bitvec_access_large_patterns(void) {
printf("Testing BitVec access with large patterns\n");
BitVec bv = BitVecInit();
bool result = true;
// Create large alternating pattern
// Test macro functions
bool test_bitvec_macro_functions(void) {
printf("Testing BitVec macro functions\n");
BitVec bv = BitVecInit();
bool result = true;
// Test BITVEC_GET, BITVEC_SET, BITVEC_FLIP if they exist
// Stress test for access operations
bool test_bitvec_access_stress_test(void) {
printf("Testing BitVec access stress test\n");
BitVec bv = BitVecInit();
bool result = true;
// Create large bitvector
// Verify flipped bits
for (int i = 0; i < size && result; i++) {
bool expected = (i % 3 == 0);
if (i % 7 == 0) {
expected = !expected; // Flipped
// Comprehensive bit pattern testing
bool test_bitvec_bit_patterns_comprehensive(void) {
printf("Testing BitVec comprehensive bit patterns\n");
BitVec bv = BitVecInit();
bool result = true;
// Test all zeros
// Verify we can access all bits
for (int i = 0; i < 100 && result; i++) {
bool expected = (i * 17 + 3) % 7 < 3;
result = result && (BitVecGet(&bv, i) == expected);
}
// Test BitVecFind functions (Find, FindLast)
bool test_bitvec_find_functions(void) {
printf("Testing BitVecFind functions\n");
BitVec bv = BitVecInit();
bool result = true;
// Create pattern: F T F T F T F T
// Test BitVec predicate functions (All, Any, None)
bool test_bitvec_predicate_functions(void) {
printf("Testing BitVec predicate functions\n");
BitVec bv = BitVecInit();
bool result = true;
// Test with all true
// Test BitVecLongestRun function
bool test_bitvec_longest_run(void) {
printf("Testing BitVecLongestRun\n");
BitVec bv = BitVecInit();
bool result = true;
// Test pattern: T T T F F T T F F F F
// Test pattern: T T T F F T T F F F F
bool pattern[] = {true, true, true, false, false, true, true, false, false, false, false};
for (int i = 0; i < 11; i++) {
BitVecPush(&bv, pattern[i]);
// Edge case tests for Find functions
bool test_bitvec_find_edge_cases(void) {
printf("Testing BitVecFind edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector
// Edge case tests for predicate functions
bool test_bitvec_predicate_edge_cases(void) {
printf("Testing BitVec predicate edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector - all predicates should return true for empty set
// Edge case tests for LongestRun function
bool test_bitvec_longest_run_edge_cases(void) {
printf("Testing BitVecLongestRun edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector
// Function prototypes for deadend tests
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
// Function prototypes for deadend tests
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
bool test_bitvec_access_null_failures(void);
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
bool test_bitvec_access_null_failures(void);
bool test_bitvec_set_null_failures(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
bool test_bitvec_access_null_failures(void);
bool test_bitvec_set_null_failures(void);
bool test_bitvec_flip_null_failures(void);
bool test_bitvec_longest_run_deadend_tests(void);
bool test_bitvec_access_null_failures(void);
bool test_bitvec_set_null_failures(void);
bool test_bitvec_flip_null_failures(void);
bool test_bitvec_get_bounds_failures(void);
bool test_bitvec_access_null_failures(void);
bool test_bitvec_set_null_failures(void);
bool test_bitvec_flip_null_failures(void);
bool test_bitvec_get_bounds_failures(void);
bool test_bitvec_set_bounds_failures(void);
bool test_bitvec_set_null_failures(void);
bool test_bitvec_flip_null_failures(void);
bool test_bitvec_get_bounds_failures(void);
bool test_bitvec_set_bounds_failures(void);
bool test_bitvec_flip_bounds_failures(void);
bool test_bitvec_flip_null_failures(void);
bool test_bitvec_get_bounds_failures(void);
bool test_bitvec_set_bounds_failures(void);
bool test_bitvec_flip_bounds_failures(void);
bool test_bitvec_get_large_index_failures(void);
bool test_bitvec_get_bounds_failures(void);
bool test_bitvec_set_bounds_failures(void);
bool test_bitvec_flip_bounds_failures(void);
bool test_bitvec_get_large_index_failures(void);
bool test_bitvec_set_large_index_failures(void);
bool test_bitvec_set_bounds_failures(void);
bool test_bitvec_flip_bounds_failures(void);
bool test_bitvec_get_large_index_failures(void);
bool test_bitvec_set_large_index_failures(void);
bool test_bitvec_flip_edge_index_failures(void);
bool test_bitvec_flip_bounds_failures(void);
bool test_bitvec_get_large_index_failures(void);
bool test_bitvec_set_large_index_failures(void);
bool test_bitvec_flip_edge_index_failures(void);
bool test_bitvec_count_null_failures(void);
bool test_bitvec_get_large_index_failures(void);
bool test_bitvec_set_large_index_failures(void);
bool test_bitvec_flip_edge_index_failures(void);
bool test_bitvec_count_null_failures(void);
bool test_bitvec_get_max_index_failures(void);
bool test_bitvec_set_large_index_failures(void);
bool test_bitvec_flip_edge_index_failures(void);
bool test_bitvec_count_null_failures(void);
bool test_bitvec_get_max_index_failures(void);
bool test_bitvec_flip_edge_index_failures(void);
bool test_bitvec_count_null_failures(void);
bool test_bitvec_get_max_index_failures(void);
// Deadend tests - testing NULL pointers and invalid conditions that should cause fatal errors
// Deadend tests - testing NULL pointers and invalid conditions that should cause fatal errors
bool test_bitvec_find_deadend_tests(void) {
printf("Testing BitVecFind deadend scenarios\n");
}
bool test_bitvec_predicate_deadend_tests(void) {
printf("Testing BitVec predicate deadend scenarios\n");
}
bool test_bitvec_longest_run_deadend_tests(void) {
printf("Testing BitVecLongestRun deadend scenarios\n");
// Deadend tests
bool test_bitvec_access_null_failures(void) {
printf("Testing BitVec access NULL pointer handling\n");
}
bool test_bitvec_set_null_failures(void) {
printf("Testing BitVec set NULL pointer handling\n");
}
bool test_bitvec_flip_null_failures(void) {
printf("Testing BitVec flip NULL pointer handling\n");
}
bool test_bitvec_get_bounds_failures(void) {
printf("Testing BitVec get bounds checking\n");
}
bool test_bitvec_set_bounds_failures(void) {
printf("Testing BitVec set bounds checking\n");
}
bool test_bitvec_flip_bounds_failures(void) {
printf("Testing BitVec flip bounds checking\n");
// NEW: More specific bounds checking deadend tests
bool test_bitvec_get_large_index_failures(void) {
printf("Testing BitVec get with large out-of-bounds index\n");
}
bool test_bitvec_set_large_index_failures(void) {
printf("Testing BitVec set with large out-of-bounds index\n");
}
bool test_bitvec_flip_edge_index_failures(void) {
printf("Testing BitVec flip with edge case out-of-bounds index\n");
}
bool test_bitvec_count_null_failures(void) {
printf("Testing BitVec count operations with NULL pointer\n");
}
bool test_bitvec_get_max_index_failures(void) {
printf("Testing BitVec get with maximum index value\n");
// Function prototypes
bool test_bitvec_push(void);
bool test_bitvec_insert_single(void);
bool test_bitvec_insert_range(void);
// Function prototypes
bool test_bitvec_push(void);
bool test_bitvec_insert_single(void);
bool test_bitvec_insert_range(void);
bool test_bitvec_insert_multiple(void);
bool test_bitvec_push(void);
bool test_bitvec_insert_single(void);
bool test_bitvec_insert_range(void);
bool test_bitvec_insert_multiple(void);
bool test_bitvec_insert_pattern(void);
bool test_bitvec_insert_single(void);
bool test_bitvec_insert_range(void);
bool test_bitvec_insert_multiple(void);
bool test_bitvec_insert_pattern(void);
bool test_bitvec_insert_range_edge_cases(void);
bool test_bitvec_insert_range(void);
bool test_bitvec_insert_multiple(void);
bool test_bitvec_insert_pattern(void);
bool test_bitvec_insert_range_edge_cases(void);
bool test_bitvec_insert_multiple_edge_cases(void);
bool test_bitvec_insert_multiple(void);
bool test_bitvec_insert_pattern(void);
bool test_bitvec_insert_range_edge_cases(void);
bool test_bitvec_insert_multiple_edge_cases(void);
bool test_bitvec_insert_pattern_edge_cases(void);
bool test_bitvec_insert_pattern(void);
bool test_bitvec_insert_range_edge_cases(void);
bool test_bitvec_insert_multiple_edge_cases(void);
bool test_bitvec_insert_pattern_edge_cases(void);
bool test_bitvec_insert_null_failures(void);
bool test_bitvec_insert_range_edge_cases(void);
bool test_bitvec_insert_multiple_edge_cases(void);
bool test_bitvec_insert_pattern_edge_cases(void);
bool test_bitvec_insert_null_failures(void);
bool test_bitvec_insert_invalid_range_failures(void);
bool test_bitvec_insert_multiple_edge_cases(void);
bool test_bitvec_insert_pattern_edge_cases(void);
bool test_bitvec_insert_null_failures(void);
bool test_bitvec_insert_invalid_range_failures(void);
bool test_bitvec_insert_pattern_null_failures(void);
bool test_bitvec_insert_pattern_edge_cases(void);
bool test_bitvec_insert_null_failures(void);
bool test_bitvec_insert_invalid_range_failures(void);
bool test_bitvec_insert_pattern_null_failures(void);
bool test_bitvec_insert_null_failures(void);
bool test_bitvec_insert_invalid_range_failures(void);
bool test_bitvec_insert_pattern_null_failures(void);
// Test BitVecPush function
// Test BitVecPush function
bool test_bitvec_push(void) {
printf("Testing BitVecPush\n");
// Check length
bool result = (bv.length == 5);
// Check each bit
// Test BitVecInsert single bit function
bool test_bitvec_insert_single(void) {
printf("Testing BitVecInsert (single bit)\n");
// Check first bit
bool result = (bv.length == 1 && BitVecGet(&bv, 0) == true);
// Insert at the end
// Test BitVecInsertRange function
bool test_bitvec_insert_range(void) {
printf("Testing BitVecInsertRange\n");
// Check result: false, true, true, true, false
bool result = (bv.length == 5);
result = result && (BitVecGet(&bv, 0) == false);
result = result && (BitVecGet(&bv, 1) == true);
// Test BitVecInsertMultiple function
bool test_bitvec_insert_multiple(void) {
printf("Testing BitVecInsertMultiple\n");
// Check result: true, true, true, true, false
bool result = (bv.length == 5);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == true);
// Test BitVecInsertPattern function
bool test_bitvec_insert_pattern(void) {
printf("Testing BitVecInsertPattern\n");
// Check result: false, true, false, true, true, false
// Pattern 1011 gets inserted as individual bits
bool result = (bv.length == 6);
result = result && (BitVecGet(&bv, 0) == false); // original
result = result && (BitVecGet(&bv, 1) == true); // bit 0 of pattern (LSB)
// Edge case tests
bool test_bitvec_insert_range_edge_cases(void) {
printf("Testing BitVecInsertRange edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test inserting 0 bits (should be no-op)
}
bool test_bitvec_insert_multiple_edge_cases(void) {
printf("Testing BitVecInsertMultiple edge cases\n");
BitVec empty = BitVecInit();
BitVec source = BitVecInit();
bool result = true;
// Test inserting empty bitvec
}
bool test_bitvec_insert_pattern_edge_cases(void) {
printf("Testing BitVecInsertPattern edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test inserting empty pattern (should be no-op)
// Deadend tests
bool test_bitvec_insert_null_failures(void) {
printf("Testing BitVec insert NULL pointer handling\n");
}
bool test_bitvec_insert_invalid_range_failures(void) {
printf("Testing BitVec insert invalid range handling\n");
}
bool test_bitvec_insert_pattern_null_failures(void) {
printf("Testing BitVec insert pattern NULL handling\n");
// Function prototypes for deadend tests
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
// Function prototypes for deadend tests
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
// Deadend test 1: BitVecFindPattern with NULL source
// Deadend test 1: BitVecFindPattern with NULL source
bool test_bitvec_find_pattern_null_source(void) {
printf("Testing BitVecFindPattern(NULL, pattern) - should fatal\n");
// Deadend test 2: BitVecFindPattern with NULL pattern
bool test_bitvec_find_pattern_null_pattern(void) {
printf("Testing BitVecFindPattern(source, NULL) - should fatal\n");
// Deadend test 3: BitVecFindLastPattern with NULL source
bool test_bitvec_find_last_pattern_null_source(void) {
printf("Testing BitVecFindLastPattern(NULL, pattern) - should fatal\n");
// Deadend test 4: BitVecFindLastPattern with NULL pattern
bool test_bitvec_find_last_pattern_null_pattern(void) {
printf("Testing BitVecFindLastPattern(source, NULL) - should fatal\n");
// Deadend test 5: BitVecFindAllPattern with NULL source
bool test_bitvec_find_all_pattern_null_source(void) {
printf("Testing BitVecFindAllPattern(NULL, pattern, results, 10) - should fatal\n");
// Deadend test 6: BitVecFindAllPattern with NULL pattern
bool test_bitvec_find_all_pattern_null_pattern(void) {
printf("Testing BitVecFindAllPattern(source, NULL, results, 10) - should fatal\n");
// Deadend test 7: BitVecFindAllPattern with NULL results
bool test_bitvec_find_all_pattern_null_results(void) {
printf("Testing BitVecFindAllPattern(source, pattern, NULL, 10) - should fatal\n");
// Deadend test 8: BitVecFindAllPattern with zero max_results
bool test_bitvec_find_all_pattern_zero_max_results(void) {
printf("Testing BitVecFindAllPattern(source, pattern, results, 0) - should fatal\n");
// Additional deadend tests for missing Pattern functions
bool test_bitvec_starts_with_null_source(void) {
printf("Testing BitVecStartsWith(NULL, prefix) - should fatal\n");
BitVec prefix = BitVecInit();
}
bool test_bitvec_starts_with_null_prefix(void) {
printf("Testing BitVecStartsWith(source, NULL) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_ends_with_null_source(void) {
printf("Testing BitVecEndsWith(NULL, suffix) - should fatal\n");
BitVec suffix = BitVecInit();
}
bool test_bitvec_ends_with_null_suffix(void) {
printf("Testing BitVecEndsWith(source, NULL) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_contains_at_null_source(void) {
printf("Testing BitVecContainsAt(NULL, pattern, 0) - should fatal\n");
BitVec pattern = BitVecInit();
}
bool test_bitvec_contains_at_null_pattern(void) {
printf("Testing BitVecContainsAt(source, NULL, 0) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_replace_null_source(void) {
printf("Testing BitVecReplace(NULL, old, new) - should fatal\n");
}
bool test_bitvec_matches_null_source(void) {
printf("Testing BitVecMatches(NULL, pattern, wildcard) - should fatal\n");
BitVec pattern = BitVecInit();
}
bool test_bitvec_regex_match_null_source(void) {
printf("Testing BitVecRegexMatch(NULL, pattern) - should fatal\n");
BitVecRegexMatch(NULL, "101");
}
bool test_bitvec_regex_match_null_pattern(void) {
printf("Testing BitVecRegexMatch(source, NULL) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_prefix_match_null_source(void) {
printf("Testing BitVecPrefixMatch(NULL, patterns, 1) - should fatal\n");
BitVecs vp = VecInitWithDeepCopy(NULL, BitVecDeinit);
}
bool test_bitvec_prefix_match_null_patterns(void) {
printf("Testing BitVecPrefixMatch(source, NULL, 1) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_suffix_match_null_source(void) {
printf("Testing BitVecSuffixMatch(NULL, patterns, 1) - should fatal\n");
BitVecs vp = VecInitWithDeepCopy(NULL, BitVecDeinit);
}
bool test_bitvec_suffix_match_null_patterns(void) {
printf("Testing BitVecSuffixMatch(source, NULL, 1) - should fatal\n");
BitVec source = BitVecInit();
// Function prototypes
bool test_bitvec_pop(void);
bool test_bitvec_remove_single(void);
bool test_bitvec_remove_range(void);
// Function prototypes
bool test_bitvec_pop(void);
bool test_bitvec_remove_single(void);
bool test_bitvec_remove_range(void);
bool test_bitvec_remove_first(void);
bool test_bitvec_pop(void);
bool test_bitvec_remove_single(void);
bool test_bitvec_remove_range(void);
bool test_bitvec_remove_first(void);
bool test_bitvec_remove_last(void);
bool test_bitvec_remove_single(void);
bool test_bitvec_remove_range(void);
bool test_bitvec_remove_first(void);
bool test_bitvec_remove_last(void);
bool test_bitvec_remove_all(void);
bool test_bitvec_remove_range(void);
bool test_bitvec_remove_first(void);
bool test_bitvec_remove_last(void);
bool test_bitvec_remove_all(void);
bool test_bitvec_pop_edge_cases(void);
bool test_bitvec_remove_first(void);
bool test_bitvec_remove_last(void);
bool test_bitvec_remove_all(void);
bool test_bitvec_pop_edge_cases(void);
bool test_bitvec_remove_single_edge_cases(void);
bool test_bitvec_remove_last(void);
bool test_bitvec_remove_all(void);
bool test_bitvec_pop_edge_cases(void);
bool test_bitvec_remove_single_edge_cases(void);
bool test_bitvec_remove_range_edge_cases(void);
bool test_bitvec_remove_all(void);
bool test_bitvec_pop_edge_cases(void);
bool test_bitvec_remove_single_edge_cases(void);
bool test_bitvec_remove_range_edge_cases(void);
bool test_bitvec_remove_first_last_edge_cases(void);
bool test_bitvec_pop_edge_cases(void);
bool test_bitvec_remove_single_edge_cases(void);
bool test_bitvec_remove_range_edge_cases(void);
bool test_bitvec_remove_first_last_edge_cases(void);
bool test_bitvec_remove_all_edge_cases(void);
bool test_bitvec_remove_single_edge_cases(void);
bool test_bitvec_remove_range_edge_cases(void);
bool test_bitvec_remove_first_last_edge_cases(void);
bool test_bitvec_remove_all_edge_cases(void);
bool test_bitvec_remove_null_failures(void);
bool test_bitvec_remove_range_edge_cases(void);
bool test_bitvec_remove_first_last_edge_cases(void);
bool test_bitvec_remove_all_edge_cases(void);
bool test_bitvec_remove_null_failures(void);
bool test_bitvec_remove_range_null_failures(void);
bool test_bitvec_remove_first_last_edge_cases(void);
bool test_bitvec_remove_all_edge_cases(void);
bool test_bitvec_remove_null_failures(void);
bool test_bitvec_remove_range_null_failures(void);
bool test_bitvec_remove_invalid_range_failures(void);
bool test_bitvec_remove_all_edge_cases(void);
bool test_bitvec_remove_null_failures(void);
bool test_bitvec_remove_range_null_failures(void);
bool test_bitvec_remove_invalid_range_failures(void);
bool test_bitvec_remove_null_failures(void);
bool test_bitvec_remove_range_null_failures(void);
bool test_bitvec_remove_invalid_range_failures(void);
// Test BitVecPop function
// Test BitVecPop function
bool test_bitvec_pop(void) {
printf("Testing BitVecPop\n");
// Pop the last bit
bool popped = BitVecPop(&bv);
// Check result
// Check result
bool result = (popped == true) && (bv.length == 2);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
// Test BitVecRemove single bit function
bool test_bitvec_remove_single(void) {
printf("Testing BitVecRemove (single bit)\n");
// Remove bit at index 2 (middle true)
bool removed = BitVecRemove(&bv, 2);
// Check result: true, false, false, true
// Check result: true, false, false, true
bool result = (removed == true) && (bv.length == 4);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
// Test BitVecRemoveRange function
bool test_bitvec_remove_range(void) {
printf("Testing BitVecRemoveRange\n");
// Check result: true, false, true (removed false, true, true)
bool result = (bv.length == 3);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
// Test BitVecRemoveFirst function
bool test_bitvec_remove_first(void) {
printf("Testing BitVecRemoveFirst\n");
// Remove first occurrence of false
bool found = BitVecRemoveFirst(&bv, false);
// Check result: true, true, false, true (removed first false at index 1)
// Check result: true, true, false, true (removed first false at index 1)
bool result = (found == true) && (bv.length == 4);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == true);
// Test BitVecRemoveLast function
bool test_bitvec_remove_last(void) {
printf("Testing BitVecRemoveLast\n");
// Remove last occurrence of false
bool found = BitVecRemoveLast(&bv, false);
// Check result: true, false, true, true (removed last false at index 3)
// Check result: true, false, true, true (removed last false at index 3)
bool result = (found == true) && (bv.length == 4);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
// Test BitVecRemoveAll function
bool test_bitvec_remove_all(void) {
printf("Testing BitVecRemoveAll\n");
// Check result: true, true, true (all false bits removed)
bool result = (removed_count == 3) && (bv.length == 3);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == true);
// Edge case tests
bool test_bitvec_pop_edge_cases(void) {
printf("Testing BitVecPop edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test pop single element
// Test pop single element
BitVecPush(&bv, true);
bool popped = BitVecPop(&bv);
result = result && (popped == true) && (bv.length == 0);
}
bool test_bitvec_remove_single_edge_cases(void) {
printf("Testing BitVecRemove edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test remove last element
// Test remove last element
BitVecPush(&bv, true);
bool removed = BitVecRemove(&bv, 0);
result = result && (removed == true) && (bv.length == 0);
}
bool test_bitvec_remove_range_edge_cases(void) {
printf("Testing BitVecRemoveRange edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test remove 0 elements (should be no-op)
}
bool test_bitvec_remove_first_last_edge_cases(void) {
printf("Testing BitVecRemoveFirst/Last edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test remove from empty bitvec
// Test remove from empty bitvec
bool found = BitVecRemoveFirst(&bv, true);
result = result && (found == false) && (bv.length == 0);
}
bool test_bitvec_remove_all_edge_cases(void) {
printf("Testing BitVecRemoveAll edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test remove all from empty bitvec
// Deadend tests
bool test_bitvec_remove_null_failures(void) {
printf("Testing BitVec remove NULL pointer handling\n");
}
bool test_bitvec_remove_range_null_failures(void) {
printf("Testing BitVec remove range NULL handling\n");
}
bool test_bitvec_remove_invalid_range_failures(void) {
printf("Testing BitVec remove invalid range handling\n");
}
bool test_bitvec_pop_bounds_failures(void) {
printf("Testing BitVec pop bounds checking\n");
}
bool test_bitvec_remove_bounds_failures(void) {
printf("Testing BitVec remove bounds checking\n");
}
bool test_bitvec_remove_range_bounds_failures(void) {
printf("Testing BitVec remove range bounds checking\n");
- In
Vec.Complex.c:19
:
// Copy init function for ComplexItem
bool ComplexItemCopyInit(ComplexItem* dst, ComplexItem* src) {
if (!dst || !src)
return false;
- In
Vec.Complex.c:93
:
// Helper function to check if two ComplexItems are equal
bool ComplexItemsEqual(ComplexItem* a, ComplexItem* b) {
if (!a || !b)
return false;
// Function prototypes
bool test_complex_vec_init(void);
bool test_complex_vec_push(void);
bool test_complex_vec_insert(void);
// Function prototypes
bool test_complex_vec_init(void);
bool test_complex_vec_push(void);
bool test_complex_vec_insert(void);
bool test_complex_vec_merge(void);
bool test_complex_vec_init(void);
bool test_complex_vec_push(void);
bool test_complex_vec_insert(void);
bool test_complex_vec_merge(void);
bool test_lvalue_operations(void);
bool test_complex_vec_push(void);
bool test_complex_vec_insert(void);
bool test_complex_vec_merge(void);
bool test_lvalue_operations(void);
bool test_fast_operations(void);
bool test_complex_vec_insert(void);
bool test_complex_vec_merge(void);
bool test_lvalue_operations(void);
bool test_fast_operations(void);
bool test_delete_operations(void);
bool test_complex_vec_merge(void);
bool test_lvalue_operations(void);
bool test_fast_operations(void);
bool test_delete_operations(void);
bool test_edge_cases(void);
bool test_lvalue_operations(void);
bool test_fast_operations(void);
bool test_delete_operations(void);
bool test_edge_cases(void);
bool test_lvalue_memset_pushback(void);
bool test_fast_operations(void);
bool test_delete_operations(void);
bool test_edge_cases(void);
bool test_lvalue_memset_pushback(void);
bool test_lvalue_memset_insert(void);
bool test_delete_operations(void);
bool test_edge_cases(void);
bool test_lvalue_memset_pushback(void);
bool test_lvalue_memset_insert(void);
bool test_lvalue_memset_fast_insert(void);
bool test_edge_cases(void);
bool test_lvalue_memset_pushback(void);
bool test_lvalue_memset_insert(void);
bool test_lvalue_memset_fast_insert(void);
bool test_lvalue_memset_pushfront(void);
bool test_lvalue_memset_pushback(void);
bool test_lvalue_memset_insert(void);
bool test_lvalue_memset_fast_insert(void);
bool test_lvalue_memset_pushfront(void);
bool test_lvalue_memset_merge(void);
bool test_lvalue_memset_insert(void);
bool test_lvalue_memset_fast_insert(void);
bool test_lvalue_memset_pushfront(void);
bool test_lvalue_memset_merge(void);
bool test_lvalue_memset_array_ops(void);
bool test_lvalue_memset_fast_insert(void);
bool test_lvalue_memset_pushfront(void);
bool test_lvalue_memset_merge(void);
bool test_lvalue_memset_array_ops(void);
bool test_lvalue_memset_pushfront(void);
bool test_lvalue_memset_merge(void);
bool test_lvalue_memset_array_ops(void);
// Test initialization with complex structure
// Test initialization with complex structure
bool test_complex_vec_init(void) {
printf("Testing vector initialization with complex structure\n");
// Check initial state
bool result =
(vec.length == 0 && vec.capacity == 0 && vec.data == NULL &&
vec.copy_init == (GenericCopyInit)ComplexItemCopyInit &&
// Test push operations with complex structure
bool test_complex_vec_push(void) {
printf("Testing push operations with complex structure\n");
// Check vector length
bool result = (vec.length == 3);
// Check items order: item2, item1, item3
// Test insert operations with complex structure
bool test_complex_vec_insert(void) {
printf("Testing insert operations with complex structure\n");
// Check vector length
bool result = (vec.length == 3);
// Check items order: item2, item3, item1
// Test merge operations with complex structure
bool test_complex_vec_merge(void) {
printf("Testing merge operations with complex structure\n");
// Check vector lengths
bool result = (vec1.length == 3);
result = result && (vec2.length == 2); // VecMergeR doesn't modify source vector
// Test L-value operations
bool test_lvalue_operations(void) {
printf("Testing L-value operations\n");
// Check vector length
bool result = (vec.length == 3);
// Check items order: val2, val3, val1
// Test fast operations
bool test_fast_operations(void) {
printf("Testing fast operations\n");
// Check vector length
bool result = (vec.length == 6);
// Check that the element was inserted
// Test delete operations
bool test_delete_operations(void) {
printf("Testing delete operations\n");
// Check vector length after deletion
bool result = (vec.length == 8);
// Check that the element was deleted and elements shifted
// Test edge cases
bool test_edge_cases(void) {
printf("Testing edge cases\n");
// Test pushing to empty vector
VecPushBackR(&vec, 10);
bool result = (vec.length == 1 && VecAt(&vec, 0) == 10);
// Test pushing with zero count
// Verify all elements
bool all_correct = true;
for (int i = 0; i < large_count; i++) {
if (VecAt(&vec, i) != i) {
// Test VecPushBackL memset behavior with complex structures
bool test_lvalue_memset_pushback(void) {
printf("Testing VecPushBackL memset with complex structures\n");
// Check that the item was memset to 0
bool result = (item.name == NULL);
result = result && (item.values == NULL);
result = result && (item.num_values == 0);
// Test VecInsertL memset behavior with complex structures
bool test_lvalue_memset_insert(void) {
printf("Testing VecInsertL memset with complex structures\n");
// Check that the item was memset to 0
bool result = (item.name == NULL);
result = result && (item.values == NULL);
result = result && (item.num_values == 0);
// Test VecInsertFastL memset behavior with complex structures
bool test_lvalue_memset_fast_insert(void) {
printf("Testing VecInsertFastL memset with complex structures\n");
bool result = true;
bool test_lvalue_memset_fast_insert(void) {
printf("Testing VecInsertFastL memset with complex structures\n");
bool result = true;
// Create a vector with no copy_init but with copy_deinit for proper cleanup
// Test VecPushFrontL memset behavior with complex structures
bool test_lvalue_memset_pushfront(void) {
printf("Testing VecPushFrontL memset with complex structures\n");
// Check that the item was memset to 0
bool result = (item.name == NULL);
result = result && (item.values == NULL);
result = result && (item.num_values == 0);
// Test VecMergeL memset behavior with complex structures
bool test_lvalue_memset_merge(void) {
printf("Testing VecMergeL memset with complex structures\n");
// Verify items were cleared after being added to vec2
bool result = (item1.name == NULL && item1.values == NULL && item1.num_values == 0);
result = result && (item2.name == NULL && item2.values == NULL && item2.num_values == 0);
// Test array operations with L-value semantics
bool test_lvalue_memset_array_ops(void) {
printf("Testing array operations with L-value semantics\n");
// Check that all items were memset to 0
bool result = true;
for (int i = 0; i < 3; i++) {
result = result && (items[i].name == NULL);
// Deadend test prototypes (tests that should crash due to out-of-bounds access)
bool test_vec_foreach_out_of_bounds_access(void);
bool test_vec_foreach_idx_out_of_bounds_access(void);
bool test_vec_foreach_idx_basic_out_of_bounds_access(void);
// Deadend test prototypes (tests that should crash due to out-of-bounds access)
bool test_vec_foreach_out_of_bounds_access(void);
bool test_vec_foreach_idx_out_of_bounds_access(void);
bool test_vec_foreach_idx_basic_out_of_bounds_access(void);
bool test_vec_foreach_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_out_of_bounds_access(void);
bool test_vec_foreach_idx_out_of_bounds_access(void);
bool test_vec_foreach_idx_basic_out_of_bounds_access(void);
bool test_vec_foreach_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_idx_out_of_bounds_access(void);
bool test_vec_foreach_idx_out_of_bounds_access(void);
bool test_vec_foreach_idx_basic_out_of_bounds_access(void);
bool test_vec_foreach_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_idx_basic_out_of_bounds_access(void);
bool test_vec_foreach_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_in_range_idx_out_of_bounds_access(void);
bool test_vec_foreach_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_in_range_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void);
bool test_vec_foreach_ptr_in_range_idx_out_of_bounds_access(void);
// Deadend test: Make idx go out of bounds during VecForeach by modifying vector during iteration
// Deadend test: Make idx go out of bounds during VecForeach by modifying vector during iteration
bool test_vec_foreach_out_of_bounds_access(void) {
printf("Testing VecForeach where modification causes out of bounds access (should crash)\n");
// Deadend test: Make idx go out of bounds in VecForeachIdx by modifying vector during iteration
bool test_vec_foreach_idx_out_of_bounds_access(void) {
printf("Testing VecForeachIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in VecForeachReverseIdx by modifying vector during iteration
bool test_vec_foreach_reverse_idx_out_of_bounds_access(void) {
printf("Testing VecForeachReverseIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in VecForeachPtrIdx by modifying vector during iteration
bool test_vec_foreach_ptr_idx_out_of_bounds_access(void) {
printf("Testing VecForeachPtrIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in VecForeachPtrReverseIdx by modifying vector during iteration
bool test_vec_foreach_ptr_reverse_idx_out_of_bounds_access(void) {
printf("Testing VecForeachPtrReverseIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in VecForeachPtrInRangeIdx by modifying vector during iteration
bool test_vec_foreach_ptr_in_range_idx_out_of_bounds_access(void) {
printf("Testing VecForeachPtrInRangeIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in basic VecForeachIdx by modifying vector during iteration
bool test_vec_foreach_idx_basic_out_of_bounds_access(void) {
printf("Testing basic VecForeachIdx where idx goes out of bounds (should crash)\n");
- In
Str.Insert.c:11
:
// Function prototypes
bool test_str_insert_char_at(void);
bool test_str_insert_cstr(void);
bool test_str_insert_zstr(void);
- In
Str.Insert.c:12
:
// Function prototypes
bool test_str_insert_char_at(void);
bool test_str_insert_cstr(void);
bool test_str_insert_zstr(void);
bool test_str_insert(void);
- In
Str.Insert.c:13
:
bool test_str_insert_char_at(void);
bool test_str_insert_cstr(void);
bool test_str_insert_zstr(void);
bool test_str_insert(void);
bool test_str_push_cstr(void);
- In
Str.Insert.c:14
:
bool test_str_insert_cstr(void);
bool test_str_insert_zstr(void);
bool test_str_insert(void);
bool test_str_push_cstr(void);
bool test_str_push_zstr(void);
- In
Str.Insert.c:15
:
bool test_str_insert_zstr(void);
bool test_str_insert(void);
bool test_str_push_cstr(void);
bool test_str_push_zstr(void);
bool test_str_push_back_cstr(void);
- In
Str.Insert.c:16
:
bool test_str_insert(void);
bool test_str_push_cstr(void);
bool test_str_push_zstr(void);
bool test_str_push_back_cstr(void);
bool test_str_push_back_zstr(void);
- In
Str.Insert.c:17
:
bool test_str_push_cstr(void);
bool test_str_push_zstr(void);
bool test_str_push_back_cstr(void);
bool test_str_push_back_zstr(void);
bool test_str_push_front_cstr(void);
- In
Str.Insert.c:18
:
bool test_str_push_zstr(void);
bool test_str_push_back_cstr(void);
bool test_str_push_back_zstr(void);
bool test_str_push_front_cstr(void);
bool test_str_push_front_zstr(void);
- In
Str.Insert.c:19
:
bool test_str_push_back_cstr(void);
bool test_str_push_back_zstr(void);
bool test_str_push_front_cstr(void);
bool test_str_push_front_zstr(void);
bool test_str_push_back(void);
- In
Str.Insert.c:20
:
bool test_str_push_back_zstr(void);
bool test_str_push_front_cstr(void);
bool test_str_push_front_zstr(void);
bool test_str_push_back(void);
bool test_str_push_front(void);
- In
Str.Insert.c:21
:
bool test_str_push_front_cstr(void);
bool test_str_push_front_zstr(void);
bool test_str_push_back(void);
bool test_str_push_front(void);
bool test_str_merge_l(void);
- In
Str.Insert.c:22
:
bool test_str_push_front_zstr(void);
bool test_str_push_back(void);
bool test_str_push_front(void);
bool test_str_merge_l(void);
bool test_str_merge_r(void);
- In
Str.Insert.c:23
:
bool test_str_push_back(void);
bool test_str_push_front(void);
bool test_str_merge_l(void);
bool test_str_merge_r(void);
bool test_str_merge(void);
- In
Str.Insert.c:24
:
bool test_str_push_front(void);
bool test_str_merge_l(void);
bool test_str_merge_r(void);
bool test_str_merge(void);
bool test_str_appendf(void);
- In
Str.Insert.c:25
:
bool test_str_merge_l(void);
bool test_str_merge_r(void);
bool test_str_merge(void);
bool test_str_appendf(void);
- In
Str.Insert.c:26
:
bool test_str_merge_r(void);
bool test_str_merge(void);
bool test_str_appendf(void);
// Test StrInsertCharAt function
- In
Str.Insert.c:29
:
// Test StrInsertCharAt function
bool test_str_insert_char_at(void) {
printf("Testing StrInsertCharAt\n");
- In
Str.Insert.c:38
:
// Check that the character was inserted correctly
bool result = (ZstrCompare(s.data, "He!llo") == 0);
// Insert a character at the beginning
- In
Str.Insert.c:57
:
// Test StrInsertCstr function
bool test_str_insert_cstr(void) {
printf("Testing StrInsertCstr\n");
- In
Str.Insert.c:66
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
- In
Str.Insert.c:73
:
// Test StrInsertZstr function
bool test_str_insert_zstr(void) {
printf("Testing StrInsertZstr\n");
- In
Str.Insert.c:82
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
- In
Str.Insert.c:89
:
// Test StrInsert function
bool test_str_insert(void) {
printf("Testing StrInsert\n");
- In
Str.Insert.c:99
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s1.data, "He Worldllo") == 0);
StrDeinit(&s1);
- In
Str.Insert.c:107
:
// Test StrPushCstr function
bool test_str_push_cstr(void) {
printf("Testing StrPushCstr\n");
- In
Str.Insert.c:116
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
- In
Str.Insert.c:123
:
// Test StrPushZstr function
bool test_str_push_zstr(void) {
printf("Testing StrPushZstr\n");
- In
Str.Insert.c:132
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
- In
Str.Insert.c:139
:
// Test StrPushBackCstr function
bool test_str_push_back_cstr(void) {
printf("Testing StrPushBackCstr\n");
- In
Str.Insert.c:148
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
- In
Str.Insert.c:155
:
// Test StrPushBackZstr function
bool test_str_push_back_zstr(void) {
printf("Testing StrPushBackZstr\n");
- In
Str.Insert.c:164
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
- In
Str.Insert.c:171
:
// Test StrPushFrontCstr function
bool test_str_push_front_cstr(void) {
printf("Testing StrPushFrontCstr\n");
- In
Str.Insert.c:180
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
- In
Str.Insert.c:187
:
// Test StrPushFrontZstr function
bool test_str_push_front_zstr(void) {
printf("Testing StrPushFrontZstr\n");
- In
Str.Insert.c:196
:
// Check that the string was inserted correctly
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
- In
Str.Insert.c:203
:
// Test StrPushBack function
bool test_str_push_back(void) {
printf("Testing StrPushBack\n");
- In
Str.Insert.c:217
:
// Check that the characters were inserted correctly
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
- In
Str.Insert.c:224
:
// Test StrPushFront function
bool test_str_push_front(void) {
printf("Testing StrPushFront\n");
- In
Str.Insert.c:238
:
// Check that the characters were inserted correctly
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
- In
Str.Insert.c:245
:
// Test StrMergeL function
bool test_str_merge_l(void) {
printf("Testing StrMergeL\n");
- In
Str.Insert.c:259
:
// Check that the strings were merged correctly
bool result = (ZstrCompare(s1.data, "Hello World") == 0);
// Check that s2 was reset - data should be NULL, length should be 0
- In
Str.Insert.c:270
:
// Test StrMergeR function
bool test_str_merge_r(void) {
printf("Testing StrMergeR\n");
- In
Str.Insert.c:280
:
// Check that the strings were merged correctly
bool result = (ZstrCompare(s1.data, "Hello World") == 0);
// Check that s2 was not reset
- In
Str.Insert.c:291
:
// Test StrMerge function (alias for StrMergeR)
bool test_str_merge(void) {
printf("Testing StrMerge\n");
- In
Str.Insert.c:301
:
// Check that the strings were merged correctly
bool result = (ZstrCompare(s1.data, "Hello World") == 0);
// Check that s2 was not reset (since StrMerge is an alias for StrMergeR)
- In
Str.Insert.c:312
:
// Test StrAppendf function
bool test_str_appendf(void) {
printf("Testing StrAppendf\n");
- In
Str.Insert.c:321
:
// Check that the string was appended correctly
bool result = (ZstrCompare(s.data, "Hello World 2023") == 0);
StrDeinit(&s);
- In
Str.Remove.c:11
:
// Function prototypes
bool test_str_pop_back(void);
bool test_str_pop_front(void);
bool test_str_remove(void);
- In
Str.Remove.c:12
:
// Function prototypes
bool test_str_pop_back(void);
bool test_str_pop_front(void);
bool test_str_remove(void);
bool test_str_remove_range(void);
- In
Str.Remove.c:13
:
bool test_str_pop_back(void);
bool test_str_pop_front(void);
bool test_str_remove(void);
bool test_str_remove_range(void);
bool test_str_delete_last_char(void);
- In
Str.Remove.c:14
:
bool test_str_pop_front(void);
bool test_str_remove(void);
bool test_str_remove_range(void);
bool test_str_delete_last_char(void);
bool test_str_delete(void);
- In
Str.Remove.c:15
:
bool test_str_remove(void);
bool test_str_remove_range(void);
bool test_str_delete_last_char(void);
bool test_str_delete(void);
bool test_str_delete_range(void);
- In
Str.Remove.c:16
:
bool test_str_remove_range(void);
bool test_str_delete_last_char(void);
bool test_str_delete(void);
bool test_str_delete_range(void);
- In
Str.Remove.c:17
:
bool test_str_delete_last_char(void);
bool test_str_delete(void);
bool test_str_delete_range(void);
// Test StrPopBack function
- In
Str.Remove.c:20
:
// Test StrPopBack function
bool test_str_pop_back(void) {
printf("Testing StrPopBack\n");
- In
Str.Remove.c:30
:
// Check that the character was popped correctly
bool result = (c == 'o' && ZstrCompare(s.data, "Hell") == 0);
// Pop another character without storing it - avoid passing NULL directly
- In
Str.Remove.c:44
:
// Test StrPopFront function
bool test_str_pop_front(void) {
printf("Testing StrPopFront\n");
- In
Str.Remove.c:54
:
// Check that the character was popped correctly
bool result = (c == 'H' && ZstrCompare(s.data, "ello") == 0);
// Pop another character without storing it - avoid passing NULL directly
- In
Str.Remove.c:68
:
// Test StrRemove function
bool test_str_remove(void) {
printf("Testing StrRemove\n");
- In
Str.Remove.c:78
:
// Check that the character was removed correctly
bool result = (c == 'l' && ZstrCompare(s.data, "Helo") == 0);
// Remove another character without storing it - avoid passing NULL directly
- In
Str.Remove.c:92
:
// Test StrRemoveRange function
bool test_str_remove_range(void) {
printf("Testing StrRemoveRange\n");
- In
Str.Remove.c:105
:
// Check that the characters were removed correctly
bool result = (ZstrCompare(buffer, " Worl") == 0 && ZstrCompare(s.data, "Hellod") == 0);
// Remove another range without storing it - use a temporary buffer instead of NULL
- In
Str.Remove.c:119
:
// Test StrDeleteLastChar function
bool test_str_delete_last_char(void) {
printf("Testing StrDeleteLastChar\n");
- In
Str.Remove.c:128
:
// Check that the character was deleted
bool result = (ZstrCompare(s.data, "Hell") == 0);
// Delete another character
- In
Str.Remove.c:141
:
// Test StrDelete function
bool test_str_delete(void) {
printf("Testing StrDelete\n");
- In
Str.Remove.c:150
:
// Check that the character was deleted
bool result = (ZstrCompare(s.data, "Helo") == 0);
// Delete another character
- In
Str.Remove.c:163
:
// Test StrDeleteRange function
bool test_str_delete_range(void) {
printf("Testing StrDeleteRange\n");
- In
Str.Remove.c:172
:
// Check that the characters were deleted
bool result = (ZstrCompare(s.data, "Hello") == 0);
// Delete another range
- In
Vec.Remove.c:11
:
// Function prototypes
bool test_vec_pop_back(void);
bool test_vec_pop_front(void);
bool test_vec_delete(void);
- In
Vec.Remove.c:12
:
// Function prototypes
bool test_vec_pop_back(void);
bool test_vec_pop_front(void);
bool test_vec_delete(void);
bool test_vec_delete_fast(void);
- In
Vec.Remove.c:13
:
bool test_vec_pop_back(void);
bool test_vec_pop_front(void);
bool test_vec_delete(void);
bool test_vec_delete_fast(void);
bool test_vec_delete_range(void);
- In
Vec.Remove.c:14
:
bool test_vec_pop_front(void);
bool test_vec_delete(void);
bool test_vec_delete_fast(void);
bool test_vec_delete_range(void);
bool test_vec_delete_range_fast(void);
- In
Vec.Remove.c:15
:
bool test_vec_delete(void);
bool test_vec_delete_fast(void);
bool test_vec_delete_range(void);
bool test_vec_delete_range_fast(void);
bool test_vec_delete_last(void);
- In
Vec.Remove.c:16
:
bool test_vec_delete_fast(void);
bool test_vec_delete_range(void);
bool test_vec_delete_range_fast(void);
bool test_vec_delete_last(void);
bool test_lvalue_delete_operations(void);
- In
Vec.Remove.c:17
:
bool test_vec_delete_range(void);
bool test_vec_delete_range_fast(void);
bool test_vec_delete_last(void);
bool test_lvalue_delete_operations(void);
bool test_rvalue_delete_operations(void);
- In
Vec.Remove.c:18
:
bool test_vec_delete_range_fast(void);
bool test_vec_delete_last(void);
bool test_lvalue_delete_operations(void);
bool test_rvalue_delete_operations(void);
bool test_lvalue_fast_delete_operations(void);
- In
Vec.Remove.c:19
:
bool test_vec_delete_last(void);
bool test_lvalue_delete_operations(void);
bool test_rvalue_delete_operations(void);
bool test_lvalue_fast_delete_operations(void);
bool test_rvalue_fast_delete_operations(void);
- In
Vec.Remove.c:20
:
bool test_lvalue_delete_operations(void);
bool test_rvalue_delete_operations(void);
bool test_lvalue_fast_delete_operations(void);
bool test_rvalue_fast_delete_operations(void);
bool test_lvalue_delete_range_operations(void);
- In
Vec.Remove.c:21
:
bool test_rvalue_delete_operations(void);
bool test_lvalue_fast_delete_operations(void);
bool test_rvalue_fast_delete_operations(void);
bool test_lvalue_delete_range_operations(void);
bool test_rvalue_delete_range_operations(void);
- In
Vec.Remove.c:22
:
bool test_lvalue_fast_delete_operations(void);
bool test_rvalue_fast_delete_operations(void);
bool test_lvalue_delete_range_operations(void);
bool test_rvalue_delete_range_operations(void);
bool test_lvalue_fast_delete_range_operations(void);
- In
Vec.Remove.c:23
:
bool test_rvalue_fast_delete_operations(void);
bool test_lvalue_delete_range_operations(void);
bool test_rvalue_delete_range_operations(void);
bool test_lvalue_fast_delete_range_operations(void);
bool test_rvalue_fast_delete_range_operations(void);
- In
Vec.Remove.c:24
:
bool test_lvalue_delete_range_operations(void);
bool test_rvalue_delete_range_operations(void);
bool test_lvalue_fast_delete_range_operations(void);
bool test_rvalue_fast_delete_range_operations(void);
- In
Vec.Remove.c:25
:
bool test_rvalue_delete_range_operations(void);
bool test_lvalue_fast_delete_range_operations(void);
bool test_rvalue_fast_delete_range_operations(void);
// Test VecPopBack function
- In
Vec.Remove.c:28
:
// Test VecPopBack function
bool test_vec_pop_back(void) {
printf("Testing VecPopBack\n");
- In
Vec.Remove.c:43
:
// Initial length should be 5
bool result = (vec.length == 5);
// Pop from the back
- In
Vec.Remove.c:76
:
// Test VecPopFront function
bool test_vec_pop_front(void) {
printf("Testing VecPopFront\n");
- In
Vec.Remove.c:91
:
// Initial length should be 5
bool result = (vec.length == 5);
// Pop from the front
- In
Vec.Remove.c:124
:
// Test VecDelete function
bool test_vec_delete(void) {
printf("Testing VecDelete\n");
- In
Vec.Remove.c:139
:
// Initial length should be 5
bool result = (vec.length == 5);
// Delete element at index 2 (value 30)
- In
Vec.Remove.c:172
:
// Test VecDeleteFast function
bool test_vec_delete_fast(void) {
printf("Testing VecDeleteFast\n");
- In
Vec.Remove.c:187
:
// Initial length should be 5
bool result = (vec.length == 5);
// Delete element at index 1 (value 20) using fast delete
- In
Vec.Remove.c:209
:
// Test VecDeleteRange function
bool test_vec_delete_range(void) {
printf("Testing VecDeleteRange\n");
- In
Vec.Remove.c:224
:
// Initial length should be 7
bool result = (vec.length == 7);
// Delete range from index 2 to 4 (values 30, 40, 50)
- In
Vec.Remove.c:245
:
// Test VecDeleteRangeFast
bool test_vec_delete_range_fast(void) {
printf("Testing VecDeleteRangeFast\n");
- In
Vec.Remove.c:259
:
// Initial length should be 10
bool result = (vec.length == 10);
// Print before state
- In
Vec.Remove.c:296
:
// Verify all values that should still be present
bool values_found[10] = {false};
for (size i = 0; i < vec.length; i++) {
int val = VecAt(&vec, i);
- In
Vec.Remove.c:321
:
// Test VecDeleteLast function
bool test_vec_delete_last(void) {
printf("Testing VecDeleteLast\n");
- In
Vec.Remove.c:336
:
// Initial length should be 5
bool result = (vec.length == 5);
// Delete the last element
- In
Vec.Remove.c:367
:
// Test L-value standard delete operations
bool test_lvalue_delete_operations(void) {
printf("Testing L-value standard delete operations\n");
- In
Vec.Remove.c:381
:
// Initial length should be 5
bool result = (vec.length == 5);
// Test L-value delete operation
- In
Vec.Remove.c:403
:
// Test R-value standard delete operations
bool test_rvalue_delete_operations(void) {
printf("Testing R-value standard delete operations\n");
- In
Vec.Remove.c:417
:
// Initial length should be 5
bool result = (vec.length == 5);
// Test R-value delete operation
- In
Vec.Remove.c:438
:
// Test L-value fast delete operations
bool test_lvalue_fast_delete_operations(void) {
printf("Testing L-value fast delete operations\n");
- In
Vec.Remove.c:452
:
// Initial length should be 5
bool result = (vec.length == 5);
// Print before state
- In
Vec.Remove.c:478
:
// Verify the deleted value is no longer present
bool containsValue = false;
for (size i = 0; i < vec.length; i++) {
if (VecAt(&vec, i) == valueToBeDeleted) {
- In
Vec.Remove.c:494
:
int expected_values[] = {10, 20, 40}; // 30 was deleted, 50 was moved
for (int i = 0; i < 3; i++) {
bool found = false;
for (size j = 0; j < vec.length; j++) {
if (VecAt(&vec, j) == expected_values[i]) {
- In
Vec.Remove.c:514
:
// Test R-value fast delete operations
bool test_rvalue_fast_delete_operations(void) {
printf("Testing R-value fast delete operations\n");
- In
Vec.Remove.c:528
:
// Initial length should be 5
bool result = (vec.length == 5);
// Print before state
- In
Vec.Remove.c:555
:
// Verify the deleted value is no longer present
bool containsValue = false;
for (size i = 0; i < vec.length; i++) {
if (VecAt(&vec, i) == valueToBeDeleted) {
- In
Vec.Remove.c:571
:
int expected_values[] = {10, 20, 40}; // 30 was deleted, 50 was moved
for (int i = 0; i < 3; i++) {
bool found = false;
for (size j = 0; j < vec.length; j++) {
if (VecAt(&vec, j) == expected_values[i]) {
- In
Vec.Remove.c:591
:
// Test L-value delete range operations
bool test_lvalue_delete_range_operations(void) {
printf("Testing L-value delete range operations\n");
- In
Vec.Remove.c:605
:
// Initial length should be 7
bool result = (vec.length == 7);
// Test L-value delete range operation
- In
Vec.Remove.c:628
:
// Test R-value delete range operations
bool test_rvalue_delete_range_operations(void) {
printf("Testing R-value delete range operations\n");
- In
Vec.Remove.c:642
:
// Initial length should be 7
bool result = (vec.length == 7);
// Test R-value delete range operation
- In
Vec.Remove.c:663
:
// Test L-value fast delete range operations
bool test_lvalue_fast_delete_range_operations(void) {
printf("Testing L-value fast delete range operations\n");
- In
Vec.Remove.c:677
:
// Initial length should be 7
bool result = (vec.length == 7);
// Print before state
- In
Vec.Remove.c:706
:
// Verify the deleted values are no longer present
for (int i = 0; i < 3; i++) {
bool found = false;
for (size j = 0; j < vec.length; j++) {
if (VecAt(&vec, j) == valuesToDelete[i]) {
- In
Vec.Remove.c:722
:
int remainingValues[] = {10, 20, 60, 70};
for (int i = 0; i < 4; i++) {
bool found = false;
for (size j = 0; j < vec.length; j++) {
if (VecAt(&vec, j) == remainingValues[i]) {
- In
Vec.Remove.c:742
:
// Test R-value fast delete range operations
bool test_rvalue_fast_delete_range_operations(void) {
printf("Testing R-value fast delete range operations\n");
- In
Vec.Remove.c:756
:
// Initial length should be 7
bool result = (vec.length == 7);
// Print before state
- In
Vec.Remove.c:783
:
// Verify the deleted values are no longer present
for (int i = 0; i < 3; i++) {
bool found = false;
for (size j = 0; j < vec.length; j++) {
if (VecAt(&vec, j) == valuesToDelete[i]) {
- In
Vec.Remove.c:799
:
int remainingValues[] = {10, 20, 60, 70};
for (int i = 0; i < 4; i++) {
bool found = false;
for (size j = 0; j < vec.length; j++) {
if (VecAt(&vec, j) == remainingValues[i]) {
// Function prototypes
bool test_bitvec_and(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
// Function prototypes
bool test_bitvec_and(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_and(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_bitwise_large_patterns(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_bitwise_large_patterns(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_bitwise_large_patterns(void);
// Test BitVecAnd function
// Test BitVecAnd function
bool test_bitvec_and(void) {
printf("Testing BitVecAnd\n");
// Expected result: 1000 (1101 AND 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == true);
test_result = test_result && (BitVecGet(&result, 1) == false);
// Test BitVecOr function
bool test_bitvec_or(void) {
printf("Testing BitVecOr\n");
// Expected result: 1110 (1100 OR 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == true);
test_result = test_result && (BitVecGet(&result, 1) == true);
// Test BitVecXor function
bool test_bitvec_xor(void) {
printf("Testing BitVecXor\n");
// Expected result: 0110 (1100 XOR 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == false);
test_result = test_result && (BitVecGet(&result, 1) == true);
// Test BitVecNot function
bool test_bitvec_not(void) {
printf("Testing BitVecNot\n");
// Expected result: 0101 (NOT 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == false);
test_result = test_result && (BitVecGet(&result, 1) == true);
// Test BitVecShiftLeft function - CORRECTED EXPECTATIONS
bool test_bitvec_shift_left(void) {
printf("Testing BitVecShiftLeft\n");
// After shift left by 2, implementation should clear bits that shift out
// and fill lower positions with 0
bool test_result = (bv.length == 4);
// Let me trace through the implementation:
// Test BitVecShiftRight function - CORRECTED EXPECTATIONS
bool test_bitvec_shift_right(void) {
printf("Testing BitVecShiftRight\n");
BitVecShiftRight(&bv, 2);
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Test BitVecRotateLeft function
bool test_bitvec_rotate_left(void) {
printf("Testing BitVecRotateLeft\n");
// Expected result: 1110 (1011 rotated left by 2)
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Test BitVecRotateRight function
bool test_bitvec_rotate_right(void) {
printf("Testing BitVecRotateRight\n");
// Expected result: 1101 (1011 rotated right by 1)
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Test BitVecReverse function
bool test_bitvec_reverse(void) {
printf("Testing BitVecReverse\n");
// Expected result: 1101 (1011 reversed)
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Edge case tests
bool test_bitvec_shift_edge_cases(void) {
printf("Testing BitVec shift edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test shift empty bitvec
}
bool test_bitvec_rotate_edge_cases(void) {
printf("Testing BitVec rotate edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test rotate empty bitvec
}
bool test_bitvec_bitwise_ops_edge_cases(void) {
printf("Testing BitVec bitwise operations edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test operations on empty bitvecs
}
bool test_bitvec_reverse_edge_cases(void) {
printf("Testing BitVecReverse edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test reverse empty bitvec
// NEW: Comprehensive bitwise operations testing
bool test_bitvec_bitwise_comprehensive(void) {
printf("Testing BitVec comprehensive bitwise operations\n");
BitVec bv2 = BitVecInit();
BitVec result = BitVecInit();
bool test_result = true;
// Test with different length operands
// Verify NOT correctness
for (int i = 0; i < 100; i++) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
for (int i = 0; i < 100; i++) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
}
// NEW: Comprehensive shift testing
bool test_bitvec_shift_comprehensive(void) {
printf("Testing BitVec comprehensive shift operations\n");
BitVec bv = BitVecInit();
bool result = true;
// Test shift with known pattern that will show data loss
// Should be different from original (lost MSB, gained LSB zero)
bool changed = false;
for (int i = 0; i < (int)original.length; i++) {
if (BitVecGet(&bv, i) != BitVecGet(&original, i)) {
// NEW: Comprehensive rotate testing
bool test_bitvec_rotate_comprehensive(void) {
printf("Testing BitVec comprehensive rotate operations\n");
BitVec bv = BitVecInit();
bool result = true;
// Test that rotate left by n, then rotate right by n restores original
// Should restore original
bool restored = true;
for (int i = 0; i < 8; i++) {
if (BitVecGet(&bv, i) != BitVecGet(&original, i)) {
BitVecRotateLeft(&bv, 16); // 8 * 2
bool unchanged = true;
for (int i = 0; i < 8; i++) {
if (BitVecGet(&bv, i) != BitVecGet(&original, i)) {
// NEW: Identity operations testing
bool test_bitvec_bitwise_identity_operations(void) {
printf("Testing BitVec bitwise identity operations\n");
BitVec bv2 = BitVecInit();
BitVec result = BitVecInit();
bool test_result = true;
// Create test pattern
// Test A AND A = A
BitVecAnd(&result, &bv1, &bv1);
bool and_identity = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != BitVecGet(&bv1, i)) {
// Test A OR A = A
BitVecOr(&result, &bv1, &bv1);
bool or_identity = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != BitVecGet(&bv1, i)) {
BitVecNot(&result, &result); // result = NOT(NOT(A))
bool double_not = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != BitVecGet(&bv1, i)) {
BitVecAnd(&result, &bv1, &bv2);
bool and_zero = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != false) {
BitVecOr(&result, &bv1, &bv2);
bool or_ones = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != true) {
// NEW: Commutative properties testing
bool test_bitvec_bitwise_commutative_properties(void) {
printf("Testing BitVec bitwise commutative properties\n");
BitVec result1 = BitVecInit();
BitVec result2 = BitVecInit();
bool test_result = true;
// Create different patterns
BitVecAnd(&result2, &bv2, &bv1);
bool and_commutative = true;
for (int i = 0; i < 12; i++) {
if (BitVecGet(&result1, i) != BitVecGet(&result2, i)) {
BitVecOr(&result2, &bv2, &bv1);
bool or_commutative = true;
for (int i = 0; i < 12; i++) {
if (BitVecGet(&result1, i) != BitVecGet(&result2, i)) {
BitVecXor(&result2, &bv2, &bv1);
bool xor_commutative = true;
for (int i = 0; i < 12; i++) {
if (BitVecGet(&result1, i) != BitVecGet(&result2, i)) {
// NEW: Large pattern testing
bool test_bitvec_bitwise_large_patterns(void) {
printf("Testing BitVec bitwise operations with large patterns\n");
BitVec bv2 = BitVecInit();
BitVec result = BitVecInit();
bool test_result = true;
// Create large bitvectors (1000 bits each)
// Verify result integrity - spot check a few positions
for (int i = 0; i < 1000; i += 77) { // Check every 77th bit
bool expected = (i % 7 == 0) && (i % 11 == 0);
bool actual = BitVecGet(&result, i);
test_result = test_result && (expected == actual);
for (int i = 0; i < 1000; i += 77) { // Check every 77th bit
bool expected = (i % 7 == 0) && (i % 11 == 0);
bool actual = BitVecGet(&result, i);
test_result = test_result && (expected == actual);
}
// Verify NOT correctness on sample
for (int i = 0; i < 1000; i += 123) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
for (int i = 0; i < 1000; i += 123) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
}
// Deadend tests
bool test_bitvec_bitwise_null_failures(void) {
printf("Testing BitVec bitwise NULL pointer handling\n");
}
bool test_bitvec_bitwise_ops_null_failures(void) {
printf("Testing BitVec bitwise operations NULL handling\n");
}
bool test_bitvec_reverse_null_failures(void) {
printf("Testing BitVec reverse NULL handling\n");
// NEW: Additional deadend tests
bool test_bitvec_shift_ops_null_failures(void) {
printf("Testing BitVec shift operations NULL handling\n");
}
bool test_bitvec_rotate_ops_null_failures(void) {
printf("Testing BitVec rotate operations NULL handling\n");
}
bool test_bitvec_and_result_null_failures(void) {
printf("Testing BitVec AND with NULL result handling\n");
}
bool test_bitvec_or_operand_null_failures(void) {
printf("Testing BitVec OR with NULL operand handling\n");
}
bool test_bitvec_xor_second_operand_null_failures(void) {
printf("Testing BitVec XOR with NULL second operand handling\n");
}
bool test_bitvec_not_null_failures(void) {
printf("Testing BitVec NOT with NULL handling\n");
// Deadend test prototypes (tests that should crash due to out-of-bounds access)
bool test_str_foreach_out_of_bounds_access(void);
bool test_str_foreach_idx_out_of_bounds_access(void);
bool test_str_foreach_idx_basic_out_of_bounds_access(void);
// Deadend test prototypes (tests that should crash due to out-of-bounds access)
bool test_str_foreach_out_of_bounds_access(void);
bool test_str_foreach_idx_out_of_bounds_access(void);
bool test_str_foreach_idx_basic_out_of_bounds_access(void);
bool test_str_foreach_reverse_idx_out_of_bounds_access(void);
bool test_str_foreach_out_of_bounds_access(void);
bool test_str_foreach_idx_out_of_bounds_access(void);
bool test_str_foreach_idx_basic_out_of_bounds_access(void);
bool test_str_foreach_reverse_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_idx_out_of_bounds_access(void);
bool test_str_foreach_idx_basic_out_of_bounds_access(void);
bool test_str_foreach_reverse_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_reverse_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_idx_basic_out_of_bounds_access(void);
bool test_str_foreach_reverse_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_reverse_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_in_range_idx_out_of_bounds_access(void);
bool test_str_foreach_reverse_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_reverse_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_in_range_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_reverse_ptr_idx_out_of_bounds_access(void);
bool test_str_foreach_ptr_in_range_idx_out_of_bounds_access(void);
// Deadend test: Make idx go out of bounds in StrForeachInRangeIdx by shrinking string during iteration
// Deadend test: Make idx go out of bounds in StrForeachInRangeIdx by shrinking string during iteration
bool test_str_foreach_out_of_bounds_access(void) {
printf("Testing StrForeachInRangeIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in StrForeachInRangeIdx by deleting characters
bool test_str_foreach_idx_out_of_bounds_access(void) {
printf("Testing StrForeachInRangeIdx with character deletion where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in StrForeachReverseIdx by modifying string during iteration
bool test_str_foreach_reverse_idx_out_of_bounds_access(void) {
printf("Testing StrForeachReverseIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in StrForeachPtrIdx by modifying string during iteration
bool test_str_foreach_ptr_idx_out_of_bounds_access(void) {
printf("Testing StrForeachPtrIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in StrForeachReversePtrIdx by modifying string during iteration
bool test_str_foreach_reverse_ptr_idx_out_of_bounds_access(void) {
printf("Testing StrForeachReversePtrIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in StrForeachPtrInRangeIdx by modifying string during iteration
bool test_str_foreach_ptr_in_range_idx_out_of_bounds_access(void) {
printf("Testing StrForeachPtrInRangeIdx where idx goes out of bounds (should crash)\n");
// Deadend test: Make idx go out of bounds in basic StrForeachIdx by modifying string during iteration
bool test_str_foreach_idx_basic_out_of_bounds_access(void) {
printf("Testing basic StrForeachIdx where idx goes out of bounds (should crash)\n");
- In
Io.Write.c:14
:
// Function prototypes
bool test_basic_formatting(void);
bool test_string_formatting(void);
bool test_integer_decimal_formatting(void);
- In
Io.Write.c:15
:
// Function prototypes
bool test_basic_formatting(void);
bool test_string_formatting(void);
bool test_integer_decimal_formatting(void);
bool test_integer_hex_formatting(void);
- In
Io.Write.c:16
:
bool test_basic_formatting(void);
bool test_string_formatting(void);
bool test_integer_decimal_formatting(void);
bool test_integer_hex_formatting(void);
bool test_integer_binary_formatting(void);
- In
Io.Write.c:17
:
bool test_string_formatting(void);
bool test_integer_decimal_formatting(void);
bool test_integer_hex_formatting(void);
bool test_integer_binary_formatting(void);
bool test_integer_octal_formatting(void);
- In
Io.Write.c:18
:
bool test_integer_decimal_formatting(void);
bool test_integer_hex_formatting(void);
bool test_integer_binary_formatting(void);
bool test_integer_octal_formatting(void);
bool test_float_basic_formatting(void);
- In
Io.Write.c:19
:
bool test_integer_hex_formatting(void);
bool test_integer_binary_formatting(void);
bool test_integer_octal_formatting(void);
bool test_float_basic_formatting(void);
bool test_float_precision_formatting(void);
- In
Io.Write.c:20
:
bool test_integer_binary_formatting(void);
bool test_integer_octal_formatting(void);
bool test_float_basic_formatting(void);
bool test_float_precision_formatting(void);
bool test_float_special_values(void);
- In
Io.Write.c:21
:
bool test_integer_octal_formatting(void);
bool test_float_basic_formatting(void);
bool test_float_precision_formatting(void);
bool test_float_special_values(void);
bool test_width_alignment_formatting(void);
- In
Io.Write.c:22
:
bool test_float_basic_formatting(void);
bool test_float_precision_formatting(void);
bool test_float_special_values(void);
bool test_width_alignment_formatting(void);
bool test_multiple_arguments(void);
- In
Io.Write.c:23
:
bool test_float_precision_formatting(void);
bool test_float_special_values(void);
bool test_width_alignment_formatting(void);
bool test_multiple_arguments(void);
bool test_error_handling(void);
- In
Io.Write.c:24
:
bool test_float_special_values(void);
bool test_width_alignment_formatting(void);
bool test_multiple_arguments(void);
bool test_error_handling(void);
bool test_char_formatting(void);
- In
Io.Write.c:25
:
bool test_width_alignment_formatting(void);
bool test_multiple_arguments(void);
bool test_error_handling(void);
bool test_char_formatting(void);
bool test_bitvec_formatting(void);
- In
Io.Write.c:26
:
bool test_multiple_arguments(void);
bool test_error_handling(void);
bool test_char_formatting(void);
bool test_bitvec_formatting(void);
- In
Io.Write.c:27
:
bool test_error_handling(void);
bool test_char_formatting(void);
bool test_bitvec_formatting(void);
// Test basic formatting features
- In
Io.Write.c:30
:
// Test basic formatting features
bool test_basic_formatting(void) {
printf("Testing basic formatting\n");
- In
Io.Write.c:34
:
Str output = StrInit();
bool success = true;
// Test empty format string
- In
Io.Write.c:60
:
// Test string formatting
bool test_string_formatting(void) {
printf("Testing string formatting\n");
- In
Io.Write.c:64
:
Str output = StrInit();
bool success = true;
// Test basic string
- In
Io.Write.c:102
:
// Test decimal integer formatting
bool test_integer_decimal_formatting(void) {
printf("Testing integer decimal formatting\n");
- In
Io.Write.c:106
:
Str output = StrInit();
bool success = true;
// Test signed integers
- In
Io.Write.c:175
:
// Test hexadecimal formatting
bool test_integer_hex_formatting(void) {
printf("Testing integer hexadecimal formatting\n");
- In
Io.Write.c:179
:
Str output = StrInit();
bool success = true;
u32 val = 0xDEADBEEF;
- In
Io.Write.c:194
:
// Test binary formatting
bool test_integer_binary_formatting(void) {
printf("Testing integer binary formatting\n");
- In
Io.Write.c:198
:
Str output = StrInit();
bool success = true;
u8 val = 0xA5; // 10100101 in binary
- In
Io.Write.c:209
:
// Test octal formatting
bool test_integer_octal_formatting(void) {
printf("Testing integer octal formatting\n");
- In
Io.Write.c:213
:
Str output = StrInit();
bool success = true;
u16 val = 0777;
- In
Io.Write.c:224
:
// Test basic floating point formatting
bool test_float_basic_formatting(void) {
printf("Testing basic floating point formatting\n");
- In
Io.Write.c:228
:
Str output = StrInit();
bool success = true;
f32 f32_val = 3.14159f;
- In
Io.Write.c:244
:
// Test floating point precision
bool test_float_precision_formatting(void) {
printf("Testing floating point precision formatting\n");
- In
Io.Write.c:248
:
Str output = StrInit();
bool success = true;
f64 val = 3.14159265359;
- In
Io.Write.c:269
:
// Test special floating point values
bool test_float_special_values(void) {
printf("Testing special floating point values\n");
- In
Io.Write.c:273
:
Str output = StrInit();
bool success = true;
// Test infinity
- In
Io.Write.c:296
:
// Test width and alignment formatting
bool test_width_alignment_formatting(void) {
printf("Testing width and alignment formatting\n");
- In
Io.Write.c:300
:
Str output = StrInit();
bool success = true;
// Test with integers
- In
Io.Write.c:334
:
// Test multiple arguments
bool test_multiple_arguments(void) {
printf("Testing multiple arguments\n");
- In
Io.Write.c:338
:
Str output = StrInit();
bool success = true;
const char* hello = "Hello";
- In
Io.Write.c:357
:
// Test character formatting specifiers
bool test_char_formatting(void) {
printf("Testing character formatting specifiers\n");
- In
Io.Write.c:361
:
Str output = StrInit();
bool success = true;
// Test mixed case string with :c (preserve case)
- In
Io.Write.c:549
:
// Test BitVec formatting
bool test_bitvec_formatting(void) {
printf("Testing BitVec formatting\n");
- In
Io.Write.c:553
:
Str output = StrInit();
bool success = true;
// Test 1: Basic binary formatting
- In
Vec.Init.c:18
:
// Define custom copy init and deinit functions for TestItem
bool TestItemCopyInit(TestItem* dst, TestItem* src) {
if (!dst || !src)
return false;
- In
Vec.Init.c:34
:
// Function prototypes
bool test_vec_init_basic(void);
bool test_vec_init_aligned(void);
bool test_vec_init_with_deep_copy(void);
- In
Vec.Init.c:35
:
// Function prototypes
bool test_vec_init_basic(void);
bool test_vec_init_aligned(void);
bool test_vec_init_with_deep_copy(void);
bool test_vec_init_aligned_with_deep_copy(void);
- In
Vec.Init.c:36
:
bool test_vec_init_basic(void);
bool test_vec_init_aligned(void);
bool test_vec_init_with_deep_copy(void);
bool test_vec_init_aligned_with_deep_copy(void);
bool test_vec_init_stack(void);
- In
Vec.Init.c:37
:
bool test_vec_init_aligned(void);
bool test_vec_init_with_deep_copy(void);
bool test_vec_init_aligned_with_deep_copy(void);
bool test_vec_init_stack(void);
bool test_vec_init_clone(void);
- In
Vec.Init.c:38
:
bool test_vec_init_with_deep_copy(void);
bool test_vec_init_aligned_with_deep_copy(void);
bool test_vec_init_stack(void);
bool test_vec_init_clone(void);
- In
Vec.Init.c:39
:
bool test_vec_init_aligned_with_deep_copy(void);
bool test_vec_init_stack(void);
bool test_vec_init_clone(void);
// Test basic vector initialization
- In
Vec.Init.c:42
:
// Test basic vector initialization
bool test_vec_init_basic(void) {
printf("Testing VecInit\n");
- In
Vec.Init.c:50
:
// Check initial state
bool result =
(vec.length == 0 && vec.capacity == 0 && vec.data == NULL && vec.alignment == 1 && vec.copy_init == NULL &&
vec.copy_deinit == NULL);
- In
Vec.Init.c:72
:
// Test aligned vector initialization
bool test_vec_init_aligned(void) {
printf("Testing VecInitAligned\n");
- In
Vec.Init.c:80
:
// Check initial state
bool result =
(vec.length == 0 && vec.capacity == 0 && vec.data == NULL && vec.alignment == 4 && vec.copy_init == NULL &&
vec.copy_deinit == NULL);
- In
Vec.Init.c:102
:
// Test vector initialization with deep copy functions
bool test_vec_init_with_deep_copy(void) {
printf("Testing VecInitWithDeepCopy\n");
- In
Vec.Init.c:110
:
// Check initial state
bool result =
(vec.length == 0 && vec.capacity == 0 && vec.data == NULL && vec.alignment == 1 &&
vec.copy_init == (GenericCopyInit)TestItemCopyInit && vec.copy_deinit == (GenericCopyDeinit)TestItemDeinit);
- In
Vec.Init.c:121
:
// Test vector initialization with alignment and deep copy functions
bool test_vec_init_aligned_with_deep_copy(void) {
printf("Testing VecInitAlignedWithDeepCopy\n");
- In
Vec.Init.c:129
:
// Check initial state
bool result =
(vec.length == 0 && vec.capacity == 0 && vec.data == NULL && vec.alignment == 8 &&
vec.copy_init == (GenericCopyInit)TestItemCopyInit && vec.copy_deinit == (GenericCopyDeinit)TestItemDeinit);
- In
Vec.Init.c:140
:
// Test vector stack initialization
bool test_vec_init_stack(void) {
printf("Testing VecInitStack\n");
- In
Vec.Init.c:143
:
printf("Testing VecInitStack\n");
bool result = true;
// Test with basic int type
- In
Vec.Init.c:212
:
// Test vector clone initialization
bool test_vec_init_clone(void) {
printf("Testing vector cloning\n");
- In
Vec.Init.c:231
:
// Check that the clone has the same data but different memory
bool result =
(clone.length == src.length && clone.capacity >= src.length && clone.data != src.data &&
clone.alignment == src.alignment);
// Function prototypes
bool test_str_foreach_idx(void);
bool test_str_foreach_reverse_idx(void);
bool test_str_foreach_ptr_idx(void);
// Function prototypes
bool test_str_foreach_idx(void);
bool test_str_foreach_reverse_idx(void);
bool test_str_foreach_ptr_idx(void);
bool test_str_foreach_reverse_ptr_idx(void);
bool test_str_foreach_idx(void);
bool test_str_foreach_reverse_idx(void);
bool test_str_foreach_ptr_idx(void);
bool test_str_foreach_reverse_ptr_idx(void);
bool test_str_foreach(void);
bool test_str_foreach_reverse_idx(void);
bool test_str_foreach_ptr_idx(void);
bool test_str_foreach_reverse_ptr_idx(void);
bool test_str_foreach(void);
bool test_str_foreach_reverse(void);
bool test_str_foreach_ptr_idx(void);
bool test_str_foreach_reverse_ptr_idx(void);
bool test_str_foreach(void);
bool test_str_foreach_reverse(void);
bool test_str_foreach_ptr(void);
bool test_str_foreach_reverse_ptr_idx(void);
bool test_str_foreach(void);
bool test_str_foreach_reverse(void);
bool test_str_foreach_ptr(void);
bool test_str_foreach_ptr_reverse(void);
bool test_str_foreach(void);
bool test_str_foreach_reverse(void);
bool test_str_foreach_ptr(void);
bool test_str_foreach_ptr_reverse(void);
bool test_str_foreach_in_range_idx(void);
bool test_str_foreach_reverse(void);
bool test_str_foreach_ptr(void);
bool test_str_foreach_ptr_reverse(void);
bool test_str_foreach_in_range_idx(void);
bool test_str_foreach_in_range(void);
bool test_str_foreach_ptr(void);
bool test_str_foreach_ptr_reverse(void);
bool test_str_foreach_in_range_idx(void);
bool test_str_foreach_in_range(void);
bool test_str_foreach_ptr_in_range_idx(void);
bool test_str_foreach_ptr_reverse(void);
bool test_str_foreach_in_range_idx(void);
bool test_str_foreach_in_range(void);
bool test_str_foreach_ptr_in_range_idx(void);
bool test_str_foreach_ptr_in_range(void);
bool test_str_foreach_in_range_idx(void);
bool test_str_foreach_in_range(void);
bool test_str_foreach_ptr_in_range_idx(void);
bool test_str_foreach_ptr_in_range(void);
bool test_str_foreach_in_range(void);
bool test_str_foreach_ptr_in_range_idx(void);
bool test_str_foreach_ptr_in_range(void);
// Test StrForeachIdx macro
// Test StrForeachIdx macro
bool test_str_foreach_idx(void) {
printf("Testing StrForeachIdx\n");
// The result should be "H0e1l2l3o4"
bool success = (ZstrCompare(result.data, "H0e1l2l3o4") == 0);
StrDeinit(&s);
// Test StrForeachReverseIdx macro
bool test_str_foreach_reverse_idx(void) {
printf("Testing StrForeachReverseIdx\n");
// Build a new string by iterating through each character in reverse with its index
Str result = StrInit();
bool saw_index_zero = false;
StrForeachReverseIdx(&s, chr, idx, {
// The expected result depends on whether index 0 is processed
bool success = false;
if (saw_index_zero) {
// The test output shows index 0 is processed, but the order is different than expected
// Test StrForeachPtrIdx macro
bool test_str_foreach_ptr_idx(void) {
printf("Testing StrForeachPtrIdx\n");
// The result should be "H0e1l2l3o4"
bool success = (ZstrCompare(result.data, "H0e1l2l3o4") == 0);
// The original string should now be "HELLO" (all uppercase)
// Test StrForeachReversePtrIdx macro
bool test_str_foreach_reverse_ptr_idx(void) {
printf("Testing StrForeachReversePtrIdx\n");
// Build a new string by iterating through each character pointer in reverse with its index
Str result = StrInit();
bool saw_index_zero = false;
StrForeachReversePtrIdx(&s, chrptr, idx, {
// The expected result depends on whether index 0 is processed
bool success = false;
if (saw_index_zero) {
// The test output shows index 0 is processed, but the order is different than expected
// Test StrForeach macro
bool test_str_foreach(void) {
printf("Testing StrForeach\n");
// The result should be "Hello"
bool success = (ZstrCompare(result.data, "Hello") == 0);
StrDeinit(&s);
// Test StrForeachReverse macro
bool test_str_foreach_reverse(void) {
printf("Testing StrForeachReverse\n");
// The expected result depends on whether all characters are processed
bool success = false;
if (char_count == s.length) {
success = (ZstrCompare(result.data, "olleH") == 0);
// Test StrForeachPtr macro
bool test_str_foreach_ptr(void) {
printf("Testing StrForeachPtr\n");
// The result should be "Hello" (original values before modification)
bool success = (ZstrCompare(result.data, "Hello") == 0);
// The original string should now be "HELLO" (all uppercase)
// Test StrForeachPtrReverse macro
bool test_str_foreach_ptr_reverse(void) {
printf("Testing StrForeachPtrReverse\n");
// The expected result depends on whether all characters are processed
bool success = false;
if (char_count == s.length) {
success = (ZstrCompare(result.data, "olleH") == 0);
// Test StrForeachInRangeIdx macro
bool test_str_foreach_in_range_idx(void) {
printf("Testing StrForeachInRangeIdx\n");
// The result should be "W6o7r8l9d10" (characters from index 6-10 with their indices)
bool success = (ZstrCompare(result.data, "W6o7r8l9d10") == 0);
// Test with empty range
// Test StrForeachInRange macro
bool test_str_foreach_in_range(void) {
printf("Testing StrForeachInRange\n");
// The result should be "Hello" (first 5 characters)
bool success = (ZstrCompare(result.data, "Hello") == 0);
// Test with range at the end of the string
// Test StrForeachPtrInRangeIdx macro
bool test_str_foreach_ptr_in_range_idx(void) {
printf("Testing StrForeachPtrInRangeIdx\n");
// The result should be "W6o7r8l9d10" (characters from index 6-10 with their indices)
bool success = (ZstrCompare(result.data, "W6o7r8l9d10") == 0);
// The original string should now have "WORLD" in uppercase
// Test StrForeachPtrInRange macro
bool test_str_foreach_ptr_in_range(void) {
printf("Testing StrForeachPtrInRange\n");
// The result should be "Hello" (first 5 characters)
bool success = (ZstrCompare(result.data, "Hello") == 0);
// The original string should now have "HELLO" in uppercase
// Function prototypes
bool test_bitvec_and(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
// Function prototypes
bool test_bitvec_and(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_and(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_or(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_xor(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_not(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_shift_left(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_right(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_left(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_rotate_right(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_shift_edge_cases(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_rotate_edge_cases(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_bitwise_ops_edge_cases(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_reverse_edge_cases(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_comprehensive(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_shift_comprehensive(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_bitwise_large_patterns(void);
bool test_bitvec_rotate_comprehensive(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_bitwise_large_patterns(void);
bool test_bitvec_bitwise_identity_operations(void);
bool test_bitvec_bitwise_commutative_properties(void);
bool test_bitvec_bitwise_large_patterns(void);
// Test BitVecAnd function
// Test BitVecAnd function
bool test_bitvec_and(void) {
printf("Testing BitVecAnd\n");
// Expected result: 1000 (1101 AND 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == true);
test_result = test_result && (BitVecGet(&result, 1) == false);
// Test BitVecOr function
bool test_bitvec_or(void) {
printf("Testing BitVecOr\n");
// Expected result: 1110 (1100 OR 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == true);
test_result = test_result && (BitVecGet(&result, 1) == true);
// Test BitVecXor function
bool test_bitvec_xor(void) {
printf("Testing BitVecXor\n");
// Expected result: 0110 (1100 XOR 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == false);
test_result = test_result && (BitVecGet(&result, 1) == true);
// Test BitVecNot function
bool test_bitvec_not(void) {
printf("Testing BitVecNot\n");
// Expected result: 0101 (NOT 1010)
bool test_result = (result.length == 4);
test_result = test_result && (BitVecGet(&result, 0) == false);
test_result = test_result && (BitVecGet(&result, 1) == true);
// Test BitVecShiftLeft function - CORRECTED EXPECTATIONS
bool test_bitvec_shift_left(void) {
printf("Testing BitVecShiftLeft\n");
// After shift left by 2, implementation should clear bits that shift out
// and fill lower positions with 0
bool test_result = (bv.length == 4);
// Let me trace through the implementation:
// Test BitVecShiftRight function - CORRECTED EXPECTATIONS
bool test_bitvec_shift_right(void) {
printf("Testing BitVecShiftRight\n");
BitVecShiftRight(&bv, 2);
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Test BitVecRotateLeft function
bool test_bitvec_rotate_left(void) {
printf("Testing BitVecRotateLeft\n");
// Expected result: 1110 (1011 rotated left by 2)
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Test BitVecRotateRight function
bool test_bitvec_rotate_right(void) {
printf("Testing BitVecRotateRight\n");
// Expected result: 1101 (1011 rotated right by 1)
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Test BitVecReverse function
bool test_bitvec_reverse(void) {
printf("Testing BitVecReverse\n");
// Expected result: 1101 (1011 reversed)
bool test_result = (bv.length == 4);
test_result = test_result && (BitVecGet(&bv, 0) == true);
test_result = test_result && (BitVecGet(&bv, 1) == true);
// Edge case tests
bool test_bitvec_shift_edge_cases(void) {
printf("Testing BitVec shift edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test shift empty bitvec
}
bool test_bitvec_rotate_edge_cases(void) {
printf("Testing BitVec rotate edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test rotate empty bitvec
}
bool test_bitvec_bitwise_ops_edge_cases(void) {
printf("Testing BitVec bitwise operations edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test operations on empty bitvecs
}
bool test_bitvec_reverse_edge_cases(void) {
printf("Testing BitVecReverse edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test reverse empty bitvec
// NEW: Comprehensive bitwise operations testing
bool test_bitvec_bitwise_comprehensive(void) {
printf("Testing BitVec comprehensive bitwise operations\n");
BitVec bv2 = BitVecInit();
BitVec result = BitVecInit();
bool test_result = true;
// Test with different length operands
// Verify NOT correctness
for (int i = 0; i < 100; i++) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
for (int i = 0; i < 100; i++) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
}
// NEW: Comprehensive shift testing
bool test_bitvec_shift_comprehensive(void) {
printf("Testing BitVec comprehensive shift operations\n");
BitVec bv = BitVecInit();
bool result = true;
// Test shift with known pattern that will show data loss
// Should be different from original (lost MSB, gained LSB zero)
bool changed = false;
for (int i = 0; i < (int)original.length; i++) {
if (BitVecGet(&bv, i) != BitVecGet(&original, i)) {
// NEW: Comprehensive rotate testing
bool test_bitvec_rotate_comprehensive(void) {
printf("Testing BitVec comprehensive rotate operations\n");
BitVec bv = BitVecInit();
bool result = true;
// Test that rotate left by n, then rotate right by n restores original
// Should restore original
bool restored = true;
for (int i = 0; i < 8; i++) {
if (BitVecGet(&bv, i) != BitVecGet(&original, i)) {
BitVecRotateLeft(&bv, 16); // 8 * 2
bool unchanged = true;
for (int i = 0; i < 8; i++) {
if (BitVecGet(&bv, i) != BitVecGet(&original, i)) {
// NEW: Identity operations testing
bool test_bitvec_bitwise_identity_operations(void) {
printf("Testing BitVec bitwise identity operations\n");
BitVec bv2 = BitVecInit();
BitVec result = BitVecInit();
bool test_result = true;
// Create test pattern
// Test A AND A = A
BitVecAnd(&result, &bv1, &bv1);
bool and_identity = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != BitVecGet(&bv1, i)) {
// Test A OR A = A
BitVecOr(&result, &bv1, &bv1);
bool or_identity = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != BitVecGet(&bv1, i)) {
BitVecNot(&result, &result); // result = NOT(NOT(A))
bool double_not = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != BitVecGet(&bv1, i)) {
BitVecAnd(&result, &bv1, &bv2);
bool and_zero = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != false) {
BitVecOr(&result, &bv1, &bv2);
bool or_ones = true;
for (int i = 0; i < 16; i++) {
if (BitVecGet(&result, i) != true) {
// NEW: Commutative properties testing
bool test_bitvec_bitwise_commutative_properties(void) {
printf("Testing BitVec bitwise commutative properties\n");
BitVec result1 = BitVecInit();
BitVec result2 = BitVecInit();
bool test_result = true;
// Create different patterns
BitVecAnd(&result2, &bv2, &bv1);
bool and_commutative = true;
for (int i = 0; i < 12; i++) {
if (BitVecGet(&result1, i) != BitVecGet(&result2, i)) {
BitVecOr(&result2, &bv2, &bv1);
bool or_commutative = true;
for (int i = 0; i < 12; i++) {
if (BitVecGet(&result1, i) != BitVecGet(&result2, i)) {
BitVecXor(&result2, &bv2, &bv1);
bool xor_commutative = true;
for (int i = 0; i < 12; i++) {
if (BitVecGet(&result1, i) != BitVecGet(&result2, i)) {
// NEW: Large pattern testing
bool test_bitvec_bitwise_large_patterns(void) {
printf("Testing BitVec bitwise operations with large patterns\n");
BitVec bv2 = BitVecInit();
BitVec result = BitVecInit();
bool test_result = true;
// Create large bitvectors (1000 bits each)
// Verify result integrity - spot check a few positions
for (int i = 0; i < 1000; i += 77) { // Check every 77th bit
bool expected = (i % 7 == 0) && (i % 11 == 0);
bool actual = BitVecGet(&result, i);
test_result = test_result && (expected == actual);
for (int i = 0; i < 1000; i += 77) { // Check every 77th bit
bool expected = (i % 7 == 0) && (i % 11 == 0);
bool actual = BitVecGet(&result, i);
test_result = test_result && (expected == actual);
}
// Verify NOT correctness on sample
for (int i = 0; i < 1000; i += 123) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
for (int i = 0; i < 1000; i += 123) {
bool original = BitVecGet(&bv1, i);
bool inverted = BitVecGet(&result, i);
test_result = test_result && (original != inverted);
}
- In
Str.Access.c:11
:
// Function prototypes
bool test_str_first(void);
bool test_str_last(void);
bool test_str_begin(void);
- In
Str.Access.c:12
:
// Function prototypes
bool test_str_first(void);
bool test_str_last(void);
bool test_str_begin(void);
bool test_str_end(void);
- In
Str.Access.c:13
:
bool test_str_first(void);
bool test_str_last(void);
bool test_str_begin(void);
bool test_str_end(void);
bool test_str_char_at(void);
- In
Str.Access.c:14
:
bool test_str_last(void);
bool test_str_begin(void);
bool test_str_end(void);
bool test_str_char_at(void);
bool test_str_char_ptr_at(void);
- In
Str.Access.c:15
:
bool test_str_begin(void);
bool test_str_end(void);
bool test_str_char_at(void);
bool test_str_char_ptr_at(void);
- In
Str.Access.c:16
:
bool test_str_end(void);
bool test_str_char_at(void);
bool test_str_char_ptr_at(void);
// Test StrFirst function
- In
Str.Access.c:19
:
// Test StrFirst function
bool test_str_first(void) {
printf("Testing StrFirst\n");
- In
Str.Access.c:28
:
// Check that the character is correct
bool result = (first == 'H');
StrDeinit(&s);
- In
Str.Access.c:35
:
// Test StrLast function
bool test_str_last(void) {
printf("Testing StrLast\n");
- In
Str.Access.c:44
:
// Check that the character is correct
bool result = (last == 'o');
StrDeinit(&s);
- In
Str.Access.c:51
:
// Test StrBegin function
bool test_str_begin(void) {
printf("Testing StrBegin\n");
- In
Str.Access.c:60
:
// Check that the pointer is correct
bool result = (begin == s.data && *begin == 'H');
StrDeinit(&s);
- In
Str.Access.c:67
:
// Test StrEnd function
bool test_str_end(void) {
printf("Testing StrEnd\n");
- In
Str.Access.c:76
:
// Check that the pointer is correct
bool result = (end == s.data + s.length && *end == '\0');
StrDeinit(&s);
- In
Str.Access.c:83
:
// Test StrCharAt function
bool test_str_char_at(void) {
printf("Testing StrCharAt\n");
- In
Str.Access.c:97
:
// Check that the characters are correct
bool result = (c0 == 'H' && c1 == 'e' && c2 == 'l' && c3 == 'l' && c4 == 'o');
StrDeinit(&s);
- In
Str.Access.c:104
:
// Test StrCharPtrAt function
bool test_str_char_ptr_at(void) {
printf("Testing StrCharPtrAt\n");
- In
Str.Access.c:118
:
// Check that the pointers are correct
bool result = (*p0 == 'H' && *p1 == 'e' && *p2 == 'l' && *p3 == 'l' && *p4 == 'o');
// Also check that the pointers are at the expected positions
// Function prototypes
bool test_bitvec_to_string(void);
bool test_bitvec_from_string(void);
bool test_bitvec_to_bytes(void);
// Function prototypes
bool test_bitvec_to_string(void);
bool test_bitvec_from_string(void);
bool test_bitvec_to_bytes(void);
bool test_bitvec_from_bytes(void);
bool test_bitvec_to_string(void);
bool test_bitvec_from_string(void);
bool test_bitvec_to_bytes(void);
bool test_bitvec_from_bytes(void);
bool test_bitvec_to_integer(void);
bool test_bitvec_from_string(void);
bool test_bitvec_to_bytes(void);
bool test_bitvec_from_bytes(void);
bool test_bitvec_to_integer(void);
bool test_bitvec_from_integer(void);
bool test_bitvec_to_bytes(void);
bool test_bitvec_from_bytes(void);
bool test_bitvec_to_integer(void);
bool test_bitvec_from_integer(void);
bool test_bitvec_convert_edge_cases(void);
bool test_bitvec_from_bytes(void);
bool test_bitvec_to_integer(void);
bool test_bitvec_from_integer(void);
bool test_bitvec_convert_edge_cases(void);
bool test_bitvec_from_string_edge_cases(void);
bool test_bitvec_to_integer(void);
bool test_bitvec_from_integer(void);
bool test_bitvec_convert_edge_cases(void);
bool test_bitvec_from_string_edge_cases(void);
bool test_bitvec_bytes_conversion_edge_cases(void);
bool test_bitvec_from_integer(void);
bool test_bitvec_convert_edge_cases(void);
bool test_bitvec_from_string_edge_cases(void);
bool test_bitvec_bytes_conversion_edge_cases(void);
bool test_bitvec_integer_conversion_edge_cases(void);
bool test_bitvec_convert_edge_cases(void);
bool test_bitvec_from_string_edge_cases(void);
bool test_bitvec_bytes_conversion_edge_cases(void);
bool test_bitvec_integer_conversion_edge_cases(void);
bool test_bitvec_round_trip_conversions(void);
bool test_bitvec_from_string_edge_cases(void);
bool test_bitvec_bytes_conversion_edge_cases(void);
bool test_bitvec_integer_conversion_edge_cases(void);
bool test_bitvec_round_trip_conversions(void);
bool test_bitvec_conversion_bounds_checking(void);
bool test_bitvec_bytes_conversion_edge_cases(void);
bool test_bitvec_integer_conversion_edge_cases(void);
bool test_bitvec_round_trip_conversions(void);
bool test_bitvec_conversion_bounds_checking(void);
bool test_bitvec_conversion_comprehensive(void);
bool test_bitvec_integer_conversion_edge_cases(void);
bool test_bitvec_round_trip_conversions(void);
bool test_bitvec_conversion_bounds_checking(void);
bool test_bitvec_conversion_comprehensive(void);
bool test_bitvec_large_scale_conversions(void);
bool test_bitvec_round_trip_conversions(void);
bool test_bitvec_conversion_bounds_checking(void);
bool test_bitvec_conversion_comprehensive(void);
bool test_bitvec_large_scale_conversions(void);
bool test_bitvec_convert_null_failures(void);
bool test_bitvec_conversion_bounds_checking(void);
bool test_bitvec_conversion_comprehensive(void);
bool test_bitvec_large_scale_conversions(void);
bool test_bitvec_convert_null_failures(void);
bool test_bitvec_from_string_null_failures(void);
bool test_bitvec_conversion_comprehensive(void);
bool test_bitvec_large_scale_conversions(void);
bool test_bitvec_convert_null_failures(void);
bool test_bitvec_from_string_null_failures(void);
bool test_bitvec_bytes_null_failures(void);
bool test_bitvec_large_scale_conversions(void);
bool test_bitvec_convert_null_failures(void);
bool test_bitvec_from_string_null_failures(void);
bool test_bitvec_bytes_null_failures(void);
bool test_bitvec_bytes_bounds_failures(void);
bool test_bitvec_convert_null_failures(void);
bool test_bitvec_from_string_null_failures(void);
bool test_bitvec_bytes_null_failures(void);
bool test_bitvec_bytes_bounds_failures(void);
bool test_bitvec_integer_bounds_failures(void);
bool test_bitvec_from_string_null_failures(void);
bool test_bitvec_bytes_null_failures(void);
bool test_bitvec_bytes_bounds_failures(void);
bool test_bitvec_integer_bounds_failures(void);
bool test_bitvec_bytes_null_failures(void);
bool test_bitvec_bytes_bounds_failures(void);
bool test_bitvec_integer_bounds_failures(void);
// Test BitVecToStr function
// Test BitVecToStr function
bool test_bitvec_to_string(void) {
printf("Testing BitVecToStr\n");
// Check result
bool result = (str.length == 4);
result = result && (str.data[0] == '1');
result = result && (str.data[1] == '0');
// Test BitVecFromStr function
bool test_bitvec_from_string(void) {
printf("Testing BitVecFromStr\n");
// Check result
bool result = (bv.length == 4);
result = result && (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
// Test BitVecToBytes function
bool test_bitvec_to_bytes(void) {
printf("Testing BitVecToBytes\n");
// Check result
bool result = (byte_count == 1);
if (result) {
// Expected byte value depends on bit ordering
// Test BitVecFromBytes function
bool test_bitvec_from_bytes(void) {
printf("Testing BitVecFromBytes\n");
// Check result (8 bits from 1 byte)
bool result = (bv.length == 8);
// The exact bit order depends on implementation
// Test BitVecToInteger function
bool test_bitvec_to_integer(void) {
printf("Testing BitVecToInteger\n");
// BitVecToInteger uses LSB-first: bit[i] contributes (1ULL << i)
// So: bit[0]*1 + bit[1]*2 + bit[2]*4 + bit[3]*8 = 1*1 + 0*2 + 1*4 + 1*8 = 13
bool result = (value == 13);
// Test with larger pattern
// Test BitVecFromInteger function
bool test_bitvec_from_integer(void) {
printf("Testing BitVecFromInteger\n");
// Check result
bool result = (bv.length == 4);
// Count ones and zeros
// All bits should be false
bool all_false = true;
for (u64 i = 0; i < zero_bv.length; i++) {
if (BitVecGet(&zero_bv, i)) {
// Edge case tests
bool test_bitvec_convert_edge_cases(void) {
printf("Testing BitVec convert edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test converting empty bitvec
}
bool test_bitvec_from_string_edge_cases(void) {
printf("Testing BitVecFromStr edge cases\n");
printf("Testing BitVecFromStr edge cases\n");
bool result = true;
// Test empty string
}
bool test_bitvec_bytes_conversion_edge_cases(void) {
printf("Testing BitVec bytes conversion edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvec to bytes
}
bool test_bitvec_integer_conversion_edge_cases(void) {
printf("Testing BitVec integer conversion edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvec to integer
// Round-trip conversion tests
bool test_bitvec_round_trip_conversions(void) {
printf("Testing BitVec round-trip conversions\n");
printf("Testing BitVec round-trip conversions\n");
bool result = true;
// Test string round-trip
// Bounds checking tests
bool test_bitvec_conversion_bounds_checking(void) {
printf("Testing BitVec conversion bounds checking\n");
printf("Testing BitVec conversion bounds checking\n");
bool result = true;
// Test large integer conversion (should cap at 64 bits)
// Comprehensive conversion validation
bool test_bitvec_conversion_comprehensive(void) {
printf("Testing BitVec comprehensive conversion validation\n");
printf("Testing BitVec comprehensive conversion validation\n");
bool result = true;
// Test specific bit patterns with exact expectations
// At least two of them should match (bit order might affect one)
bool cross_match = (ZstrCompare(str1.data, str2.data) == 0) || (ZstrCompare(str1.data, str3.data) == 0) ||
(ZstrCompare(str2.data, str3.data) == 0);
result = result && cross_match;
// Large-scale conversion tests
bool test_bitvec_large_scale_conversions(void) {
printf("Testing BitVec large-scale conversions\n");
printf("Testing BitVec large-scale conversions\n");
bool result = true;
// Test with very large bitvectors
// Verify pattern consistency
bool pattern_correct = true;
for (u64 i = 0; i < large_str.length; i++) {
bool expected = (i % 3) == 0;
bool pattern_correct = true;
for (u64 i = 0; i < large_str.length; i++) {
bool expected = (i % 3) == 0;
bool actual = (large_str.data[i] == '1');
if (expected != actual) {
for (u64 i = 0; i < large_str.length; i++) {
bool expected = (i % 3) == 0;
bool actual = (large_str.data[i] == '1');
if (expected != actual) {
pattern_correct = false;
// Verify recovered pattern
bool recovered_pattern_correct = true;
for (u64 i = 0; i < recovered_bv.length; i++) {
bool expected = (i % 3) == 0;
bool recovered_pattern_correct = true;
for (u64 i = 0; i < recovered_bv.length; i++) {
bool expected = (i % 3) == 0;
bool actual = BitVecGet(&recovered_bv, i);
if (expected != actual) {
for (u64 i = 0; i < recovered_bv.length; i++) {
bool expected = (i % 3) == 0;
bool actual = BitVecGet(&recovered_bv, i);
if (expected != actual) {
recovered_pattern_correct = false;
// Verify pattern
bool large_pattern_correct = true;
for (u64 i = 0; i < large_from_str.length; i++) {
bool expected = (i % 7) == 0;
bool large_pattern_correct = true;
for (u64 i = 0; i < large_from_str.length; i++) {
bool expected = (i % 7) == 0;
bool actual = BitVecGet(&large_from_str, i);
if (expected != actual) {
for (u64 i = 0; i < large_from_str.length; i++) {
bool expected = (i % 7) == 0;
bool actual = BitVecGet(&large_from_str, i);
if (expected != actual) {
large_pattern_correct = false;
// Enhanced deadend tests
bool test_bitvec_bytes_bounds_failures(void) {
printf("Testing BitVec bytes bounds failures\n");
u8 dummy_bytes[1] = {0xFF};
BitVec empty_bv = BitVecFromBytes(dummy_bytes, 0);
bool result = (empty_bv.length == 0);
BitVecDeinit(&empty_bv);
}
bool test_bitvec_integer_bounds_failures(void) {
printf("Testing BitVec integer bounds failures\n");
// Deadend tests
bool test_bitvec_convert_null_failures(void) {
printf("Testing BitVec convert NULL pointer handling\n");
}
bool test_bitvec_from_string_null_failures(void) {
printf("Testing BitVec from string NULL handling\n");
}
bool test_bitvec_bytes_null_failures(void) {
printf("Testing BitVec bytes NULL handling\n");
- In
Str.Init.c:11
:
// Function prototypes
bool test_str_init(void);
bool test_str_init_from_cstr(void);
bool test_str_init_from_zstr(void);
- In
Str.Init.c:12
:
// Function prototypes
bool test_str_init(void);
bool test_str_init_from_cstr(void);
bool test_str_init_from_zstr(void);
bool test_str_init_from_str(void);
- In
Str.Init.c:13
:
bool test_str_init(void);
bool test_str_init_from_cstr(void);
bool test_str_init_from_zstr(void);
bool test_str_init_from_str(void);
bool test_str_dup(void);
- In
Str.Init.c:14
:
bool test_str_init_from_cstr(void);
bool test_str_init_from_zstr(void);
bool test_str_init_from_str(void);
bool test_str_dup(void);
bool test_str_printf(void);
- In
Str.Init.c:15
:
bool test_str_init_from_zstr(void);
bool test_str_init_from_str(void);
bool test_str_dup(void);
bool test_str_printf(void);
bool test_str_init_stack(void);
- In
Str.Init.c:16
:
bool test_str_init_from_str(void);
bool test_str_dup(void);
bool test_str_printf(void);
bool test_str_init_stack(void);
bool test_str_init_copy(void);
- In
Str.Init.c:17
:
bool test_str_dup(void);
bool test_str_printf(void);
bool test_str_init_stack(void);
bool test_str_init_copy(void);
bool test_str_deinit(void);
- In
Str.Init.c:18
:
bool test_str_printf(void);
bool test_str_init_stack(void);
bool test_str_init_copy(void);
bool test_str_deinit(void);
- In
Str.Init.c:19
:
bool test_str_init_stack(void);
bool test_str_init_copy(void);
bool test_str_deinit(void);
// Test StrInit function
- In
Str.Init.c:22
:
// Test StrInit function
bool test_str_init(void) {
printf("Testing StrInit\n");
- In
Str.Init.c:32
:
// Check that it's initialized correctly
// A newly initialized string may have NULL data if capacity is 0
bool result = (s.length == 0);
StrDeinit(&s);
- In
Str.Init.c:39
:
// Test StrInitFromCstr function
bool test_str_init_from_cstr(void) {
printf("Testing StrInitFromCstr\n");
- In
Str.Init.c:50
:
// Check that it's initialized correctly
bool result = (s.length == len && ZstrCompareN(s.data, test_str, len) == 0 && s.data[len] == '\0');
StrDeinit(&s);
- In
Str.Init.c:57
:
// Test StrInitFromZstr function
bool test_str_init_from_zstr(void) {
printf("Testing StrInitFromZstr\n");
- In
Str.Init.c:67
:
// Check that it's initialized correctly
bool result = (s.length == strlen(test_str) && ZstrCompare(s.data, test_str) == 0);
StrDeinit(&s);
- In
Str.Init.c:74
:
// Test StrInitFromStr function
bool test_str_init_from_str(void) {
printf("Testing StrInitFromStr\n");
- In
Str.Init.c:85
:
// Check that dst is initialized correctly
bool result = (dst.length == src.length && ZstrCompare(dst.data, src.data) == 0);
StrDeinit(&src);
- In
Str.Init.c:93
:
// Test StrDup function (alias for StrInitFromStr)
bool test_str_dup(void) {
printf("Testing StrDup\n");
- In
Str.Init.c:104
:
// Check that dst is initialized correctly
bool result = (dst.length == src.length && ZstrCompare(dst.data, src.data) == 0);
StrDeinit(&src);
- In
Str.Init.c:112
:
// Test StrPrintf function
bool test_str_printf(void) {
printf("Testing StrPrintf\n");
- In
Str.Init.c:122
:
// Check that it's initialized correctly
bool result = (ZstrCompare(s.data, "Hello, World!") == 0);
StrDeinit(&s);
- In
Str.Init.c:129
:
// Test StrInitStack macro
bool test_str_init_stack(void) {
printf("Testing StrInitStack\n");
- In
Str.Init.c:132
:
printf("Testing StrInitStack\n");
bool result = true;
// Test with the actual StrInitStack macro
- In
Str.Init.c:163
:
// Test StrInitCopy function
bool test_str_init_copy(void) {
printf("Testing StrInitCopy\n");
- In
Str.Init.c:170
:
// Copy src to dst
bool success = StrInitCopy(&dst, &src);
// Validate both strings
- In
Str.Init.c:177
:
// Check that the copy was successful
bool result = (success && dst.length == src.length && ZstrCompare(dst.data, src.data) == 0);
StrDeinit(&src);
- In
Str.Init.c:185
:
// Test StrDeinit function
bool test_str_deinit(void) {
printf("Testing StrDeinit\n");
- In
Io.Read.c:19
:
// Helper function for comparing floats with epsilon
static bool float_equals(float a, float b) {
return fabs(a - b) < FLOAT_EPSILON;
}
- In
Io.Read.c:24
:
// Helper function for comparing doubles with epsilon
static bool double_equals(double a, double b) {
return fabs(a - b) < DOUBLE_EPSILON;
}
- In
Io.Read.c:29
:
// Function prototypes
bool test_integer_decimal_reading(void);
bool test_integer_hex_reading(void);
bool test_integer_binary_reading(void);
- In
Io.Read.c:30
:
// Function prototypes
bool test_integer_decimal_reading(void);
bool test_integer_hex_reading(void);
bool test_integer_binary_reading(void);
bool test_integer_octal_reading(void);
- In
Io.Read.c:31
:
bool test_integer_decimal_reading(void);
bool test_integer_hex_reading(void);
bool test_integer_binary_reading(void);
bool test_integer_octal_reading(void);
bool test_float_basic_reading(void);
- In
Io.Read.c:32
:
bool test_integer_hex_reading(void);
bool test_integer_binary_reading(void);
bool test_integer_octal_reading(void);
bool test_float_basic_reading(void);
bool test_float_scientific_reading(void);
- In
Io.Read.c:33
:
bool test_integer_binary_reading(void);
bool test_integer_octal_reading(void);
bool test_float_basic_reading(void);
bool test_float_scientific_reading(void);
bool test_string_reading(void);
- In
Io.Read.c:34
:
bool test_integer_octal_reading(void);
bool test_float_basic_reading(void);
bool test_float_scientific_reading(void);
bool test_string_reading(void);
bool test_multiple_arguments_reading(void);
- In
Io.Read.c:35
:
bool test_float_basic_reading(void);
bool test_float_scientific_reading(void);
bool test_string_reading(void);
bool test_multiple_arguments_reading(void);
bool test_error_handling_reading(void);
- In
Io.Read.c:36
:
bool test_float_scientific_reading(void);
bool test_string_reading(void);
bool test_multiple_arguments_reading(void);
bool test_error_handling_reading(void);
bool test_character_ordinal_reading(void);
- In
Io.Read.c:37
:
bool test_string_reading(void);
bool test_multiple_arguments_reading(void);
bool test_error_handling_reading(void);
bool test_character_ordinal_reading(void);
bool test_string_case_conversion_reading(void);
- In
Io.Read.c:38
:
bool test_multiple_arguments_reading(void);
bool test_error_handling_reading(void);
bool test_character_ordinal_reading(void);
bool test_string_case_conversion_reading(void);
bool test_bitvec_reading(void);
- In
Io.Read.c:39
:
bool test_error_handling_reading(void);
bool test_character_ordinal_reading(void);
bool test_string_case_conversion_reading(void);
bool test_bitvec_reading(void);
- In
Io.Read.c:40
:
bool test_character_ordinal_reading(void);
bool test_string_case_conversion_reading(void);
bool test_bitvec_reading(void);
// Test decimal integer reading
- In
Io.Read.c:43
:
// Test decimal integer reading
bool test_integer_decimal_reading(void) {
printf("Testing integer decimal reading\n");
- In
Io.Read.c:46
:
printf("Testing integer decimal reading\n");
bool success = true;
// Test signed integers
- In
Io.Read.c:125
:
// Test hexadecimal integer reading
bool test_integer_hex_reading(void) {
printf("Testing integer hexadecimal reading\n");
- In
Io.Read.c:128
:
printf("Testing integer hexadecimal reading\n");
bool success = true;
u32 val = 0;
- In
Io.Read.c:155
:
// Test binary integer reading
bool test_integer_binary_reading(void) {
printf("Testing integer binary reading\n");
- In
Io.Read.c:158
:
printf("Testing integer binary reading\n");
bool success = true;
i8 val = 0;
- In
Io.Read.c:177
:
// Test octal integer reading
bool test_integer_octal_reading(void) {
printf("Testing integer octal reading\n");
- In
Io.Read.c:180
:
printf("Testing integer octal reading\n");
bool success = true;
i32 val = 0;
- In
Io.Read.c:203
:
// Test basic float reading
bool test_float_basic_reading(void) {
printf("Testing basic float reading\n");
- In
Io.Read.c:206
:
printf("Testing basic float reading\n");
bool success = true;
// Test basic float values
- In
Io.Read.c:240
:
// Test scientific notation reading
bool test_float_scientific_reading(void) {
printf("Testing scientific notation reading\n");
- In
Io.Read.c:243
:
printf("Testing scientific notation reading\n");
bool success = true;
f64 val = 0.0;
- In
Io.Read.c:278
:
// Test string reading
bool test_string_reading(void) {
printf("Testing string reading\n");
- In
Io.Read.c:281
:
printf("Testing string reading\n");
bool success = true;
// Test basic string reading
- In
Io.Read.c:305
:
// Test reading multiple arguments
bool test_multiple_arguments_reading(void) {
printf("Testing multiple arguments reading\n");
- In
Io.Read.c:308
:
printf("Testing multiple arguments reading\n");
bool success = true;
i32 num = 0;
- In
Io.Read.c:337
:
// Test error handling
bool test_error_handling_reading(void) {
printf("Testing error handling for reading\n");
- In
Io.Read.c:343
:
// when invalid input is provided
bool success = true;
// Test mismatched format
- In
Io.Read.c:365
:
// Test character ordinal reading with :c format specifier
bool test_character_ordinal_reading(void) {
printf("Testing character ordinal reading with :c format specifier\n");
- In
Io.Read.c:368
:
printf("Testing character ordinal reading with :c format specifier\n");
bool success = true;
// Test reading single character into u8
- In
Io.Read.c:422
:
u16_val = 0;
StrReadFmt("AB", "{c}", u16_val);
bool u16_multi_pass = (ZstrCompareN((const char*)&u16_val, "AB", 2) == 0);
printf("u16_val multi-char test: comparing memory with 'AB', pass = %s\n", u16_multi_pass ? "true" : "false");
printf(
- In
Io.Read.c:436
:
i16_val = 0;
StrReadFmt("CD", "{c}", i16_val);
bool i16_multi_pass = (ZstrCompareN((const char*)&i16_val, "CD", 2) == 0);
printf("i16_val multi-char test: comparing memory with 'CD', pass = %s\n", i16_multi_pass ? "true" : "false");
success = success && i16_multi_pass;
- In
Io.Read.c:443
:
u32_val = 0;
StrReadFmt("EFGH", "{c}", u32_val);
bool u32_multi_pass = (ZstrCompareN((const char*)&u32_val, "EFGH", 4) == 0);
printf("u32_val multi-char test: comparing memory with 'EFGH', pass = %s\n", u32_multi_pass ? "true" : "false");
success = success && u32_multi_pass;
- In
Io.Read.c:450
:
i32_val = 0;
StrReadFmt("IJKL", "{c}", i32_val);
bool i32_multi_pass = (ZstrCompareN((const char*)&i32_val, "IJKL", 4) == 0);
printf("i32_val multi-char test: comparing memory with 'IJKL', pass = %s\n", i32_multi_pass ? "true" : "false");
success = success && i32_multi_pass;
- In
Io.Read.c:457
:
u64_val = 0;
StrReadFmt("MNOPQRST", "{c}", u64_val);
bool u64_multi_pass = (ZstrCompareN((const char*)&u64_val, "MNOPQRST", 8) == 0);
printf("u64_val multi-char test: comparing memory with 'MNOPQRST', pass = %s\n", u64_multi_pass ? "true" : "false");
success = success && u64_multi_pass;
- In
Io.Read.c:464
:
i64_val = 0;
StrReadFmt("UVWXYZab", "{c}", i64_val);
bool i64_multi_pass = (ZstrCompareN((const char*)&i64_val, "UVWXYZab", 8) == 0);
printf("i64_val multi-char test: comparing memory with 'UVWXYZab', pass = %s\n", i64_multi_pass ? "true" : "false");
success = success && i64_multi_pass;
- In
Io.Read.c:471
:
f32 f32_val = 0.0f;
StrReadFmt("A", "{c}", f32_val);
bool f32_pass = (f32_val == (f32)'A');
printf("f32_val = %f, expected = %f, pass = %s\n", f32_val, (f32)'A', f32_pass ? "true" : "false");
success = success && f32_pass;
- In
Io.Read.c:477
:
f64 f64_val = 0.0;
StrReadFmt("B", "{c}", f64_val);
bool f64_pass = (f64_val == (f64)'B');
printf("f64_val = %f, expected = %f, pass = %s\n", f64_val, (f64)'B', f64_pass ? "true" : "false");
success = success && f64_pass;
- In
Io.Read.c:484
:
u8_val = 0;
StrReadFmt("~", "{c}", u8_val);
bool tilde_pass = (u8_val == '~');
printf("u8_val = %d, expected = %d (~), pass = %s\n", u8_val, '~', tilde_pass ? "true" : "false");
success = success && tilde_pass;
- In
Io.Read.c:491
:
u32_val = 0;
StrReadFmt("XY", "{c}", u32_val);
bool xy_pass = (ZstrCompareN((const char*)&u32_val, "XY", 2) == 0);
printf("u32_val partial test: comparing memory with 'XY', pass = %s\n", xy_pass ? "true" : "false");
success = success && xy_pass;
- In
Io.Read.c:497
:
u64_val = 0;
StrReadFmt("abc", "{c}", u64_val);
bool abc_pass = (ZstrCompareN((const char*)&u64_val, "abc", 3) == 0);
printf("u64_val partial test: comparing memory with 'abc', pass = %s\n", abc_pass ? "true" : "false");
success = success && abc_pass;
- In
Io.Read.c:506
:
Str expected = StrInitFromZstr("Hello");
bool str_pass = (StrCmp(&str_val, &expected) == 0);
printf("str_val test: comparing with 'Hello', pass = %s\n", str_pass ? "true" : "false");
success = success && str_pass;
- In
Io.Read.c:517
:
expected = StrInitFromZstr("World");
bool quoted_str_pass = (StrCmp(&str_val, &expected) == 0);
printf("quoted str_val test: comparing with 'World', pass = %s\n", quoted_str_pass ? "true" : "false");
success = success && quoted_str_pass;
- In
Io.Read.c:528
:
// Test string case conversion with :a and :A format specifiers
bool test_string_case_conversion_reading(void) {
printf("Testing string case conversion with :a and :A format specifiers\n");
- In
Io.Read.c:531
:
printf("Testing string case conversion with :a and :A format specifiers\n");
bool success = true;
// Test 1: :a (lowercase) conversion
- In
Io.Read.c:549
:
// Should read "hello" (stops at first space)
Str expected = StrInitFromZstr("hello");
bool test1_pass = (StrCmp(&result, &expected) == 0);
printf("Expected: 'hello', Pass: %s\n\n", test1_pass ? "true" : "false");
success = success && test1_pass;
- In
Io.Read.c:573
:
// Should read "HELLO" (stops at first space)
Str expected = StrInitFromZstr("HELLO");
bool test2_pass = (StrCmp(&result, &expected) == 0);
printf("Expected: 'HELLO', Pass: %s\n\n", test2_pass ? "true" : "false");
success = success && test2_pass;
- In
Io.Read.c:597
:
// Should read "mixed case" (converts the entire quoted string)
Str expected = StrInitFromZstr("mixed case");
bool test3_pass = (StrCmp(&result, &expected) == 0);
printf("Expected: 'mixed case', Pass: %s\n\n", test3_pass ? "true" : "false");
success = success && test3_pass;
- In
Io.Read.c:621
:
// Should read "ABC123XYZ" (only letters are converted, numbers unchanged)
Str expected = StrInitFromZstr("ABC123XYZ");
bool test4_pass = (StrCmp(&result, &expected) == 0);
printf("Expected: 'ABC123XYZ', Pass: %s\n\n", test4_pass ? "true" : "false");
success = success && test4_pass;
- In
Io.Read.c:645
:
// Should read "Hello" (stops at first space, no case conversion)
Str expected = StrInitFromZstr("Hello");
bool test5_pass = (StrCmp(&result, &expected) == 0);
printf("Expected: 'Hello', Pass: %s\n\n", test5_pass ? "true" : "false");
success = success && test5_pass;
- In
Io.Read.c:658
:
// Test BitVec reading
bool test_bitvec_reading(void) {
printf("Testing BitVec reading\n");
- In
Io.Read.c:661
:
printf("Testing BitVec reading\n");
bool success = true;
// Test 1: Reading binary string
- In
BitVec.Type.c:11
:
// Function prototypes
bool test_bitvec_type_basic(void);
bool test_bitvec_validate(void);
- In
BitVec.Type.c:12
:
// Function prototypes
bool test_bitvec_type_basic(void);
bool test_bitvec_validate(void);
// Test basic BitVec type functionality
- In
BitVec.Type.c:15
:
// Test basic BitVec type functionality
bool test_bitvec_type_basic(void) {
printf("Testing basic BitVec type functionality\n");
- In
BitVec.Type.c:22
:
// Check initial state
bool result = (bitvec.length == 0 && bitvec.capacity == 0 && bitvec.data == NULL && bitvec.byte_size == 0);
// Clean up
- In
BitVec.Type.c:31
:
// Test ValidateBitVec macro
bool test_bitvec_validate(void) {
printf("Testing ValidateBitVec macro\n");
- In
Vec.Ops.c:10
:
// Function prototypes
bool test_vec_swap_items(void);
bool test_vec_reverse(void);
bool test_vec_sort(void);
- In
Vec.Ops.c:11
:
// Function prototypes
bool test_vec_swap_items(void);
bool test_vec_reverse(void);
bool test_vec_sort(void);
- In
Vec.Ops.c:12
:
bool test_vec_swap_items(void);
bool test_vec_reverse(void);
bool test_vec_sort(void);
// Comparison function for sorting integers in ascending order
- In
Vec.Ops.c:29
:
// Test VecSwapItems function
bool test_vec_swap_items(void) {
printf("Testing VecSwapItems\n");
- In
Vec.Ops.c:46
:
// Check that the elements were swapped
bool result = (VecAt(&vec, 0) == 50 && VecAt(&vec, 4) == 10);
// Swap two elements in the middle
- In
Vec.Ops.c:64
:
// Test VecReverse function
bool test_vec_reverse(void) {
printf("Testing VecReverse\n");
- In
Vec.Ops.c:81
:
// Check that the elements are reversed
bool result = true;
for (size i = 0; i < vec.length; i++) {
result = result && (VecAt(&vec, i) == values[4 - i]);
- In
Vec.Ops.c:116
:
// Test VecSort function
bool test_vec_sort(void) {
printf("Testing VecSort\n");
- In
Vec.Ops.c:133
:
// Check that the elements are sorted
bool result = true;
int sorted_asc[] = {10, 20, 30, 40, 50};
for (size i = 0; i < vec.length; i++) {
// Function prototypes
bool test_bitvec_foreach_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
// Function prototypes
bool test_bitvec_foreach_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_reverse_idx(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_reverse(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_in_range_idx(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_in_range(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_edge_cases(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_idx_edge_cases(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_foreach_reverse_edge_cases(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_foreach_range_edge_cases(void);
bool test_bitvec_foreach_stress_test(void);
bool test_bitvec_foreach_invalid_usage(void);
// BitVecRunLengths test prototypes
// BitVecRunLengths test prototypes
bool test_bitvec_run_lengths_basic(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
// BitVecRunLengths test prototypes
bool test_bitvec_run_lengths_basic(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_basic(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_edge_cases(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_boundary_conditions(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_stress_test(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
// Test BitVecForeachIdx macro
bool test_bitvec_foreach_idx(void) {
printf("Testing BitVecForeachIdx macro\n");
// Test forward iteration with index
u64 count = 0;
bool pattern_correct = true;
BitVecForeachIdx(&bv, bit, idx, {
});
bool result = (count == 4) && pattern_correct;
// Clean up
// Test BitVecForeach macro
bool test_bitvec_foreach(void) {
printf("Testing BitVecForeach macro\n");
});
bool result = (true_count == 2) && (false_count == 1);
// Clean up
// Test BitVecForeachReverseIdx macro
bool test_bitvec_foreach_reverse_idx(void) {
printf("Testing BitVecForeachReverseIdx macro\n");
// Test reverse iteration with index
u64 count = 0;
bool first_bit_is_false = false; // Should be last bit when iterating in reverse
BitVecForeachReverseIdx(&bv, bit, idx, {
});
bool result = (count == 4) && first_bit_is_false;
// Clean up
// Test BitVecForeachReverse macro
bool test_bitvec_foreach_reverse(void) {
printf("Testing BitVecForeachReverse macro\n");
// Test reverse iteration
u64 count = 0;
bool first_is_true = false; // Should be the last bit (true)
BitVecForeachReverse(&bv, bit, {
});
bool result = (count == 3) && first_is_true;
// Clean up
// Test BitVecForeachInRangeIdx macro
bool test_bitvec_foreach_in_range_idx(void) {
printf("Testing BitVecForeachInRangeIdx macro\n");
// Test range iteration from index 1 to 4 (exclusive)
u64 count = 0;
bool range_correct = true;
BitVecForeachInRangeIdx(&bv, bit, idx, 1, 4, {
});
bool result = (count == 3) && range_correct;
// Clean up
// Test BitVecForeachInRange macro
bool test_bitvec_foreach_in_range(void) {
printf("Testing BitVecForeachInRange macro\n");
});
bool result = (true_count == 2) && (false_count == 0);
// Clean up
// Edge case tests
bool test_bitvec_foreach_edge_cases(void) {
printf("Testing BitVec foreach edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
int count = 0;
}
bool test_bitvec_foreach_idx_edge_cases(void) {
printf("Testing BitVec foreach idx edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
u64 last_idx = SIZE_MAX;
}
bool test_bitvec_foreach_reverse_edge_cases(void) {
printf("Testing BitVec foreach reverse edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test reverse foreach on empty bitvec
BitVecPush(&bv, true); // idx 2
bool expected_sequence[] = {true, false, true}; // Reverse order
int seq_idx = 0;
BitVecForeachReverse(&bv, bit, {
}
bool test_bitvec_foreach_range_edge_cases(void) {
printf("Testing BitVec foreach range edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Setup test data
}
bool test_bitvec_foreach_stress_test(void) {
printf("Testing BitVec foreach stress test\n");
printf("Testing BitVec foreach stress test\n");
bool result = true;
for (int sz = 0; sz < 100; sz += 10) {
// BitVecRunLengths test implementations
bool test_bitvec_run_lengths_basic(void) {
printf("Testing BitVecRunLengths basic functionality\n");
BitVec bv = BitVecInit();
bool result = true;
// Test pattern: 11100101 (3 true, 2 false, 1 true, 1 false, 1 true)
u64 runs[10];
bool values[10];
u64 count = BitVecRunLengths(&bv, runs, values, 10);
}
bool test_bitvec_run_lengths_edge_cases(void) {
printf("Testing BitVecRunLengths edge cases\n");
printf("Testing BitVecRunLengths edge cases\n");
bool result = true;
// Test 1: Empty bitvector
BitVec empty_bv = BitVecInit();
u64 runs[5];
bool values[5];
u64 count = BitVecRunLengths(&empty_bv, runs, values, 5);
result = result && (count == 0);
}
u64 alt_runs[10];
bool alt_values[10];
count = BitVecRunLengths(&alternating_bv, alt_runs, alt_values, 10);
result = result && (count == 7); // Each bit is its own run
}
bool test_bitvec_run_lengths_boundary_conditions(void) {
printf("Testing BitVecRunLengths boundary conditions\n");
BitVec bv = BitVecInit();
bool result = true;
// Create pattern with many runs: 10101010 (8 runs)
// Test with limited max_runs
u64 runs[3];
bool values[3];
u64 count = BitVecRunLengths(&bv, runs, values, 3);
// Test with exact number of runs needed
u64 large_runs[8];
bool large_values[8];
count = BitVecRunLengths(&bv, large_runs, large_values, 8);
result = result && (count == 8);
}
bool test_bitvec_run_lengths_stress_test(void) {
printf("Testing BitVecRunLengths stress test\n");
printf("Testing BitVecRunLengths stress test\n");
bool result = true;
// Test with large bitvector
// Pattern: blocks of 5 same bits, alternating true/false
for (int block = 0; block < 100; block++) {
bool value = (block % 2 == 0);
for (int i = 0; i < 5; i++) {
BitVecPush(&large_bv, value);
u64 runs[200];
bool values[200];
u64 count = BitVecRunLengths(&large_bv, runs, values, 200);
// Pattern: 1111000011100010000111 (variable length runs)
// Run 1: 4 trues, Run 2: 4 falses, Run 3: 3 trues, Run 4: 3 falses, Run 5: 1 true, Run 6: 4 falses, Run 7: 3 trues
bool pattern[] = {1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1};
int pattern_len = sizeof(pattern) / sizeof(pattern[0]);
u64 small_runs[10];
bool small_values[10];
count = BitVecRunLengths(&large_bv, small_runs, small_values, 10);
- In
Str.Ops.c:12
:
// Function prototypes
bool test_str_cmp(void);
bool test_str_find(void);
bool test_str_starts_ends_with(void);
- In
Str.Ops.c:13
:
// Function prototypes
bool test_str_cmp(void);
bool test_str_find(void);
bool test_str_starts_ends_with(void);
bool test_str_replace(void);
- In
Str.Ops.c:14
:
bool test_str_cmp(void);
bool test_str_find(void);
bool test_str_starts_ends_with(void);
bool test_str_replace(void);
bool test_str_split(void);
- In
Str.Ops.c:15
:
bool test_str_find(void);
bool test_str_starts_ends_with(void);
bool test_str_replace(void);
bool test_str_split(void);
bool test_str_strip(void);
- In
Str.Ops.c:16
:
bool test_str_starts_ends_with(void);
bool test_str_replace(void);
bool test_str_split(void);
bool test_str_strip(void);
- In
Str.Ops.c:17
:
bool test_str_replace(void);
bool test_str_split(void);
bool test_str_strip(void);
// Test string comparison functions
- In
Str.Ops.c:20
:
// Test string comparison functions
bool test_str_cmp(void) {
printf("Testing StrCmp and StrCmpCstr\n");
- In
Str.Ops.c:30
:
// Test StrCmp with equal strings
int cmp1 = StrCmp(&s1, &s2);
bool result = (cmp1 == 0);
// Test StrCmp with different strings (H < W in ASCII)
- In
Str.Ops.c:55
:
// Test string find functions
bool test_str_find(void) {
printf("Testing StrFindStr, StrFindZstr, and StrFindCstr\n");
- In
Str.Ops.c:65
:
// Test StrFindStr with match at end
const char* found1 = StrFindStr(&haystack, &needle1);
bool result = (found1 != NULL && ZstrCompare(found1, "World") == 0);
// Test StrFindStr with match at beginning
- In
Str.Ops.c:91
:
// Test string starts/ends with functions
bool test_str_starts_ends_with(void) {
printf("Testing StrStartsWith and StrEndsWith variants\n");
- In
Str.Ops.c:99
:
// Test StrStartsWith
bool result = StrStartsWith(&s, &prefix);
// Test StrEndsWith
- In
Str.Ops.c:127
:
// Test string replace functions
bool test_str_replace(void) {
printf("Testing StrReplace variants\n");
- In
Str.Ops.c:133
:
Str s1 = StrInitFromZstr("Hello World");
StrReplaceZstr(&s1, "World", "Universe", 1);
bool result = (ZstrCompare(s1.data, "Hello Universe") == 0);
// Test multiple replacements
- In
Str.Ops.c:162
:
// Test string split functions
bool test_str_split(void) {
printf("Testing StrSplit and StrSplitToIters\n");
- In
Str.Ops.c:169
:
Strs split = StrSplit(&s, ",");
bool result = (split.length == 3);
if (split.length >= 3) {
result = result && (ZstrCompare(split.data[0].data, "Hello") == 0);
- In
Str.Ops.c:208
:
// Test string strip functions
bool test_str_strip(void) {
printf("Testing StrStrip variants\n");
- In
Str.Ops.c:214
:
Str s1 = StrInitFromZstr(" Hello ");
Str stripped = StrLStrip(&s1, NULL);
bool result = (ZstrCompare(stripped.data, "Hello ") == 0);
StrDeinit(&stripped);
// Function prototypes
bool test_bitvec_basic_pattern_functions(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
// Function prototypes
bool test_bitvec_basic_pattern_functions(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_basic_pattern_functions(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
// Test basic pattern matching functions
// Test basic pattern matching functions
bool test_bitvec_basic_pattern_functions(void) {
printf("Testing basic BitVec pattern functions\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 11010011101
// Test BitVecFindPattern function comprehensively
bool test_bitvec_find_pattern(void) {
printf("Testing BitVecFindPattern function\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 110101011010
// Create source: 110101011010
for (int i = 0; i < 12; i++) {
bool bit = (i % 4 == 0 || i % 4 == 1 || i % 4 == 3);
BitVecPush(&source, bit);
}
// Test BitVecFindLastPattern function
bool test_bitvec_find_last_pattern(void) {
printf("Testing BitVecFindLastPattern function\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source with multiple pattern occurrences: 101010101
// Test BitVecFindAllPattern function
bool test_bitvec_find_all_pattern(void) {
printf("Testing BitVecFindAllPattern function\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 10101010101
// Source: 110110110
for (int i = 0; i < 9; i++) {
bool bit = (i % 3 == 0 || i % 3 == 1);
BitVecPush(&source, bit);
}
// Test edge cases for pattern functions
bool test_bitvec_pattern_edge_cases(void) {
printf("Testing BitVec pattern edge cases\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Test empty pattern
// Stress tests with large data
bool test_bitvec_pattern_stress_tests(void) {
printf("Testing BitVec pattern stress tests\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create large source with known pattern
// BitVecStartsWith tests
bool test_bitvec_starts_with_basic(void) {
printf("Testing BitVecStartsWith basic functionality\n");
BitVec source = BitVecInit();
BitVec prefix = BitVecInit();
bool result = true;
// Create source: 110101
}
bool test_bitvec_starts_with_edge_cases(void) {
printf("Testing BitVecStartsWith edge cases\n");
BitVec source = BitVecInit();
BitVec prefix = BitVecInit();
bool result = true;
// Test empty prefix (should always match)
// BitVecEndsWith tests
bool test_bitvec_ends_with_basic(void) {
printf("Testing BitVecEndsWith basic functionality\n");
BitVec source = BitVecInit();
BitVec suffix = BitVecInit();
bool result = true;
// Create source: 110101
}
bool test_bitvec_ends_with_edge_cases(void) {
printf("Testing BitVecEndsWith edge cases\n");
BitVec source = BitVecInit();
BitVec suffix = BitVecInit();
bool result = true;
// Test empty suffix (should always match)
// BitVecFindPattern tests (replacing BitVecContains)
bool test_bitvec_contains_basic(void) {
printf("Testing BitVecFindPattern basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 1101011
// BitVecContainsAt tests
bool test_bitvec_contains_at_basic(void) {
printf("Testing BitVecContainsAt basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 1101011
}
bool test_bitvec_contains_at_edge_cases(void) {
printf("Testing BitVecContainsAt edge cases\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create small source
// BitVecCountPattern tests
bool test_bitvec_count_pattern_basic(void) {
printf("Testing BitVecCountPattern basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 101010101
// BitVecRFindPattern tests
bool test_bitvec_rfind_pattern_basic(void) {
printf("Testing BitVecRFindPattern basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 101101101
// BitVecReplace tests
bool test_bitvec_replace_basic(void) {
printf("Testing BitVecReplace basic functionality\n");
BitVec old_pattern = BitVecInit();
BitVec new_pattern = BitVecInit();
bool result = true;
// Create source: 110110
BitVecPush(&new_pattern, true);
bool replaced = BitVecReplace(&source, &old_pattern, &new_pattern);
result = result && replaced;
// BitVecReplaceAll tests
bool test_bitvec_replace_all_basic(void) {
printf("Testing BitVecReplaceAll basic functionality\n");
BitVec old_pattern = BitVecInit();
BitVec new_pattern = BitVecInit();
bool result = true;
// Create source: 110110110
// BitVecMatches tests
bool test_bitvec_matches_basic(void) {
printf("Testing BitVecMatches basic functionality\n");
BitVec pattern = BitVecInit();
BitVec wildcard = BitVecInit();
bool result = true;
// Create source: 1101
// BitVecFuzzyMatch tests
bool test_bitvec_fuzzy_match_basic(void) {
printf("Testing BitVecFuzzyMatch basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 110100111
// BitVecRegexMatch tests
bool test_bitvec_regex_match_basic(void) {
printf("Testing BitVecRegexMatch basic functionality\n");
BitVec source = BitVecInit();
bool result = true;
// Create source: 101010
// BitVecPrefixMatch tests
bool test_bitvec_prefix_match_basic(void) {
printf("Testing BitVecPrefixMatch basic functionality\n");
BitVec source = BitVecInit();
BitVecs patterns = VecInitWithDeepCopy(NULL, BitVecDeinit);
bool result = true;
VecResize(&patterns, 3);
// BitVecSuffixMatch tests
bool test_bitvec_suffix_match_basic(void) {
printf("Testing BitVecSuffixMatch basic functionality\n");
BitVec source = BitVecInit();
BitVecs patterns = VecInitWithDeepCopy(NULL, BitVecDeinit);
bool result = true;
VecResize(&patterns, 3);
- In
BitVec.Math.c:12
:
// Function prototypes for all Math tests
bool test_bitvec_hamming_distance_basic(void);
bool test_bitvec_hamming_distance_edge_cases(void);
bool test_bitvec_jaccard_similarity_basic(void);
- In
BitVec.Math.c:13
:
// Function prototypes for all Math tests
bool test_bitvec_hamming_distance_basic(void);
bool test_bitvec_hamming_distance_edge_cases(void);
bool test_bitvec_jaccard_similarity_basic(void);
bool test_bitvec_jaccard_similarity_edge_cases(void);
- In
BitVec.Math.c:14
:
bool test_bitvec_hamming_distance_basic(void);
bool test_bitvec_hamming_distance_edge_cases(void);
bool test_bitvec_jaccard_similarity_basic(void);
bool test_bitvec_jaccard_similarity_edge_cases(void);
bool test_bitvec_cosine_similarity_basic(void);
- In
BitVec.Math.c:15
:
bool test_bitvec_hamming_distance_edge_cases(void);
bool test_bitvec_jaccard_similarity_basic(void);
bool test_bitvec_jaccard_similarity_edge_cases(void);
bool test_bitvec_cosine_similarity_basic(void);
bool test_bitvec_cosine_similarity_edge_cases(void);
- In
BitVec.Math.c:16
:
bool test_bitvec_jaccard_similarity_basic(void);
bool test_bitvec_jaccard_similarity_edge_cases(void);
bool test_bitvec_cosine_similarity_basic(void);
bool test_bitvec_cosine_similarity_edge_cases(void);
bool test_bitvec_dot_product_basic(void);
- In
BitVec.Math.c:17
:
bool test_bitvec_jaccard_similarity_edge_cases(void);
bool test_bitvec_cosine_similarity_basic(void);
bool test_bitvec_cosine_similarity_edge_cases(void);
bool test_bitvec_dot_product_basic(void);
bool test_bitvec_dot_product_edge_cases(void);
- In
BitVec.Math.c:18
:
bool test_bitvec_cosine_similarity_basic(void);
bool test_bitvec_cosine_similarity_edge_cases(void);
bool test_bitvec_dot_product_basic(void);
bool test_bitvec_dot_product_edge_cases(void);
bool test_bitvec_edit_distance_basic(void);
- In
BitVec.Math.c:19
:
bool test_bitvec_cosine_similarity_edge_cases(void);
bool test_bitvec_dot_product_basic(void);
bool test_bitvec_dot_product_edge_cases(void);
bool test_bitvec_edit_distance_basic(void);
bool test_bitvec_edit_distance_edge_cases(void);
- In
BitVec.Math.c:20
:
bool test_bitvec_dot_product_basic(void);
bool test_bitvec_dot_product_edge_cases(void);
bool test_bitvec_edit_distance_basic(void);
bool test_bitvec_edit_distance_edge_cases(void);
bool test_bitvec_correlation_basic(void);
- In
BitVec.Math.c:21
:
bool test_bitvec_dot_product_edge_cases(void);
bool test_bitvec_edit_distance_basic(void);
bool test_bitvec_edit_distance_edge_cases(void);
bool test_bitvec_correlation_basic(void);
bool test_bitvec_correlation_edge_cases(void);
- In
BitVec.Math.c:22
:
bool test_bitvec_edit_distance_basic(void);
bool test_bitvec_edit_distance_edge_cases(void);
bool test_bitvec_correlation_basic(void);
bool test_bitvec_correlation_edge_cases(void);
bool test_bitvec_entropy_basic(void);
- In
BitVec.Math.c:23
:
bool test_bitvec_edit_distance_edge_cases(void);
bool test_bitvec_correlation_basic(void);
bool test_bitvec_correlation_edge_cases(void);
bool test_bitvec_entropy_basic(void);
bool test_bitvec_entropy_edge_cases(void);
- In
BitVec.Math.c:24
:
bool test_bitvec_correlation_basic(void);
bool test_bitvec_correlation_edge_cases(void);
bool test_bitvec_entropy_basic(void);
bool test_bitvec_entropy_edge_cases(void);
bool test_bitvec_alignment_score_basic(void);
- In
BitVec.Math.c:25
:
bool test_bitvec_correlation_edge_cases(void);
bool test_bitvec_entropy_basic(void);
bool test_bitvec_entropy_edge_cases(void);
bool test_bitvec_alignment_score_basic(void);
bool test_bitvec_alignment_score_edge_cases(void);
- In
BitVec.Math.c:26
:
bool test_bitvec_entropy_basic(void);
bool test_bitvec_entropy_edge_cases(void);
bool test_bitvec_alignment_score_basic(void);
bool test_bitvec_alignment_score_edge_cases(void);
bool test_bitvec_best_alignment_basic(void);
- In
BitVec.Math.c:27
:
bool test_bitvec_entropy_edge_cases(void);
bool test_bitvec_alignment_score_basic(void);
bool test_bitvec_alignment_score_edge_cases(void);
bool test_bitvec_best_alignment_basic(void);
bool test_bitvec_best_alignment_edge_cases(void);
- In
BitVec.Math.c:28
:
bool test_bitvec_alignment_score_basic(void);
bool test_bitvec_alignment_score_edge_cases(void);
bool test_bitvec_best_alignment_basic(void);
bool test_bitvec_best_alignment_edge_cases(void);
bool test_bitvec_math_stress_tests(void);
- In
BitVec.Math.c:29
:
bool test_bitvec_alignment_score_edge_cases(void);
bool test_bitvec_best_alignment_basic(void);
bool test_bitvec_best_alignment_edge_cases(void);
bool test_bitvec_math_stress_tests(void);
- In
BitVec.Math.c:30
:
bool test_bitvec_best_alignment_basic(void);
bool test_bitvec_best_alignment_edge_cases(void);
bool test_bitvec_math_stress_tests(void);
// Deadend tests
- In
BitVec.Math.c:33
:
// Deadend tests
bool test_bitvec_hamming_distance_null_bv1(void);
bool test_bitvec_hamming_distance_null_bv2(void);
bool test_bitvec_jaccard_similarity_null_bv1(void);
- In
BitVec.Math.c:34
:
// Deadend tests
bool test_bitvec_hamming_distance_null_bv1(void);
bool test_bitvec_hamming_distance_null_bv2(void);
bool test_bitvec_jaccard_similarity_null_bv1(void);
bool test_bitvec_jaccard_similarity_null_bv2(void);
- In
BitVec.Math.c:35
:
bool test_bitvec_hamming_distance_null_bv1(void);
bool test_bitvec_hamming_distance_null_bv2(void);
bool test_bitvec_jaccard_similarity_null_bv1(void);
bool test_bitvec_jaccard_similarity_null_bv2(void);
bool test_bitvec_cosine_similarity_null_bv1(void);
- In
BitVec.Math.c:36
:
bool test_bitvec_hamming_distance_null_bv2(void);
bool test_bitvec_jaccard_similarity_null_bv1(void);
bool test_bitvec_jaccard_similarity_null_bv2(void);
bool test_bitvec_cosine_similarity_null_bv1(void);
bool test_bitvec_cosine_similarity_null_bv2(void);
- In
BitVec.Math.c:37
:
bool test_bitvec_jaccard_similarity_null_bv1(void);
bool test_bitvec_jaccard_similarity_null_bv2(void);
bool test_bitvec_cosine_similarity_null_bv1(void);
bool test_bitvec_cosine_similarity_null_bv2(void);
bool test_bitvec_dot_product_null_bv1(void);
- In
BitVec.Math.c:38
:
bool test_bitvec_jaccard_similarity_null_bv2(void);
bool test_bitvec_cosine_similarity_null_bv1(void);
bool test_bitvec_cosine_similarity_null_bv2(void);
bool test_bitvec_dot_product_null_bv1(void);
bool test_bitvec_dot_product_null_bv2(void);
- In
BitVec.Math.c:39
:
bool test_bitvec_cosine_similarity_null_bv1(void);
bool test_bitvec_cosine_similarity_null_bv2(void);
bool test_bitvec_dot_product_null_bv1(void);
bool test_bitvec_dot_product_null_bv2(void);
bool test_bitvec_edit_distance_null_bv1(void);
- In
BitVec.Math.c:40
:
bool test_bitvec_cosine_similarity_null_bv2(void);
bool test_bitvec_dot_product_null_bv1(void);
bool test_bitvec_dot_product_null_bv2(void);
bool test_bitvec_edit_distance_null_bv1(void);
bool test_bitvec_edit_distance_null_bv2(void);
- In
BitVec.Math.c:41
:
bool test_bitvec_dot_product_null_bv1(void);
bool test_bitvec_dot_product_null_bv2(void);
bool test_bitvec_edit_distance_null_bv1(void);
bool test_bitvec_edit_distance_null_bv2(void);
bool test_bitvec_correlation_null_bv1(void);
- In
BitVec.Math.c:42
:
bool test_bitvec_dot_product_null_bv2(void);
bool test_bitvec_edit_distance_null_bv1(void);
bool test_bitvec_edit_distance_null_bv2(void);
bool test_bitvec_correlation_null_bv1(void);
bool test_bitvec_correlation_null_bv2(void);
- In
BitVec.Math.c:43
:
bool test_bitvec_edit_distance_null_bv1(void);
bool test_bitvec_edit_distance_null_bv2(void);
bool test_bitvec_correlation_null_bv1(void);
bool test_bitvec_correlation_null_bv2(void);
bool test_bitvec_entropy_null(void);
- In
BitVec.Math.c:44
:
bool test_bitvec_edit_distance_null_bv2(void);
bool test_bitvec_correlation_null_bv1(void);
bool test_bitvec_correlation_null_bv2(void);
bool test_bitvec_entropy_null(void);
bool test_bitvec_alignment_score_null_bv1(void);
- In
BitVec.Math.c:45
:
bool test_bitvec_correlation_null_bv1(void);
bool test_bitvec_correlation_null_bv2(void);
bool test_bitvec_entropy_null(void);
bool test_bitvec_alignment_score_null_bv1(void);
bool test_bitvec_alignment_score_null_bv2(void);
- In
BitVec.Math.c:46
:
bool test_bitvec_correlation_null_bv2(void);
bool test_bitvec_entropy_null(void);
bool test_bitvec_alignment_score_null_bv1(void);
bool test_bitvec_alignment_score_null_bv2(void);
bool test_bitvec_best_alignment_null_bv1(void);
- In
BitVec.Math.c:47
:
bool test_bitvec_entropy_null(void);
bool test_bitvec_alignment_score_null_bv1(void);
bool test_bitvec_alignment_score_null_bv2(void);
bool test_bitvec_best_alignment_null_bv1(void);
bool test_bitvec_best_alignment_null_bv2(void);
- In
BitVec.Math.c:48
:
bool test_bitvec_alignment_score_null_bv1(void);
bool test_bitvec_alignment_score_null_bv2(void);
bool test_bitvec_best_alignment_null_bv1(void);
bool test_bitvec_best_alignment_null_bv2(void);
- In
BitVec.Math.c:49
:
bool test_bitvec_alignment_score_null_bv2(void);
bool test_bitvec_best_alignment_null_bv1(void);
bool test_bitvec_best_alignment_null_bv2(void);
// Test BitVecHammingDistance basic functionality
- In
BitVec.Math.c:52
:
// Test BitVecHammingDistance basic functionality
bool test_bitvec_hamming_distance_basic(void) {
printf("Testing BitVecHammingDistance basic functionality\n");
- In
BitVec.Math.c:57
:
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test identical bitvectors
- In
BitVec.Math.c:94
:
// Test BitVecHammingDistance edge cases
bool test_bitvec_hamming_distance_edge_cases(void) {
printf("Testing BitVecHammingDistance edge cases\n");
- In
BitVec.Math.c:99
:
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty bitvectors
// Test BitVecJaccardSimilarity basic functionality
bool test_bitvec_jaccard_similarity_basic(void) {
printf("Testing BitVecJaccardSimilarity basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test identical bitvectors
// Test BitVecJaccardSimilarity edge cases
bool test_bitvec_jaccard_similarity_edge_cases(void) {
printf("Testing BitVecJaccardSimilarity edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty bitvectors
// Test BitVecCosineSimilarity basic functionality
bool test_bitvec_cosine_similarity_basic(void) {
printf("Testing BitVecCosineSimilarity basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test identical bitvectors
// Test BitVecCosineSimilarity edge cases
bool test_bitvec_cosine_similarity_edge_cases(void) {
printf("Testing BitVecCosineSimilarity edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test zero vectors
// Test BitVecDotProduct basic functionality
bool test_bitvec_dot_product_basic(void) {
printf("Testing BitVecDotProduct basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test basic dot product
// Test BitVecDotProduct edge cases
bool test_bitvec_dot_product_edge_cases(void) {
printf("Testing BitVecDotProduct edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty bitvectors
// Test BitVecEditDistance basic functionality
bool test_bitvec_edit_distance_basic(void) {
printf("Testing BitVecEditDistance basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test identical strings
// Test BitVecEditDistance edge cases
bool test_bitvec_edit_distance_edge_cases(void) {
printf("Testing BitVecEditDistance edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty to empty
// Test BitVecCorrelation basic functionality
bool test_bitvec_correlation_basic(void) {
printf("Testing BitVecCorrelation basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test perfect correlation
// Test BitVecCorrelation edge cases
bool test_bitvec_correlation_edge_cases(void) {
printf("Testing BitVecCorrelation edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty bitvectors
// Test BitVecEntropy basic functionality
bool test_bitvec_entropy_basic(void) {
printf("Testing BitVecEntropy basic functionality\n");
BitVec bv = BitVecInit();
bool result = true;
// Test maximum entropy (equal 0s and 1s)
// Test BitVecEntropy edge cases
bool test_bitvec_entropy_edge_cases(void) {
printf("Testing BitVecEntropy edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector
// Test BitVecAlignmentScore basic functionality
bool test_bitvec_alignment_score_basic(void) {
printf("Testing BitVecAlignmentScore basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test perfect match
// Test BitVecAlignmentScore edge cases
bool test_bitvec_alignment_score_edge_cases(void) {
printf("Testing BitVecAlignmentScore edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty bitvectors
// Test BitVecBestAlignment basic functionality
bool test_bitvec_best_alignment_basic(void) {
printf("Testing BitVecBestAlignment basic functionality\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Create bv1: 1100110
// Test BitVecBestAlignment edge cases
bool test_bitvec_best_alignment_edge_cases(void) {
printf("Testing BitVecBestAlignment edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test empty bitvectors
// Stress test for Math functions
bool test_bitvec_math_stress_tests(void) {
printf("Testing BitVec Math stress tests\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Create large bitvectors
// Deadend tests - each function with NULL parameters
bool test_bitvec_hamming_distance_null_bv1(void) {
printf("Testing BitVecHammingDistance(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_hamming_distance_null_bv2(void) {
printf("Testing BitVecHammingDistance(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_jaccard_similarity_null_bv1(void) {
printf("Testing BitVecJaccardSimilarity(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_jaccard_similarity_null_bv2(void) {
printf("Testing BitVecJaccardSimilarity(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_cosine_similarity_null_bv1(void) {
printf("Testing BitVecCosineSimilarity(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_cosine_similarity_null_bv2(void) {
printf("Testing BitVecCosineSimilarity(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_dot_product_null_bv1(void) {
printf("Testing BitVecDotProduct(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_dot_product_null_bv2(void) {
printf("Testing BitVecDotProduct(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_edit_distance_null_bv1(void) {
printf("Testing BitVecEditDistance(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_edit_distance_null_bv2(void) {
printf("Testing BitVecEditDistance(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_correlation_null_bv1(void) {
printf("Testing BitVecCorrelation(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_correlation_null_bv2(void) {
printf("Testing BitVecCorrelation(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_entropy_null(void) {
printf("Testing BitVecEntropy(NULL) - should fatal\n");
BitVecEntropy(NULL);
}
bool test_bitvec_alignment_score_null_bv1(void) {
printf("Testing BitVecAlignmentScore(NULL, bv2, 1, -1) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_alignment_score_null_bv2(void) {
printf("Testing BitVecAlignmentScore(bv1, NULL, 1, -1) - should fatal\n");
BitVec bv1 = BitVecInit();
}
bool test_bitvec_best_alignment_null_bv1(void) {
printf("Testing BitVecBestAlignment(NULL, bv2) - should fatal\n");
BitVec bv2 = BitVecInit();
}
bool test_bitvec_best_alignment_null_bv2(void) {
printf("Testing BitVecBestAlignment(bv1, NULL) - should fatal\n");
BitVec bv1 = BitVecInit();
// Function prototypes
bool test_bitvec_basic_pattern_functions(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
// Function prototypes
bool test_bitvec_basic_pattern_functions(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_basic_pattern_functions(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_find_pattern(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_last_pattern(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_all_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_pattern_edge_cases(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_pattern_stress_tests(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_last_pattern_null_source(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_last_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_find_all_pattern_null_source(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_find_all_pattern_null_pattern(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_find_all_pattern_null_results(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_find_all_pattern_zero_max_results(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_starts_with_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_starts_with_edge_cases(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_ends_with_basic(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_ends_with_edge_cases(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_contains_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_contains_at_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_contains_at_edge_cases(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_count_pattern_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_rfind_pattern_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_replace_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_replace_all_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_matches_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_fuzzy_match_basic(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_regex_match_basic(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_prefix_match_basic(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_suffix_match_basic(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_starts_with_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_starts_with_null_prefix(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_ends_with_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_ends_with_null_suffix(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_contains_at_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_contains_at_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_replace_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_matches_null_source(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_regex_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_regex_match_null_pattern(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
bool test_bitvec_prefix_match_null_source(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
bool test_bitvec_prefix_match_null_patterns(void);
bool test_bitvec_suffix_match_null_source(void);
bool test_bitvec_suffix_match_null_patterns(void);
// Test basic pattern matching functions
// Test basic pattern matching functions
bool test_bitvec_basic_pattern_functions(void) {
printf("Testing basic BitVec pattern functions\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 11010011101
// Test BitVecFindPattern function comprehensively
bool test_bitvec_find_pattern(void) {
printf("Testing BitVecFindPattern function\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 110101011010
// Create source: 110101011010
for (int i = 0; i < 12; i++) {
bool bit = (i % 4 == 0 || i % 4 == 1 || i % 4 == 3);
BitVecPush(&source, bit);
}
// Test BitVecFindLastPattern function
bool test_bitvec_find_last_pattern(void) {
printf("Testing BitVecFindLastPattern function\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source with multiple pattern occurrences: 101010101
// Test BitVecFindAllPattern function
bool test_bitvec_find_all_pattern(void) {
printf("Testing BitVecFindAllPattern function\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 10101010101
// Source: 110110110
for (int i = 0; i < 9; i++) {
bool bit = (i % 3 == 0 || i % 3 == 1);
BitVecPush(&source, bit);
}
// Test edge cases for pattern functions
bool test_bitvec_pattern_edge_cases(void) {
printf("Testing BitVec pattern edge cases\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Test empty pattern
// Stress tests with large data
bool test_bitvec_pattern_stress_tests(void) {
printf("Testing BitVec pattern stress tests\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create large source with known pattern
// Deadend test 1: BitVecFindPattern with NULL source
bool test_bitvec_find_pattern_null_source(void) {
printf("Testing BitVecFindPattern(NULL, pattern) - should fatal\n");
// Deadend test 2: BitVecFindPattern with NULL pattern
bool test_bitvec_find_pattern_null_pattern(void) {
printf("Testing BitVecFindPattern(source, NULL) - should fatal\n");
// Deadend test 3: BitVecFindLastPattern with NULL source
bool test_bitvec_find_last_pattern_null_source(void) {
printf("Testing BitVecFindLastPattern(NULL, pattern) - should fatal\n");
// Deadend test 4: BitVecFindLastPattern with NULL pattern
bool test_bitvec_find_last_pattern_null_pattern(void) {
printf("Testing BitVecFindLastPattern(source, NULL) - should fatal\n");
// Deadend test 5: BitVecFindAllPattern with NULL source
bool test_bitvec_find_all_pattern_null_source(void) {
printf("Testing BitVecFindAllPattern(NULL, pattern, results, 10) - should fatal\n");
// Deadend test 6: BitVecFindAllPattern with NULL pattern
bool test_bitvec_find_all_pattern_null_pattern(void) {
printf("Testing BitVecFindAllPattern(source, NULL, results, 10) - should fatal\n");
// Deadend test 7: BitVecFindAllPattern with NULL results
bool test_bitvec_find_all_pattern_null_results(void) {
printf("Testing BitVecFindAllPattern(source, pattern, NULL, 10) - should fatal\n");
// Deadend test 8: BitVecFindAllPattern with zero max_results
bool test_bitvec_find_all_pattern_zero_max_results(void) {
printf("Testing BitVecFindAllPattern(source, pattern, results, 0) - should fatal\n");
// BitVecStartsWith tests
bool test_bitvec_starts_with_basic(void) {
printf("Testing BitVecStartsWith basic functionality\n");
BitVec source = BitVecInit();
BitVec prefix = BitVecInit();
bool result = true;
// Create source: 110101
}
bool test_bitvec_starts_with_edge_cases(void) {
printf("Testing BitVecStartsWith edge cases\n");
BitVec source = BitVecInit();
BitVec prefix = BitVecInit();
bool result = true;
// Test empty prefix (should always match)
// BitVecEndsWith tests
bool test_bitvec_ends_with_basic(void) {
printf("Testing BitVecEndsWith basic functionality\n");
BitVec source = BitVecInit();
BitVec suffix = BitVecInit();
bool result = true;
// Create source: 110101
}
bool test_bitvec_ends_with_edge_cases(void) {
printf("Testing BitVecEndsWith edge cases\n");
BitVec source = BitVecInit();
BitVec suffix = BitVecInit();
bool result = true;
// Test empty suffix (should always match)
// BitVecContains tests
bool test_bitvec_contains_basic(void) {
printf("Testing BitVecContains basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 1101011
// BitVecContainsAt tests
bool test_bitvec_contains_at_basic(void) {
printf("Testing BitVecContainsAt basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 1101011
}
bool test_bitvec_contains_at_edge_cases(void) {
printf("Testing BitVecContainsAt edge cases\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create small source
// BitVecCountPattern tests
bool test_bitvec_count_pattern_basic(void) {
printf("Testing BitVecCountPattern basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 101010101
// BitVecRFindPattern tests
bool test_bitvec_rfind_pattern_basic(void) {
printf("Testing BitVecRFindPattern basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 101101101
// BitVecReplace tests
bool test_bitvec_replace_basic(void) {
printf("Testing BitVecReplace basic functionality\n");
BitVec old_pattern = BitVecInit();
BitVec new_pattern = BitVecInit();
bool result = true;
// Create source: 110110
BitVecPush(&new_pattern, true);
bool replaced = BitVecReplace(&source, &old_pattern, &new_pattern);
result = result && replaced;
// BitVecReplaceAll tests
bool test_bitvec_replace_all_basic(void) {
printf("Testing BitVecReplaceAll basic functionality\n");
BitVec old_pattern = BitVecInit();
BitVec new_pattern = BitVecInit();
bool result = true;
// Create source: 110110110
// BitVecMatches tests
bool test_bitvec_matches_basic(void) {
printf("Testing BitVecMatches basic functionality\n");
BitVec pattern = BitVecInit();
BitVec wildcard = BitVecInit();
bool result = true;
// Create source: 1101
// BitVecFuzzyMatch tests
bool test_bitvec_fuzzy_match_basic(void) {
printf("Testing BitVecFuzzyMatch basic functionality\n");
BitVec source = BitVecInit();
BitVec pattern = BitVecInit();
bool result = true;
// Create source: 110100111
// BitVecRegexMatch tests
bool test_bitvec_regex_match_basic(void) {
printf("Testing BitVecRegexMatch basic functionality\n");
BitVec source = BitVecInit();
bool result = true;
// Create source: 101010
// BitVecPrefixMatch tests
bool test_bitvec_prefix_match_basic(void) {
printf("Testing BitVecPrefixMatch basic functionality\n");
BitVec source = BitVecInit();
BitVec patterns[3];
bool result = true;
// Initialize patterns
// BitVecSuffixMatch tests
bool test_bitvec_suffix_match_basic(void) {
printf("Testing BitVecSuffixMatch basic functionality\n");
BitVec source = BitVecInit();
BitVec patterns[3];
bool result = true;
// Initialize patterns
// Additional deadend tests for missing Pattern functions
bool test_bitvec_starts_with_null_source(void) {
printf("Testing BitVecStartsWith(NULL, prefix) - should fatal\n");
BitVec prefix = BitVecInit();
}
bool test_bitvec_starts_with_null_prefix(void) {
printf("Testing BitVecStartsWith(source, NULL) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_ends_with_null_source(void) {
printf("Testing BitVecEndsWith(NULL, suffix) - should fatal\n");
BitVec suffix = BitVecInit();
}
bool test_bitvec_ends_with_null_suffix(void) {
printf("Testing BitVecEndsWith(source, NULL) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_contains_at_null_source(void) {
printf("Testing BitVecContainsAt(NULL, pattern, 0) - should fatal\n");
BitVec pattern = BitVecInit();
}
bool test_bitvec_contains_at_null_pattern(void) {
printf("Testing BitVecContainsAt(source, NULL, 0) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_replace_null_source(void) {
printf("Testing BitVecReplace(NULL, old, new) - should fatal\n");
}
bool test_bitvec_matches_null_source(void) {
printf("Testing BitVecMatches(NULL, pattern, wildcard) - should fatal\n");
BitVec pattern = BitVecInit();
}
bool test_bitvec_regex_match_null_source(void) {
printf("Testing BitVecRegexMatch(NULL, pattern) - should fatal\n");
BitVecRegexMatch(NULL, "101");
}
bool test_bitvec_regex_match_null_pattern(void) {
printf("Testing BitVecRegexMatch(source, NULL) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_prefix_match_null_source(void) {
printf("Testing BitVecPrefixMatch(NULL, patterns, 1) - should fatal\n");
BitVec patterns[1] = {BitVecInit()};
}
bool test_bitvec_prefix_match_null_patterns(void) {
printf("Testing BitVecPrefixMatch(source, NULL, 1) - should fatal\n");
BitVec source = BitVecInit();
}
bool test_bitvec_suffix_match_null_source(void) {
printf("Testing BitVecSuffixMatch(NULL, patterns, 1) - should fatal\n");
BitVec patterns[1] = {BitVecInit()};
}
bool test_bitvec_suffix_match_null_patterns(void) {
printf("Testing BitVecSuffixMatch(source, NULL, 1) - should fatal\n");
BitVec source = BitVecInit();
// Function prototypes for deadend tests
bool test_bitvec_bitwise_null_failures(void);
bool test_bitvec_bitwise_ops_null_failures(void);
bool test_bitvec_reverse_null_failures(void);
// Function prototypes for deadend tests
bool test_bitvec_bitwise_null_failures(void);
bool test_bitvec_bitwise_ops_null_failures(void);
bool test_bitvec_reverse_null_failures(void);
bool test_bitvec_shift_ops_null_failures(void);
bool test_bitvec_bitwise_null_failures(void);
bool test_bitvec_bitwise_ops_null_failures(void);
bool test_bitvec_reverse_null_failures(void);
bool test_bitvec_shift_ops_null_failures(void);
bool test_bitvec_rotate_ops_null_failures(void);
bool test_bitvec_bitwise_ops_null_failures(void);
bool test_bitvec_reverse_null_failures(void);
bool test_bitvec_shift_ops_null_failures(void);
bool test_bitvec_rotate_ops_null_failures(void);
bool test_bitvec_and_result_null_failures(void);
bool test_bitvec_reverse_null_failures(void);
bool test_bitvec_shift_ops_null_failures(void);
bool test_bitvec_rotate_ops_null_failures(void);
bool test_bitvec_and_result_null_failures(void);
bool test_bitvec_or_operand_null_failures(void);
bool test_bitvec_shift_ops_null_failures(void);
bool test_bitvec_rotate_ops_null_failures(void);
bool test_bitvec_and_result_null_failures(void);
bool test_bitvec_or_operand_null_failures(void);
bool test_bitvec_xor_second_operand_null_failures(void);
bool test_bitvec_rotate_ops_null_failures(void);
bool test_bitvec_and_result_null_failures(void);
bool test_bitvec_or_operand_null_failures(void);
bool test_bitvec_xor_second_operand_null_failures(void);
bool test_bitvec_not_null_failures(void);
bool test_bitvec_and_result_null_failures(void);
bool test_bitvec_or_operand_null_failures(void);
bool test_bitvec_xor_second_operand_null_failures(void);
bool test_bitvec_not_null_failures(void);
bool test_bitvec_or_operand_null_failures(void);
bool test_bitvec_xor_second_operand_null_failures(void);
bool test_bitvec_not_null_failures(void);
// Deadend tests
// Deadend tests
bool test_bitvec_bitwise_null_failures(void) {
printf("Testing BitVec bitwise NULL pointer handling\n");
}
bool test_bitvec_bitwise_ops_null_failures(void) {
printf("Testing BitVec bitwise operations NULL handling\n");
}
bool test_bitvec_reverse_null_failures(void) {
printf("Testing BitVec reverse NULL handling\n");
// NEW: Additional deadend tests
bool test_bitvec_shift_ops_null_failures(void) {
printf("Testing BitVec shift operations NULL handling\n");
}
bool test_bitvec_rotate_ops_null_failures(void) {
printf("Testing BitVec rotate operations NULL handling\n");
}
bool test_bitvec_and_result_null_failures(void) {
printf("Testing BitVec AND with NULL result handling\n");
}
bool test_bitvec_or_operand_null_failures(void) {
printf("Testing BitVec OR with NULL operand handling\n");
}
bool test_bitvec_xor_second_operand_null_failures(void) {
printf("Testing BitVec XOR with NULL second operand handling\n");
}
bool test_bitvec_not_null_failures(void) {
printf("Testing BitVec NOT with NULL handling\n");
// Function prototypes for deadend tests
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
// Function prototypes for deadend tests
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_foreach_invalid_usage(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
bool test_bitvec_run_lengths_null_bv(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
bool test_bitvec_run_lengths_null_runs(void);
bool test_bitvec_run_lengths_null_values(void);
bool test_bitvec_run_lengths_zero_max_runs(void);
// Deadend tests for BitVecRunLengths
// Deadend tests for BitVecRunLengths
bool test_bitvec_run_lengths_null_bv(void) {
printf("Testing BitVecRunLengths with NULL bitvector\n");
u64 runs[5];
bool values[5];
// This should cause LOG_FATAL and terminate the program
}
bool test_bitvec_run_lengths_null_runs(void) {
printf("Testing BitVecRunLengths with NULL runs array\n");
BitVec bv = BitVecInit();
BitVecPush(&bv, true);
bool values[5];
// This should cause LOG_FATAL and terminate the program
}
bool test_bitvec_run_lengths_null_values(void) {
printf("Testing BitVecRunLengths with NULL values array\n");
}
bool test_bitvec_run_lengths_zero_max_runs(void) {
printf("Testing BitVecRunLengths with zero max_runs\n");
BitVecPush(&bv, true);
u64 runs[5];
bool values[5];
// This should cause LOG_FATAL and terminate the program
// with invalid macro usage scenarios
bool test_bitvec_foreach_invalid_usage(void) {
printf("Testing BitVec foreach with invalid bitvec\n");
// Function prototypes
bool test_bitvec_get(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
// Function prototypes
bool test_bitvec_get(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_get(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_set(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_flip(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_length_capacity(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_operations(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_get_edge_cases(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_set_edge_cases(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_flip_edge_cases(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_count_edge_cases(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_access_multiple_operations(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_access_large_patterns(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_macro_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_access_stress_test(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_bit_patterns_comprehensive(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_find_functions(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_predicate_functions(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_longest_run(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_find_edge_cases(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_predicate_edge_cases(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
bool test_bitvec_longest_run_edge_cases(void);
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
bool test_bitvec_find_deadend_tests(void);
bool test_bitvec_predicate_deadend_tests(void);
bool test_bitvec_longest_run_deadend_tests(void);
// Test BitVecGet function
// Test BitVecGet function
bool test_bitvec_get(void) {
printf("Testing BitVecGet\n");
// Test getting each bit
bool result = (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
result = result && (BitVecGet(&bv, 2) == true);
// Test BitVecSet function
bool test_bitvec_set(void) {
printf("Testing BitVecSet\n");
// Verify changes
bool result = (BitVecGet(&bv, 0) == true);
result = result && (BitVecGet(&bv, 1) == false);
result = result && (BitVecGet(&bv, 2) == true);
// Test BitVecFlip function
bool test_bitvec_flip(void) {
printf("Testing BitVecFlip\n");
// Verify flipped values: should now be 010
bool result = (BitVecGet(&bv, 0) == false);
result = result && (BitVecGet(&bv, 1) == true);
result = result && (BitVecGet(&bv, 2) == false);
// Test length and capacity operations
bool test_bitvec_length_capacity(void) {
printf("Testing BitVec length and capacity operations\n");
// Initially should be empty
bool result = (BitVecLen(&bv) == 0) && (BitVecCapacity(&bv) == 0);
// Add some bits
// Test count operations
bool test_bitvec_count_operations(void) {
printf("Testing BitVec count operations\n");
// Test counting
bool result = (BitVecCountOnes(&bv) == 3);
result = result && (BitVecCountZeros(&bv) == 4);
// Edge case tests
bool test_bitvec_get_edge_cases(void) {
printf("Testing BitVecGet edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test boundary conditions (no longer test empty bitvec - strict bounds checking now)
}
bool test_bitvec_set_edge_cases(void) {
printf("Testing BitVecSet edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test normal setting
}
bool test_bitvec_flip_edge_cases(void) {
printf("Testing BitVecFlip edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test normal flipping
}
bool test_bitvec_count_edge_cases(void) {
printf("Testing BitVec count edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test count on empty bitvec
}
bool test_bitvec_access_multiple_operations(void) {
printf("Testing BitVec multiple access operations\n");
BitVec bv = BitVecInit();
bool result = true;
// Stress test with many operations
// NEW: Test large bit patterns and complex access patterns
bool test_bitvec_access_large_patterns(void) {
printf("Testing BitVec large pattern access\n");
BitVec bv = BitVecInit();
bool result = true;
// Create a large repeating pattern: 10110100 (8-bit pattern)
for (int repeat = 0; repeat < 500; repeat++) {
for (int bit = 0; bit < 8; bit++) {
bool bit_value = (pattern & (1u << bit)) != 0;
BitVecPush(&bv, bit_value);
}
if (base_idx + 7 < bv.length) {
for (int bit = 0; bit < 8; bit++) {
bool expected = (pattern & (1u << bit)) != 0;
bool actual = BitVecGet(&bv, base_idx + bit);
result = result && (actual == expected);
for (int bit = 0; bit < 8; bit++) {
bool expected = (pattern & (1u << bit)) != 0;
bool actual = BitVecGet(&bv, base_idx + bit);
result = result && (actual == expected);
}
// NEW: Test macro functions comprehensively
bool test_bitvec_macro_functions(void) {
printf("Testing BitVec macro functions\n");
BitVec bv = BitVecInit();
bool result = true;
// Test all macros on empty bitvector
// NEW: Stress test for access operations
bool test_bitvec_access_stress_test(void) {
printf("Testing BitVec access stress test\n");
BitVec bv = BitVecInit();
bool result = true;
// Create a large bitvector with known pattern
for (int test = 0; test < 1000; test++) {
u64 idx = (test * 7 + test * 3) % size; // Pseudo-random indices
bool expected = (idx / 7) % 2 == 0;
bool actual = BitVecGet(&bv, idx);
result = result && (actual == expected);
u64 idx = (test * 7 + test * 3) % size; // Pseudo-random indices
bool expected = (idx / 7) % 2 == 0;
bool actual = BitVecGet(&bv, idx);
result = result && (actual == expected);
}
for (int i = 0; i < boundary_count; i++) {
if (boundaries[i] < size) {
bool original = BitVecGet(&bv, boundaries[i]);
BitVecFlip(&bv, boundaries[i]);
result = result && (BitVecGet(&bv, boundaries[i]) == !original);
// NEW: Comprehensive bit pattern testing
bool test_bitvec_bit_patterns_comprehensive(void) {
printf("Testing BitVec comprehensive bit patterns\n");
BitVec bv = BitVecInit();
bool result = true;
// Test all-zeros pattern
// Verify checkerboard pattern
for (int i = 0; i < 100; i++) {
bool expected = (i % 2 == 0);
result = result && (BitVecGet(&bv, i) == expected);
}
BitVecPush(&bv, true); // F(1) = 1
for (int i = 2; i < 50; i++) {
bool prev1 = BitVecGet(&bv, i - 1);
bool prev2 = BitVecGet(&bv, i - 2);
BitVecPush(&bv, prev1 != prev2); // XOR
for (int i = 2; i < 50; i++) {
bool prev1 = BitVecGet(&bv, i - 1);
bool prev2 = BitVecGet(&bv, i - 2);
BitVecPush(&bv, prev1 != prev2); // XOR
}
// Deadend tests
bool test_bitvec_access_null_failures(void) {
printf("Testing BitVec access NULL pointer handling\n");
}
bool test_bitvec_set_null_failures(void) {
printf("Testing BitVec set NULL pointer handling\n");
}
bool test_bitvec_flip_null_failures(void) {
printf("Testing BitVec flip NULL pointer handling\n");
}
bool test_bitvec_get_bounds_failures(void) {
printf("Testing BitVec get bounds checking\n");
}
bool test_bitvec_set_bounds_failures(void) {
printf("Testing BitVec set bounds checking\n");
}
bool test_bitvec_flip_bounds_failures(void) {
printf("Testing BitVec flip bounds checking\n");
// NEW: More specific bounds checking deadend tests
bool test_bitvec_get_large_index_failures(void) {
printf("Testing BitVec get with large out-of-bounds index\n");
}
bool test_bitvec_set_large_index_failures(void) {
printf("Testing BitVec set with large out-of-bounds index\n");
}
bool test_bitvec_flip_edge_index_failures(void) {
printf("Testing BitVec flip with edge case out-of-bounds index\n");
}
bool test_bitvec_count_null_failures(void) {
printf("Testing BitVec count operations with NULL pointer\n");
}
bool test_bitvec_get_max_index_failures(void) {
printf("Testing BitVec get with maximum index value\n");
// Test BitVecFind and BitVecFindLast functions
bool test_bitvec_find_functions(void) {
printf("Testing BitVecFind and BitVecFindLast functions\n");
BitVec bv = BitVecInit();
bool result = true;
// Create pattern: 10110100
// Test BitVecAll, BitVecAny, BitVecNone functions
bool test_bitvec_predicate_functions(void) {
printf("Testing BitVecAll, BitVecAny, BitVecNone functions\n");
BitVec bv = BitVecInit();
bool result = true;
// Test with all true bits
// Test BitVecLongestRun function
bool test_bitvec_longest_run(void) {
printf("Testing BitVecLongestRun function\n");
BitVec bv = BitVecInit();
bool result = true;
// Test pattern: 11100110011111
// Edge case tests for Find functions
bool test_bitvec_find_edge_cases(void) {
printf("Testing BitVecFind edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector
// Edge case tests for predicate functions
bool test_bitvec_predicate_edge_cases(void) {
printf("Testing BitVec predicate edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector - all predicates should return true for empty set
// Edge case tests for LongestRun function
bool test_bitvec_longest_run_edge_cases(void) {
printf("Testing BitVecLongestRun edge cases\n");
BitVec bv = BitVecInit();
bool result = true;
// Test empty bitvector
// Deadend tests - testing NULL pointers and invalid conditions that should cause fatal errors
bool test_bitvec_find_deadend_tests(void) {
printf("Testing BitVecFind deadend scenarios\n");
}
bool test_bitvec_predicate_deadend_tests(void) {
printf("Testing BitVec predicate deadend scenarios\n");
}
bool test_bitvec_longest_run_deadend_tests(void) {
printf("Testing BitVecLongestRun deadend scenarios\n");
// Function prototypes
bool test_bitvec_equals(void);
bool test_bitvec_compare(void);
bool test_bitvec_lex_compare(void);
// Function prototypes
bool test_bitvec_equals(void);
bool test_bitvec_compare(void);
bool test_bitvec_lex_compare(void);
bool test_bitvec_numerical_compare(void);
bool test_bitvec_equals(void);
bool test_bitvec_compare(void);
bool test_bitvec_lex_compare(void);
bool test_bitvec_numerical_compare(void);
bool test_bitvec_weight_compare(void);
bool test_bitvec_compare(void);
bool test_bitvec_lex_compare(void);
bool test_bitvec_numerical_compare(void);
bool test_bitvec_weight_compare(void);
bool test_bitvec_signed_compare(void);
bool test_bitvec_lex_compare(void);
bool test_bitvec_numerical_compare(void);
bool test_bitvec_weight_compare(void);
bool test_bitvec_signed_compare(void);
bool test_bitvec_is_subset(void);
bool test_bitvec_numerical_compare(void);
bool test_bitvec_weight_compare(void);
bool test_bitvec_signed_compare(void);
bool test_bitvec_is_subset(void);
bool test_bitvec_is_superset(void);
bool test_bitvec_weight_compare(void);
bool test_bitvec_signed_compare(void);
bool test_bitvec_is_subset(void);
bool test_bitvec_is_superset(void);
bool test_bitvec_overlaps(void);
bool test_bitvec_signed_compare(void);
bool test_bitvec_is_subset(void);
bool test_bitvec_is_superset(void);
bool test_bitvec_overlaps(void);
bool test_bitvec_disjoint_intersects(void);
bool test_bitvec_is_subset(void);
bool test_bitvec_is_superset(void);
bool test_bitvec_overlaps(void);
bool test_bitvec_disjoint_intersects(void);
bool test_bitvec_equals_range(void);
bool test_bitvec_is_superset(void);
bool test_bitvec_overlaps(void);
bool test_bitvec_disjoint_intersects(void);
bool test_bitvec_equals_range(void);
bool test_bitvec_compare_range(void);
bool test_bitvec_overlaps(void);
bool test_bitvec_disjoint_intersects(void);
bool test_bitvec_equals_range(void);
bool test_bitvec_compare_range(void);
bool test_bitvec_less_than_functions(void);
bool test_bitvec_disjoint_intersects(void);
bool test_bitvec_equals_range(void);
bool test_bitvec_compare_range(void);
bool test_bitvec_less_than_functions(void);
bool test_bitvec_is_sorted(void);
bool test_bitvec_equals_range(void);
bool test_bitvec_compare_range(void);
bool test_bitvec_less_than_functions(void);
bool test_bitvec_is_sorted(void);
bool test_bitvec_compare_edge_cases(void);
bool test_bitvec_compare_range(void);
bool test_bitvec_less_than_functions(void);
bool test_bitvec_is_sorted(void);
bool test_bitvec_compare_edge_cases(void);
bool test_bitvec_set_operations_edge_cases(void);
bool test_bitvec_less_than_functions(void);
bool test_bitvec_is_sorted(void);
bool test_bitvec_compare_edge_cases(void);
bool test_bitvec_set_operations_edge_cases(void);
bool test_bitvec_comprehensive_comparison(void);
bool test_bitvec_is_sorted(void);
bool test_bitvec_compare_edge_cases(void);
bool test_bitvec_set_operations_edge_cases(void);
bool test_bitvec_comprehensive_comparison(void);
bool test_bitvec_large_scale_comparison(void);
bool test_bitvec_compare_edge_cases(void);
bool test_bitvec_set_operations_edge_cases(void);
bool test_bitvec_comprehensive_comparison(void);
bool test_bitvec_large_scale_comparison(void);
bool test_bitvec_compare_null_failures(void);
bool test_bitvec_set_operations_edge_cases(void);
bool test_bitvec_comprehensive_comparison(void);
bool test_bitvec_large_scale_comparison(void);
bool test_bitvec_compare_null_failures(void);
bool test_bitvec_subset_null_failures(void);
bool test_bitvec_comprehensive_comparison(void);
bool test_bitvec_large_scale_comparison(void);
bool test_bitvec_compare_null_failures(void);
bool test_bitvec_subset_null_failures(void);
bool test_bitvec_range_null_failures(void);
bool test_bitvec_large_scale_comparison(void);
bool test_bitvec_compare_null_failures(void);
bool test_bitvec_subset_null_failures(void);
bool test_bitvec_range_null_failures(void);
bool test_bitvec_range_bounds_failures(void);
bool test_bitvec_compare_null_failures(void);
bool test_bitvec_subset_null_failures(void);
bool test_bitvec_range_null_failures(void);
bool test_bitvec_range_bounds_failures(void);
bool test_bitvec_sorted_null_failures(void);
bool test_bitvec_subset_null_failures(void);
bool test_bitvec_range_null_failures(void);
bool test_bitvec_range_bounds_failures(void);
bool test_bitvec_sorted_null_failures(void);
bool test_bitvec_range_null_failures(void);
bool test_bitvec_range_bounds_failures(void);
bool test_bitvec_sorted_null_failures(void);
// Test BitVecEquals function
// Test BitVecEquals function
bool test_bitvec_equals(void) {
printf("Testing BitVecEquals\n");
// Test equal empty bitvectors
bool result = BitVecEquals(&bv1, &bv2);
// Add same pattern to both
// Test BitVecCompare function
bool test_bitvec_compare(void) {
printf("Testing BitVecCompare\n");
BitVecPush(&bv2, false);
bool result = (BitVecCompare(&bv1, &bv2) == 0);
// Test first greater than second
// Test BitVecLexCompare function
bool test_bitvec_lex_compare(void) {
printf("Testing BitVecLexCompare\n");
// Lexicographic comparison considers position-by-position
int cmp_result = BitVecCompare(&bv1, &bv2);
bool result = (cmp_result != 0); // Should not be equal
// Test equal bitvectors
// Test BitVecNumericalCompare function
bool test_bitvec_numerical_compare(void) {
printf("Testing BitVecNumericalCompare\n");
// Numerical comparison should compare the integer values
int cmp_result = BitVecNumericalCompare(&bv1, &bv2);
bool result = (cmp_result > 0); // 5 > 3
// Test equal values
// Test BitVecWeightCompare function
bool test_bitvec_weight_compare(void) {
printf("Testing BitVecWeightCompare\n");
// Weight comparison should compare number of set bits
int cmp_result = BitVecWeightCompare(&bv1, &bv2);
bool result = (cmp_result > 0); // 3 ones > 2 ones
// Test equal weights
// Test BitVecIsSubset function
bool test_bitvec_is_subset(void) {
printf("Testing BitVecIsSubset\n");
// subset should be a subset of superset (all 1s in subset are also 1s in superset)
bool result = BitVecIsSubset(&subset, &superset);
// Test non-subset case
// Test BitVecSignedCompare function
bool test_bitvec_signed_compare(void) {
printf("Testing BitVecSignedCompare\n");
// Positive should be greater than negative
bool result = (BitVecSignedCompare(&bv1, &bv2) > 0);
// Test two positives
// Test BitVecIsSuperset function
bool test_bitvec_is_superset(void) {
printf("Testing BitVecIsSuperset\n");
// superset should be a superset of subset
bool result = BitVecIsSuperset(&superset, &subset);
// Test non-superset case
// Test BitVecOverlaps function
bool test_bitvec_overlaps(void) {
printf("Testing BitVecOverlaps\n");
// They overlap at position 0 (both have 1)
bool result = BitVecOverlaps(&bv1, &bv2);
// Test non-overlapping bitvectors
// Test BitVecDisjoint and BitVecIntersects functions
bool test_bitvec_disjoint_intersects(void) {
printf("Testing BitVecDisjoint and BitVecIntersects\n");
// Should be disjoint and not intersect
bool result = BitVecDisjoint(&bv1, &bv2);
result = result && !BitVecOverlaps(&bv1, &bv2);
// Test BitVecEqualsRange function
bool test_bitvec_equals_range(void) {
printf("Testing BitVecEqualsRange\n");
// Test unequal ranges
// bv1[3:5] = 000, bv2[1:3] = 010, should be false
bool result = !BitVecEqualsRange(&bv1, 3, &bv2, 1, 3);
// Test equal ranges that actually match
// Test BitVecCompareRange function
bool test_bitvec_compare_range(void) {
printf("Testing BitVecCompareRange\n");
// Test range comparisons
int cmp_result = BitVecCompareRange(&bv1, 2, &bv2, 2, 3); // Compare 3-bit ranges
bool result = (cmp_result != 0); // Should not be equal
// Test equal ranges
// Test BitVecIsLexicographicallyLess and BitVecIsNumericallyLess
bool test_bitvec_less_than_functions(void) {
printf("Testing BitVecIsLexicographicallyLess and BitVecIsNumericallyLess\n");
// Lexicographically, shorter comes first
bool result = (BitVecCompare(&bv1, &bv2) < 0);
// Numerically, 10 (2) < 101 (5)
// Test BitVecIsSorted function
bool test_bitvec_is_sorted(void) {
printf("Testing BitVecIsSorted\n");
// Test empty bitvector (should be sorted)
bool result = BitVecIsSorted(&bv);
// Test sorted pattern: 0001111
// Edge case tests
bool test_bitvec_compare_edge_cases(void) {
printf("Testing BitVec compare edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test compare empty bitvecs
BitVecClear(&bv2);
for (int i = 0; i < 1000; i++) {
bool bit = i % 3 == 0;
BitVecPush(&bv1, bit);
BitVecPush(&bv2, bit);
}
bool test_bitvec_set_operations_edge_cases(void) {
printf("Testing BitVec set operations edge cases\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test with empty sets
// Comprehensive comparison testing with cross-validation
bool test_bitvec_comprehensive_comparison(void) {
printf("Testing BitVec comprehensive comparison operations\n");
BitVec bv1 = BitVecInit();
BitVec bv2 = BitVecInit();
bool result = true;
// Test comparison consistency across all comparison types
// Lexicographic comparison
int lex_cmp = BitVecCompare(&bv1, &bv2);
bool lex_less = (BitVecCompare(&bv1, &bv2) < 0);
result = result && ((lex_cmp < 0) == lex_less);
// Large-scale testing with stress patterns
bool test_bitvec_large_scale_comparison(void) {
printf("Testing BitVec large-scale comparison operations\n");
BitVec large1 = BitVecInit();
BitVec large2 = BitVecInit();
bool result = true;
// Create large bitvectors (2000 bits each)
for (int i = 0; i < 2000; i++) {
// Pattern 1: Fibonacci-like XOR pattern
bool bit1 = (i % 3 == 0) ^ (i % 5 == 0);
BitVecPush(&large1, bit1);
// Pattern 2: Prime-like pattern
bool bit2 = (i % 7 == 0) || (i % 11 == 0);
BitVecPush(&large2, bit2);
}
// Test set operations on large vectors
bool overlaps = BitVecOverlaps(&large1, &large2);
bool disjoint = BitVecDisjoint(&large1, &large2);
result = result && (overlaps != disjoint); // Should be opposite
// Test set operations on large vectors
bool overlaps = BitVecOverlaps(&large1, &large2);
bool disjoint = BitVecDisjoint(&large1, &large2);
result = result && (overlaps != disjoint); // Should be opposite
// Deadend tests
bool test_bitvec_compare_null_failures(void) {
printf("Testing BitVec compare NULL pointer handling\n");
}
bool test_bitvec_subset_null_failures(void) {
printf("Testing BitVec subset NULL handling\n");
}
bool test_bitvec_range_null_failures(void) {
printf("Testing BitVec range operations NULL handling\n");
}
bool test_bitvec_range_bounds_failures(void) {
printf("Testing BitVec range operations bounds checking\n");
}
bool test_bitvec_sorted_null_failures(void) {
printf("Testing BitVec sorted operations NULL handling\n");
- In
TestRunner.c:17
:
// Global jump buffer for capturing aborts
static jmp_buf g_test_abort_jmp;
static bool g_abort_captured = false;
// Callback function that gets called instead of abort()
- In
TestRunner.c:26
:
// Run a specific deadend test using setjmp/longjmp to capture aborts
bool test_deadend(TestFunction test_func, bool expect_failure) {
if (!test_func) {
printf("[ERROR] test_deadend: NULL test function provided\n");
- In
TestRunner.c:41
:
// Set up abort capturing for deadend tests
bool test_result = false;
// Set up jump point for abort capture
- In
TestRunner.c:86
:
for (int i = 0; i < count; i++) {
printf("[TEST %d/%d] ", i + 1, count);
bool result = tests[i]();
if (result) {
printf("[PASS]\n\n");
- In
TestRunner.c:117
:
for (int i = 0; i < count; i++) {
printf("[TEST %d/%d] ", i + 1, count);
bool result = test_deadend(tests[i], true); // All deadend tests expect failure
if (result) {
printf("[PASS]\n\n");
- In
TestRunner.h:34
:
/// TAGS: Testing, Deadend, Control
///
bool test_deadend(TestFunction test_func, bool expect_failure);
///