StrDeinit
- Function
- August 22, 2025
Table of Contents
StrDeinit
StrDeinit
Description
Deinit str by freeing all allocations. str : Pointer to string to be deinited
Usage example (Cross-references)
- In
JSON.h:452
:
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
failed = true; \
si = saved_si; \
- In
JSON.h:540
:
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to read string key in object. Invalid JSON"); \
StrDeinit(&key); \
failed = true; \
si = saved_si; \
- In
JSON.h:552
:
if (StrIterPeek(&si) != ':') { \
LOG_ERROR("Expected ':' after key string. Failed to read JSON"); \
StrDeinit(&key); \
failed = true; \
si = saved_si; \
- In
JSON.h:574
:
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
failed = true; \
si = saved_si; \
- In
JSON.h:583
:
si = read_si; \
} \
StrDeinit(&key); \
si = JSkipWhitespace(si); \
\
- In
Io.h:394
:
StrWriteFmtInternal(&out_##__LINE__, (fmtstr), argv_##__LINE__, argc_##__LINE__); \
fwrite(out_##__LINE__.data, 1, out_##__LINE__.length, (stream)); \
StrDeinit(&out_##__LINE__); \
} while (0)
- In
Io.h:432
:
fwrite(out_##__LINE__.data, 1, out_##__LINE__.length, (stream)); \
fputc('\n', (stream)); \
StrDeinit(&out_##__LINE__); \
} while (0)
- In
Log.h:37
:
StrWriteFmt(&m, __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_FATAL, __func__, __LINE__, m.data); \
StrDeinit(&m); \
SysAbort(); \
} while (0)
- In
Log.h:56
:
StrWriteFmt(&m, __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_ERROR, __func__, __LINE__, m.data); \
StrDeinit(&m); \
} while (0)
- In
Log.h:74
:
StrWriteFmt(&m, __VA_ARGS__); \
LogWrite(LOG_MESSAGE_TYPE_INFO, __func__, __LINE__, m.data); \
StrDeinit(&m); \
} while (0)
- In
Sys.c:97
:
}
StrDeinit(©->name);
copy->type = 0;
- In
Sys.c:194
:
stat(entry_path.data, &path_stat);
StrDeinit(&entry_path);
SysDirEntry direntry = {0};
- In
JSON.c:45
:
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to read string key in object. Invalid JSON");
StrDeinit(&key);
return saved_si;
}
- In
JSON.c:53
:
if (StrIterPeek(&si) != ':') {
LOG_ERROR("Expected ':' after key string. Failed to read JSON");
StrDeinit(&key);
return saved_si;
}
- In
JSON.c:65
:
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to parse value. Invalid JSON.");
StrDeinit(&key);
return saved_si;
}
- In
JSON.c:71
:
LOG_INFO("User skipped reading of '{}' field in JSON object.", key);
StrDeinit(&key);
si = read_si;
si = JSkipWhitespace(si);
- In
JSON.c:305
:
if (has_exp) {
LOG_ERROR("Invalid number. Multiple exponent indicators.");
StrDeinit(&ns);
return saved_si;
}
- In
JSON.c:317
:
if (is_flt) {
LOG_ERROR("Invalid number. Multiple decimal indicators.");
StrDeinit(&ns);
return saved_si;
}
- In
JSON.c:347
:
"must appear after exponent 'E' or 'e' indicator."
);
StrDeinit(&ns);
return saved_si;
}
- In
JSON.c:355
:
"Expected only once after 'e' or 'E'."
);
StrDeinit(&ns);
return saved_si;
}
- In
JSON.c:371
:
if (!ns.length) {
LOG_ERROR("Failed to parse number. '{.8}'", LVAL(saved_si.data + saved_si.pos));
StrDeinit(&ns);
return saved_si;
}
- In
JSON.c:384
:
if (end == ns.data) {
LOG_ERROR("Failed to convert string to number.");
StrDeinit(&ns);
return saved_si;
}
- In
JSON.c:398
:
num->is_float = is_flt;
StrDeinit(&ns);
return si;
}
- In
JSON.c:592
:
Str s = StrInit();
si = JReadString(si, &s);
StrDeinit(&s);
if (si.pos == before_si.pos) {
- In
Log.c:75
:
// Free resources
StrDeinit(&file_name);
StrDeinit(&log_dir);
- In
Log.c:76
:
// Free resources
StrDeinit(&file_name);
StrDeinit(&log_dir);
if (e || !stderror) {
- In
Io.c:621
:
SysStrError(errno, &err);
LOG_ERROR("Could not save file position for rollback: {}", err);
StrDeinit(&err);
}
}
- In
Io.c:642
:
}
StrDeinit(&buffer);
}
- In
Io.c:805
:
StrPushBackZstr(o, "0x");
StrMerge(o, &hex);
StrDeinit(&hex);
});
} else {
- In
Io.c:875
:
StrPushBackZstr(o, "0x");
StrMerge(o, &hex);
StrDeinit(&hex);
i++;
}
- In
Io.c:952
:
// Merge the formatted number into output
StrMerge(o, &temp);
StrDeinit(&temp);
// Apply padding if width is specified
- In
Io.c:1044
:
// Merge the formatted number into output
StrMerge(o, &temp);
StrDeinit(&temp);
// Apply padding if width is specified
- In
Io.c:1154
:
// Merge the formatted number into output
StrMerge(o, &temp);
StrDeinit(&temp);
}
- In
Io.c:1284
:
char c = ProcessEscape(&curr);
if (c == 0) { // Error in escape sequence
StrDeinit(s);
return NULL;
}
- In
Io.c:1318
:
char c = ProcessEscape(&curr);
if (c == 0) { // Error in escape sequence
StrDeinit(s);
return NULL;
}
- In
Io.c:1345
:
if (quote) {
LOG_ERROR("Unterminated quoted string");
StrDeinit(s);
return NULL;
}
- In
Io.c:1547
:
// Try to parse as special value
if (StrToF64(&temp, v, NULL)) {
StrDeinit(&temp);
return i;
}
- In
Io.c:1550
:
return i;
}
StrDeinit(&temp);
// If parsing failed, fall back to the new approach
- In
Io.c:1606
:
if (!IsValidNumericString(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1613
:
if (!StrToF64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse f64");
StrDeinit(&temp);
return start;
}
- In
Io.c:1617
:
}
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:1663
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1670
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1678
:
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u8");
StrDeinit(&temp);
return start;
}
- In
Io.c:1685
:
if (val > UINT8_MAX) {
LOG_ERROR("Value {} exceeds u8 maximum ({})", val, UINT8_MAX);
StrDeinit(&temp);
return start;
}
- In
Io.c:1690
:
*v = (u8)val;
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:1738
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1745
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1753
:
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u16");
StrDeinit(&temp);
return start;
}
- In
Io.c:1760
:
if (val > UINT16_MAX) {
LOG_ERROR("Value {} exceeds u16 maximum ({})", val, UINT16_MAX);
StrDeinit(&temp);
return start;
}
- In
Io.c:1765
:
*v = (u16)val;
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:1812
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1819
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1827
:
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u32");
StrDeinit(&temp);
return start;
}
- In
Io.c:1834
:
if (val > UINT32_MAX) {
LOG_ERROR("Value {} exceeds u32 maximum ({})", val, UINT32_MAX);
StrDeinit(&temp);
return start;
}
- In
Io.c:1839
:
*v = (u32)val;
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:1887
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1894
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1901
:
if (!StrToU64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse u64");
StrDeinit(&temp);
return start;
}
- In
Io.c:1905
:
}
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:1952
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1959
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:1967
:
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i8");
StrDeinit(&temp);
return start;
}
- In
Io.c:1974
:
if (val > INT8_MAX || val < INT8_MIN) {
LOG_ERROR("Value {} outside i8 range ({} to {})", val, INT8_MIN, INT8_MAX);
StrDeinit(&temp);
return start;
}
- In
Io.c:1979
:
*v = (i8)val;
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:2027
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2034
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2042
:
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i16");
StrDeinit(&temp);
return start;
}
- In
Io.c:2049
:
if (val > INT16_MAX || val < INT16_MIN) {
LOG_ERROR("Value {} outside i16 range ({} to {})", val, INT16_MIN, INT16_MAX);
StrDeinit(&temp);
return start;
}
- In
Io.c:2054
:
*v = (i16)val;
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:2102
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2109
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2117
:
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i32");
StrDeinit(&temp);
return start;
}
- In
Io.c:2124
:
if (val > INT32_MAX || val < INT32_MIN) {
LOG_ERROR("Value {} outside i32 range ({} to {})", val, INT32_MIN, INT32_MAX);
StrDeinit(&temp);
return start;
}
- In
Io.c:2129
:
*v = (i32)val;
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:2177
:
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2184
:
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2191
:
if (!StrToI64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse i64");
StrDeinit(&temp);
return start;
}
- In
Io.c:2195
:
}
StrDeinit(&temp);
return start + pos;
}
- In
Io.c:2211
:
// Check if reading failed
if (next == i) {
StrDeinit(&temp);
return i;
}
- In
Io.c:2219
:
if (!result) {
LOG_ERROR("Failed to allocate memory for string");
StrDeinit(&temp);
return i;
}
- In
Io.c:2227
:
*out = result;
StrDeinit(&temp);
return next;
}
- In
Io.c:2269
:
Str bit_str = BitVecToStr(bv);
StrMerge(o, &bit_str);
StrDeinit(&bit_str);
}
}
- In
Io.c:2330
:
if (!StrToU64(&hex_str, &value, &config)) {
LOG_ERROR("Failed to parse hex value");
StrDeinit(&hex_str);
return start;
}
- In
Io.c:2340
:
*bv = BitVecFromInteger(value, bit_len);
StrDeinit(&hex_str);
return i;
}
- In
Io.c:2366
:
if (!StrToU64(&oct_str, &value, &config)) {
LOG_ERROR("Failed to parse octal value");
StrDeinit(&oct_str);
return start;
}
- In
Io.c:2376
:
*bv = BitVecFromInteger(value, bit_len);
StrDeinit(&oct_str);
return i;
}
- In
Io.c:2399
:
*bv = BitVecFromStr(bin_str.data);
StrDeinit(&bin_str);
return i;
}
- In
Io.c:2446
:
if (StrToF64(&temp, &val, NULL)) {
*v = (f32)val;
StrDeinit(&temp);
return i;
}
- In
Io.c:2449
:
return i;
}
StrDeinit(&temp);
// If parsing failed, fall back to the new approach
- In
Io.c:2505
:
if (!IsValidNumericString(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
return start;
}
- In
Io.c:2513
:
if (!StrToF64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse f32");
StrDeinit(&temp);
return start;
}
- In
Io.c:2518
:
*v = (f32)val;
StrDeinit(&temp);
return start + pos;
}
- In
BitVec.c:1606
:
}
StrDeinit(&bv_str);
return result;
}
- In
Str.c:84
:
}
void StrDeinit(Str* copy) {
ValidateStr(copy);
if (copy->data) {
- In
Str.c:120
:
ValidateStr(s);
Strs sv = VecInitWithDeepCopy(NULL, StrDeinit);
size keylen = ZstrLen(key);
- In
MisraEnum.c:207
:
}
StrDeinit(&invalid_enum.name);
StrDeinit(&invalid_enum.str);
StrDeinit(&enum_name);
- In
MisraEnum.c:208
:
StrDeinit(&invalid_enum.name);
StrDeinit(&invalid_enum.str);
StrDeinit(&enum_name);
StrDeinit(&code);
- In
MisraEnum.c:209
:
StrDeinit(&invalid_enum.name);
StrDeinit(&invalid_enum.str);
StrDeinit(&enum_name);
StrDeinit(&code);
- In
MisraEnum.c:210
:
StrDeinit(&invalid_enum.str);
StrDeinit(&enum_name);
StrDeinit(&code);
VecForeach(&entries, e, {
- In
MisraEnum.c:213
:
VecForeach(&entries, e, {
StrDeinit(&e.name);
StrDeinit(&e.str);
});
- In
MisraEnum.c:214
:
VecForeach(&entries, e, {
StrDeinit(&e.name);
StrDeinit(&e.str);
});
VecDeinit(&entries);
- In
MisraDoc.c:33
:
}
StrDeinit(&p->build_dir);
VecDeinit(&p->source_directories);
VecDeinit(&p->test_directories);
- In
MisraDoc.c:111
:
// read project config
Str config = StrInit();
Scope(&config, StrDeinit, {
if (!ReadCompleteFile(config_path, &config.data, &config.length, &config.capacity)) {
LOG_FATAL("Failed to read config file.");
- In
MisraDoc.c:123
:
Scope(&file_paths, VecDeinit, {
// temporary vector to store all directory paths to explore files in
Strs dir_paths = VecInitWithDeepCopy(NULL, StrDeinit);
Scope(&dir_paths, VecDeinit, {
VecMerge(&dir_paths, &project.source_directories);
- In
MisraDoc.c:166
:
VecForeach(&file_paths, file_path, {
Str file_contents = StrInit();
Scope(&file_contents, StrDeinit, {
if (!ReadCompleteFile(
file_path.data,
- In
MisraDoc.c:178
:
Str output_path = StrInit();
Scope(&output_path, StrDeinit, {
StrMerge(&output_path, &file_path);
LOG_INFO("{}", output_path);
- In
MisraDoc.c:185
:
Str md_code = StrInit();
Scope(&md_code, StrDeinit, {
// Create template strings for StrWriteFmt with escaped braces
const char* mdHeader =
- In
Main.c:16
:
if (rule_name.length) {
WriteFmtLn("Got Rule : {}", rule_name);
StrDeinit(&rule_name);
}
}
// Cleanup functions
void PersonDeinit(Person* person) {
StrDeinit(&person->name);
}
void ConfigDeinit(Config* config) {
StrDeinit(&config->log_level);
}
void SimpleProductDeinit(SimpleProduct* product) {
StrDeinit(&product->name);
VecDeinit(&product->tags);
}
}
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
}
}
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
return success;
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
PersonDeinit(&person);
return success;
}
StrDeinit(&json);
ConfigDeinit(&config);
return success;
Str json = StrInit();
Vec(Str) languages = VecInitWithDeepCopy(NULL, StrDeinit);
// Create strings and push them properly
}
StrDeinit(&json);
VecDeinit(&languages);
return success;
}
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
return success;
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
return success;
}
product.name = StrInitFromZstr("Laptop");
product.price = 999.99;
product.tags = VecInitWithDeepCopyT(product.tags, NULL, StrDeinit);
// Create strings and push them properly
}
StrDeinit(&json);
SimpleProductDeinit(&product);
return success;
- In
Read.Simple.c:35
:
// Cleanup functions
void PersonDeinit(Person* person) {
StrDeinit(&person->name);
}
- In
Read.Simple.c:39
:
void ConfigDeinit(Config* config) {
StrDeinit(&config->log_level);
}
- In
Read.Simple.c:43
:
void SimpleProductDeinit(SimpleProduct* product) {
StrDeinit(&product->name);
VecDeinit(&product->tags);
}
- In
Read.Simple.c:91
:
}
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
- In
Read.Simple.c:92
:
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
return success;
- In
Read.Simple.c:93
:
StrDeinit(&json);
StrDeinit(&name);
StrDeinit(&city);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
PersonDeinit(&person);
return success;
}
StrDeinit(&json);
ConfigDeinit(&config);
return success;
StrIter si = StrIterFromStr(json);
Vec(Str) languages = VecInitWithDeepCopy(NULL, StrDeinit);
JR_OBJ(si, {
}
StrDeinit(&json);
VecDeinit(&languages);
return success;
}
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
return success;
StrDeinit(&json);
StrDeinit(&data.user.name);
StrDeinit(&data.user.email);
return success;
}
SimpleProduct product = {0};
product.name = StrInit();
product.tags = VecInitWithDeepCopyT(product.tags, NULL, StrDeinit);
JR_OBJ(si, {
}
StrDeinit(&json);
SimpleProductDeinit(&product);
return success;
}
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
}
}
StrDeinit(&json);
return success;
}
Vec(i32) empty_numbers = VecInit();
Vec(Str) empty_strings = VecInitWithDeepCopy(NULL, StrDeinit);
JW_OBJ(json, {
}
StrDeinit(&json);
VecDeinit(&empty_numbers);
VecDeinit(&empty_strings);
}
StrDeinit(&json);
StrDeinit(&empty_name);
StrDeinit(&empty_desc);
StrDeinit(&json);
StrDeinit(&empty_name);
StrDeinit(&empty_desc);
return success;
StrDeinit(&json);
StrDeinit(&empty_name);
StrDeinit(&empty_desc);
return success;
}
}
StrDeinit(&json);
return success;
}
printf("[DEBUG] Large numbers JSON: %s\n", json.data);
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&json);
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&data);
StrDeinit(&json);
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&data);
return success;
StrDeinit(&path);
StrDeinit(&message);
StrDeinit(&data);
return success;
}
}
StrDeinit(&json);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&json);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&json);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&tab);
StrDeinit("es);
StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&tab);
return success;
StrDeinit(&backslash);
StrDeinit(&newline);
StrDeinit(&tab);
return success;
}
}
StrDeinit(&json);
VecDeinit(&empty_list);
return success;
}
StrDeinit(&json);
VecDeinit(&empty_arr);
VecDeinit(&filled_arr);
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
success = false;
StrDeinit(&json1);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json1);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&json1);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&single_str);
StrDeinit(&json2);
StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&single_str);
return success;
StrDeinit(&json3);
StrDeinit(&json4);
StrDeinit(&single_str);
return success;
}
void EdgeCaseDataDeinit(EdgeCaseData* data) {
StrDeinit(&data->empty_string);
VecDeinit(&data->empty_array);
VecDeinit(&data->numbers);
}
StrDeinit(&json1);
StrDeinit(&json2);
return success;
StrDeinit(&json1);
StrDeinit(&json2);
return success;
}
StrIter si2 = StrIterFromStr(json2);
Vec(Str) data = VecInitWithDeepCopy(NULL, StrDeinit);
JR_OBJ(si2, {
}
StrDeinit(&json1);
StrDeinit(&json2);
VecDeinit(&items);
StrDeinit(&json1);
StrDeinit(&json2);
VecDeinit(&items);
VecDeinit(&data);
}
StrDeinit(&json);
StrDeinit(&obj.name);
StrDeinit(&obj.description);
StrDeinit(&json);
StrDeinit(&obj.name);
StrDeinit(&obj.description);
return success;
StrDeinit(&json);
StrDeinit(&obj.name);
StrDeinit(&obj.description);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&json);
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&obj.data);
StrDeinit(&json);
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&obj.data);
return success;
StrDeinit(&obj.path);
StrDeinit(&obj.message);
StrDeinit(&obj.data);
return success;
}
}
StrDeinit(&json);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&json);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&json);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&obj.tab);
StrDeinit(&obj.escaped);
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&obj.tab);
return success;
StrDeinit(&obj.backslash);
StrDeinit(&obj.newline);
StrDeinit(&obj.tab);
return success;
}
}
StrDeinit(&json);
StrDeinit(&obj.name);
return success;
StrDeinit(&json);
StrDeinit(&obj.name);
return success;
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
VecDeinit(&obj.filled_items);
return success;
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
return success;
}
// Cleanup functions
void AnnSymbolDeinit(AnnSymbol* sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
void AnnSymbolDeinit(AnnSymbol* sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}
void FunctionInfoDeinit(FunctionInfo* info) {
StrDeinit(&info->name);
}
void SearchResultDeinit(SearchResult* result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecDeinit(&result->tags);
void SearchResultDeinit(SearchResult* result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->sha256);
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
}
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
}
}
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
StrDeinit(&expected_str);
StrDeinit(&output_clean);
StrDeinit(&expected_clean);
return result;
}
}
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
return success;
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
return success;
}
}
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
return success;
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
return success;
}
});
StrDeinit(&target_key);
}
});
});
StrDeinit(&source_key);
});
});
}
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
return success;
}
StrDeinit(&json);
VecDeinit(&functions);
return success;
result.analysis_id = 999;
result.sha256 = StrInitFromZstr("abc123");
result.tags = VecInitWithDeepCopyT(result.tags, NULL, StrDeinit);
// Create strings and push them properly
}
StrDeinit(&json);
SearchResultDeinit(&result);
return success;
});
StrDeinit(&target_key);
});
});
StrDeinit(&source_key);
});
});
}
StrDeinit(&json);
VecDeinit(&symbols);
return success;
}
StrDeinit(&json);
StrDeinit(&deep_message);
StrDeinit(&test_name);
StrDeinit(&json);
StrDeinit(&deep_message);
StrDeinit(&test_name);
return success;
StrDeinit(&json);
StrDeinit(&deep_message);
StrDeinit(&test_name);
return success;
}
VecPushBack(&numbers, num3);
Vec(Str) strings = VecInitWithDeepCopy(NULL, StrDeinit);
// Create strings and push them properly
}
StrDeinit(&json);
VecDeinit(&numbers);
VecDeinit(&strings);
- In
RoundTrip.c:37
:
// Cleanup functions
void TestPersonDeinit(TestPerson* person) {
StrDeinit(&person->name);
}
- In
RoundTrip.c:41
:
void TestConfigDeinit(TestConfig* config) {
StrDeinit(&config->log_level);
VecDeinit(&config->features);
}
- In
RoundTrip.c:148
:
}
StrDeinit(&json);
StrDeinit(&original.message);
StrDeinit(&parsed.message);
- In
RoundTrip.c:149
:
StrDeinit(&json);
StrDeinit(&original.message);
StrDeinit(&parsed.message);
return success;
- In
RoundTrip.c:150
:
StrDeinit(&json);
StrDeinit(&original.message);
StrDeinit(&parsed.message);
return success;
}
- In
RoundTrip.c:222
:
}
StrDeinit(&json);
return success;
}
- In
RoundTrip.c:274
:
}
StrDeinit(&json);
return success;
}
- In
RoundTrip.c:333
:
// Cleanup
StrDeinit(&json);
StrDeinit(&original.empty);
StrDeinit(&original.simple);
- In
RoundTrip.c:334
:
// Cleanup
StrDeinit(&json);
StrDeinit(&original.empty);
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
- In
RoundTrip.c:335
:
StrDeinit(&json);
StrDeinit(&original.empty);
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
- In
RoundTrip.c:336
:
StrDeinit(&original.empty);
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
- In
RoundTrip.c:337
:
StrDeinit(&original.simple);
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
- In
RoundTrip.c:338
:
StrDeinit(&original.with_spaces);
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
- In
RoundTrip.c:339
:
StrDeinit(&original.with_special);
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
StrDeinit(&parsed.with_special);
- In
RoundTrip.c:340
:
StrDeinit(&parsed.empty);
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
StrDeinit(&parsed.with_special);
return success;
- In
RoundTrip.c:341
:
StrDeinit(&parsed.simple);
StrDeinit(&parsed.with_spaces);
StrDeinit(&parsed.with_special);
return success;
}
- In
RoundTrip.c:353
:
// Original data
Vec(i32) original_numbers = VecInit();
Vec(Str) original_strings = VecInitWithDeepCopy(NULL, StrDeinit);
// Populate arrays
- In
RoundTrip.c:381
:
// Read back from JSON
Vec(i32) parsed_numbers = VecInit();
Vec(Str) parsed_strings = VecInitWithDeepCopy(NULL, StrDeinit);
StrIter si = StrIterFromStr(json);
- In
RoundTrip.c:440
:
// Cleanup
StrDeinit(&json);
VecDeinit(&original_numbers);
VecDeinit(&original_strings);
- In
RoundTrip.c:492
:
// Cleanup
StrDeinit(&json);
TestPersonDeinit(&original_person);
TestPersonDeinit(&parsed_person);
- In
RoundTrip.c:515
:
original.config.timeout = 30;
original.config.log_level = StrInitFromZstr("INFO");
original.config.features = VecInitWithDeepCopyT(original.config.features, NULL, StrDeinit);
// Create strings and push them properly
- In
RoundTrip.c:564
:
parsed.config.timeout = 0;
parsed.config.log_level = StrInit();
parsed.config.features = VecInitWithDeepCopyT(parsed.config.features, NULL, StrDeinit);
parsed.numbers = VecInitT(parsed.numbers);
parsed.flags = VecInitT(parsed.flags);
- In
RoundTrip.c:635
:
// Cleanup
StrDeinit(&json);
ComplexDataDeinit(&original);
ComplexDataDeinit(&parsed);
- In
RoundTrip.c:649
:
// Original empty data
Vec(i32) empty_numbers = VecInit();
Vec(Str) empty_strings = VecInitWithDeepCopy(NULL, StrDeinit);
Str empty_str = StrInit();
- In
RoundTrip.c:669
:
// Read back from JSON
Vec(i32) parsed_numbers = VecInit();
Vec(Str) parsed_strings = VecInitWithDeepCopy(NULL, StrDeinit);
Str parsed_str = StrInit();
bool found_empty_object = false;
- In
RoundTrip.c:706
:
// Cleanup
StrDeinit(&json);
StrDeinit(&empty_str);
StrDeinit(&parsed_str);
- In
RoundTrip.c:707
:
// Cleanup
StrDeinit(&json);
StrDeinit(&empty_str);
StrDeinit(&parsed_str);
VecDeinit(&empty_numbers);
- In
RoundTrip.c:708
:
StrDeinit(&json);
StrDeinit(&empty_str);
StrDeinit(&parsed_str);
VecDeinit(&empty_numbers);
VecDeinit(&empty_strings);
- In
RoundTrip.c:773
:
}
StrDeinit(&json);
return success;
}
- In
Read.Nested.c:34
:
void AnnSymbolDeinit(AnnSymbol* sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
- In
Read.Nested.c:35
:
void AnnSymbolDeinit(AnnSymbol* sym) {
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
- In
Read.Nested.c:36
:
StrDeinit(&sym->analysis_name);
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}
- In
Read.Nested.c:37
:
StrDeinit(&sym->function_name);
StrDeinit(&sym->sha256);
StrDeinit(&sym->function_mangled_name);
}
- In
Read.Nested.c:72
:
void FunctionInfoDeinit(FunctionInfo* info) {
StrDeinit(&info->name);
}
- In
Read.Nested.c:76
:
void ModelInfoDeinit(ModelInfo* info) {
StrDeinit(&info->name);
}
- In
Read.Nested.c:80
:
void SearchResultDeinit(SearchResult* result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecForeach(&result->tags, tag, { StrDeinit(&tag); });
- In
Read.Nested.c:81
:
void SearchResultDeinit(SearchResult* result) {
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecForeach(&result->tags, tag, { StrDeinit(&tag); });
VecDeinit(&result->tags);
- In
Read.Nested.c:82
:
StrDeinit(&result->binary_name);
StrDeinit(&result->sha256);
VecForeach(&result->tags, tag, { StrDeinit(&tag); });
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
- In
Read.Nested.c:84
:
VecForeach(&result->tags, tag, { StrDeinit(&tag); });
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
- In
Read.Nested.c:85
:
VecDeinit(&result->tags);
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
}
- In
Read.Nested.c:86
:
StrDeinit(&result->created_at);
StrDeinit(&result->model_name);
StrDeinit(&result->owned_by);
}
}
StrDeinit(&json);
return success;
}
}
StrDeinit(&json);
StrDeinit(&data.name);
return success;
StrDeinit(&json);
StrDeinit(&data.name);
return success;
}
}
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
return success;
StrDeinit(&json);
StrDeinit(&data.user.profile.name);
StrDeinit(&data.status);
return success;
}
}
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
return success;
StrDeinit(&json);
StrDeinit(&data.company.departments.engineering.head);
StrDeinit(&data.company.name);
return success;
}
}
StrDeinit(&json);
VecDeinit(&symbols);
return success;
}
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
return success;
}
StrDeinit(&json);
StrDeinit(&info.name);
return success;
StrDeinit(&json);
StrDeinit(&info.name);
return success;
}
}
StrDeinit(&json);
StrDeinit(&info.name);
return success;
StrDeinit(&json);
StrDeinit(&info.name);
return success;
}
result.binary_name = StrInit();
result.sha256 = StrInit();
result.tags = VecInitWithDeepCopyT(result.tags, NULL, StrDeinit);
result.created_at = StrInit();
result.model_name = StrInit();
}
StrDeinit(&json);
SearchResultDeinit(&result);
return success;
}
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
return success;
}
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
StrDeinit(&json);
StrDeinit(&response.message);
VecDeinit(&response.data);
return success;
- In
Str.Type.c:36
:
bool result = (s.length == 5 && ZstrCompare(s.data, "Hello") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Type.c:45
:
// Create a Strs object (vector of strings)
Strs sv = VecInitWithDeepCopy(NULL, StrDeinit);
// Add some strings
- In
Str.Type.c:66
:
}
VecDeinit(&sv); // This should call StrDeinit on each element
return result;
}
- In
Str.Type.c:86
:
bool result = true; // If we got here, the validation didn't crash
StrDeinit(&s);
return result;
}
- In
Str.Convert.c:86
:
}
StrDeinit(&s);
return result;
}
}
StrDeinit(&s);
return result;
}
result = result && (ZstrCompare(s.data, "nan") == 0);
StrDeinit(&s);
return result;
}
// Test hexadecimal conversion with explicit base
StrDeinit(&s);
s = StrInitFromZstr("ABCD"); // No 0x prefix when base is explicitly 16
StrParseConfig config = {.base = 16};
// Test hexadecimal conversion (auto-detect base with 0)
StrDeinit(&s);
s = StrInitFromZstr("0xABCD");
success = StrToU64(&s, &value, NULL);
// Test binary conversion
StrDeinit(&s);
s = StrInitFromZstr("0b101010");
success = StrToU64(&s, &value, NULL);
// Test octal conversion
StrDeinit(&s);
s = StrInitFromZstr("0o52");
success = StrToU64(&s, &value, NULL);
// Test zero
StrDeinit(&s);
s = StrInitFromZstr("0");
success = StrToU64(&s, &value, NULL);
// Test invalid input
StrDeinit(&s);
s = StrInitFromZstr("not a number");
success = StrToU64(&s, &value, NULL);
// Test negative number (should fail for unsigned)
StrDeinit(&s);
s = StrInitFromZstr("-123");
success = StrToU64(&s, &value, NULL);
result = result && (!success);
StrDeinit(&s);
return result;
}
// Test negative decimal conversion
StrDeinit(&s);
s = StrInitFromZstr("-12345");
success = StrToI64(&s, &value, NULL);
// Test hexadecimal conversion
StrDeinit(&s);
s = StrInitFromZstr("0xABCD");
success = StrToI64(&s, &value, NULL);
// Test binary conversion
StrDeinit(&s);
s = StrInitFromZstr("0b101010");
success = StrToI64(&s, &value, NULL);
// Test zero
StrDeinit(&s);
s = StrInitFromZstr("0");
success = StrToI64(&s, &value, NULL);
// Test invalid input
StrDeinit(&s);
s = StrInitFromZstr("not a number");
success = StrToI64(&s, &value, NULL);
result = result && (!success);
StrDeinit(&s);
return result;
}
// Test fractional conversion
StrDeinit(&s);
s = StrInitFromZstr("123.456");
success = StrToF64(&s, &value, NULL);
// Test negative number
StrDeinit(&s);
s = StrInitFromZstr("-123.456");
success = StrToF64(&s, &value, NULL);
// Test scientific notation
StrDeinit(&s);
s = StrInitFromZstr("1.23e2");
success = StrToF64(&s, &value, NULL);
// Test zero
StrDeinit(&s);
s = StrInitFromZstr("0");
success = StrToF64(&s, &value, NULL);
// Test infinity
StrDeinit(&s);
s = StrInitFromZstr("inf");
success = StrToF64(&s, &value, NULL);
// Test negative infinity
StrDeinit(&s);
s = StrInitFromZstr("-inf");
success = StrToF64(&s, &value, NULL);
// Test NaN
StrDeinit(&s);
s = StrInitFromZstr("nan");
success = StrToF64(&s, &value, NULL);
// Test invalid input
StrDeinit(&s);
s = StrInitFromZstr("not a number");
success = StrToF64(&s, &value, NULL);
result = result && (!success);
StrDeinit(&s);
return result;
}
result = result && success && (recovered_u64 == u64_values[i]);
StrDeinit(&s);
}
result = result && success && (recovered_i64 == i64_values[i]);
StrDeinit(&s);
}
result = result && success && (fabs(recovered_f64 - f64_values[i]) < tolerance);
StrDeinit(&s);
}
}
result = result && success && (recovered == base);
StrDeinit(&s);
}
result = result && success && (recovered_large > 1e299);
StrDeinit(&s);
// Test prefix handling
bool success = StrToU64(&test_str, &value, prefix_tests[i].base == 0 ? NULL : &config);
result = result && success && (value == prefix_tests[i].expected);
StrDeinit(&test_str);
}
}
StrDeinit(&s);
}
result = result && has_E;
StrDeinit(&s);
}
result = result && success && (recovered == large_value);
StrDeinit(&s);
}
result = result && success && (recovered == test_value);
StrDeinit(&s);
}
result = result && success && (recovered == test_value);
StrDeinit(&s);
}
result = result && success && (recovered == test_values[i]);
StrDeinit(&s);
if (!result)
result = result && success && (recovered == test_value);
StrDeinit(&s);
if (!result)
result = result && success && (fabs(recovered - test_value) < tolerance);
StrDeinit(&s);
if (!result)
result = result && (success || !success); // Either succeeds or fails gracefully
StrDeinit(&long_str);
return result;
- In
Str.Memory.c:38
:
result = result && (s.capacity < 100) && (s.capacity >= s.length);
StrDeinit(&s);
return result;
}
- In
Str.Memory.c:60
:
result = result && (s.data[1] == 'l' && s.data[2] == 'e');
StrDeinit(&s);
return result;
}
- In
Str.Memory.c:86
:
result = result && (s.length == 8) && (ZstrCompareN(s.data, "Hel", 3) == 0);
StrDeinit(&s);
return result;
}
- In
Str.Memory.c:111
:
result = result && (s.capacity >= 100);
StrDeinit(&s);
return result;
}
- In
Str.Memory.c:133
:
result = result && (s.data != NULL);
StrDeinit(&s);
return result;
}
- In
Str.Memory.c:150
:
// Test with an even-length string
StrDeinit(&s);
s = StrInitFromZstr("abcd");
- In
Str.Memory.c:160
:
// Test with a single-character string
StrDeinit(&s);
s = StrInitFromZstr("a");
- In
Str.Memory.c:170
:
// Test with an empty string
StrDeinit(&s);
s = StrInit();
- In
Str.Memory.c:179
:
result = result && (s.length == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:52
:
result = result && (ZstrCompare(s.data, "?He!llo.") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:68
:
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:84
:
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:101
:
bool result = (ZstrCompare(s1.data, "He Worldllo") == 0);
StrDeinit(&s1);
StrDeinit(&s2);
return result;
- In
Str.Insert.c:102
:
StrDeinit(&s1);
StrDeinit(&s2);
return result;
}
- In
Str.Insert.c:118
:
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:134
:
bool result = (ZstrCompare(s.data, "He Worldllo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:150
:
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:166
:
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:182
:
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:198
:
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:219
:
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:240
:
bool result = (ZstrCompare(s.data, "Hello World") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Insert.c:264
:
result = result && (s2.length == 0 && s2.data == NULL);
StrDeinit(&s1);
StrDeinit(&s2);
return result;
- In
Str.Insert.c:265
:
StrDeinit(&s1);
StrDeinit(&s2);
return result;
}
- In
Str.Insert.c:285
:
result = result && (s2.length == 6 && ZstrCompare(s2.data, " World") == 0);
StrDeinit(&s1);
StrDeinit(&s2);
return result;
- In
Str.Insert.c:286
:
StrDeinit(&s1);
StrDeinit(&s2);
return result;
}
- In
Str.Insert.c:306
:
result = result && (s2.length == 6 && ZstrCompare(s2.data, " World") == 0);
StrDeinit(&s1);
StrDeinit(&s2);
return result;
- In
Str.Insert.c:307
:
StrDeinit(&s1);
StrDeinit(&s2);
return result;
}
- In
Str.Insert.c:323
:
bool result = (ZstrCompare(s.data, "Hello World 2023") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:39
:
result = result && (ZstrCompare(s.data, "Hel") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:63
:
result = result && (ZstrCompare(s.data, "llo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:87
:
result = result && (ZstrCompare(s.data, "Hlo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:114
:
result = result && (ZstrCompare(s.data, "Hell") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:136
:
result = result && (ZstrCompare(s.data, "Hel") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:158
:
result = result && (ZstrCompare(s.data, "Hlo") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Remove.c:180
:
result = result && (ZstrCompare(s.data, "Heo") == 0);
StrDeinit(&s);
return result;
}
// Should never reach here if idx goes out of bounds
StrDeinit(&s);
return false;
}
// Should never reach here if bounds checking triggers
StrDeinit(&s);
return false;
}
// Should never reach here if bounds checking triggers
StrDeinit(&s);
return false;
}
// Should never reach here if bounds checking triggers
StrDeinit(&s);
return false;
}
// Should never reach here if bounds checking triggers
StrDeinit(&s);
return false;
}
// Should never reach here if bounds checking triggers
StrDeinit(&s);
return false;
}
// Should never reach here if bounds checking triggers
StrDeinit(&s);
return false;
}
- In
Io.Write.c:55
:
success = success && (ZstrCompare(output.data, "{{") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:95
:
StrWriteFmt(&output, "{}", s);
success = success && (ZstrCompare(output.data, "World") == 0);
StrDeinit(&s);
StrDeinit(&output);
- In
Io.Write.c:97
:
StrDeinit(&s);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:170
:
success = success && (ZstrCompare(output.data, "0") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:189
:
success = success && (ZstrCompare(output.data, "0xDEADBEEF") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:204
:
success = success && (ZstrCompare(output.data, "0b10100101") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:219
:
success = success && (ZstrCompare(output.data, "0o777") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:239
:
success = success && (ZstrCompare(output.data, "2.718280") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:264
:
success = success && (ZstrCompare(output.data, "3.1415926536") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:291
:
success = success && (ZstrCompare(output.data, "nan") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:329
:
success = success && (ZstrCompare(output.data, " abc ") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:352
:
success = success && (ZstrCompare(output.data, "3.140000 Hello 42") == 0);
StrDeinit(&output);
return success;
}
- In
Io.Write.c:543
:
output.data[5] == 'Z' && output.data[6] == '1' && output.data[7] == '2');
StrDeinit(&output);
StrDeinit(&s);
return success;
- In
Io.Write.c:544
:
StrDeinit(&output);
StrDeinit(&s);
return success;
}
- In
Io.Write.c:613
:
BitVecDeinit(&bv3);
BitVecDeinit(&bv_zero);
StrDeinit(&output);
return success;
}
bool success = (ZstrCompare(result.data, "H0e1l2l3o4") == 0);
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
}
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
success = success && (ZstrCompare(s.data, "HELLO") == 0);
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
}
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
bool success = (ZstrCompare(result.data, "Hello") == 0);
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
}
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
success = success && (ZstrCompare(s.data, "HELLO") == 0);
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
}
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
success = success && (empty_result.length == 0);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&empty_result);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&empty_result);
return success;
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&empty_result);
return success;
}
success = success && (ZstrCompare(end_result.data, "World") == 0);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&end_result);
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&end_result);
return success;
StrDeinit(&s);
StrDeinit(&result);
StrDeinit(&end_result);
return success;
}
success = success && (ZstrCompare(s.data, "Hello WORLD") == 0);
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
success = success && (ZstrCompare(s.data, "HELLO World") == 0);
StrDeinit(&s);
StrDeinit(&result);
return success;
StrDeinit(&s);
StrDeinit(&result);
return success;
}
- In
Str.Access.c:30
:
bool result = (first == 'H');
StrDeinit(&s);
return result;
}
- In
Str.Access.c:46
:
bool result = (last == 'o');
StrDeinit(&s);
return result;
}
- In
Str.Access.c:62
:
bool result = (begin == s.data && *begin == 'H');
StrDeinit(&s);
return result;
}
- In
Str.Access.c:78
:
bool result = (end == s.data + s.length && *end == '\0');
StrDeinit(&s);
return result;
}
- In
Str.Access.c:99
:
bool result = (c0 == 'H' && c1 == 'e' && c2 == 'l' && c3 == 'l' && c4 == 'o');
StrDeinit(&s);
return result;
}
- In
Str.Access.c:123
:
result = result && (p0 == s.data && p1 == s.data + 1 && p2 == s.data + 2 && p3 == s.data + 3 && p4 == s.data + 4);
StrDeinit(&s);
return result;
}
// Clean up
StrDeinit(&str);
BitVecDeinit(&bv);
Str str_obj = BitVecToStr(&bv);
result = result && (str_obj.length == 0);
StrDeinit(&str_obj);
// Test converting single bit
result = result && (str_obj.length == 1);
result = result && (StrCmpCstr(&str_obj, "1", 1) == 0);
StrDeinit(&str_obj);
// Test large conversions
str_obj = BitVecToStr(&bv);
result = result && (str_obj.length == 1000);
StrDeinit(&str_obj);
BitVecDeinit(&bv);
result = result && (ZstrCompare(str.data, patterns[i]) == 0);
StrDeinit(&str);
BitVecDeinit(&bv);
}
Str empty_str = BitVecToStr(&empty);
result = result && (empty_str.length == 0);
StrDeinit(&empty_str);
u64 empty_value = BitVecToInteger(&empty);
Str str = BitVecToStr(&bv);
result = result && (ZstrCompare(str.data, test_cases[i].pattern) == 0);
StrDeinit(&str);
// Test integer conversion (may depend on bit order)
result = result && cross_match;
StrDeinit(&str1);
StrDeinit(&str2);
StrDeinit(&str3);
StrDeinit(&str1);
StrDeinit(&str2);
StrDeinit(&str3);
BitVecDeinit(&bv1);
StrDeinit(&str1);
StrDeinit(&str2);
StrDeinit(&str3);
BitVecDeinit(&bv1);
BitVecDeinit(&bv2);
result = result && pattern_correct;
StrDeinit(&large_str);
// Test byte conversion
- In
Str.Init.c:34
:
bool result = (s.length == 0);
StrDeinit(&s);
return result;
}
- In
Str.Init.c:52
:
bool result = (s.length == len && ZstrCompareN(s.data, test_str, len) == 0 && s.data[len] == '\0');
StrDeinit(&s);
return result;
}
- In
Str.Init.c:69
:
bool result = (s.length == strlen(test_str) && ZstrCompare(s.data, test_str) == 0);
StrDeinit(&s);
return result;
}
- In
Str.Init.c:87
:
bool result = (dst.length == src.length && ZstrCompare(dst.data, src.data) == 0);
StrDeinit(&src);
StrDeinit(&dst);
return result;
- In
Str.Init.c:88
:
StrDeinit(&src);
StrDeinit(&dst);
return result;
}
- In
Str.Init.c:106
:
bool result = (dst.length == src.length && ZstrCompare(dst.data, src.data) == 0);
StrDeinit(&src);
StrDeinit(&dst);
return result;
- In
Str.Init.c:107
:
StrDeinit(&src);
StrDeinit(&dst);
return result;
}
- In
Str.Init.c:124
:
bool result = (ZstrCompare(s.data, "Hello, World!") == 0);
StrDeinit(&s);
return result;
}
- In
Str.Init.c:179
:
bool result = (success && dst.length == src.length && ZstrCompare(dst.data, src.data) == 0);
StrDeinit(&src);
StrDeinit(&dst);
return result;
- In
Str.Init.c:180
:
StrDeinit(&src);
StrDeinit(&dst);
return result;
}
- In
Str.Init.c:186
:
// Test StrDeinit function
bool test_str_deinit(void) {
printf("Testing StrDeinit\n");
Str s = StrInitFromZstr("Hello, World!");
- In
Str.Init.c:194
:
// Deinit the string
StrDeinit(&s);
// Check that the string is deinited correctly
- In
Io.Read.c:289
:
Str expected = StrInitFromZstr("Hello");
success = success && (StrCmp(&s, &expected) == 0);
StrDeinit(&expected);
StrClear(&s);
- In
Io.Read.c:297
:
expected = StrInitFromZstr("Hello, World!");
success = success && (StrCmp(&s, &expected) == 0);
StrDeinit(&expected);
StrDeinit(&s);
- In
Io.Read.c:299
:
StrDeinit(&expected);
StrDeinit(&s);
return success;
- In
Io.Read.c:318
:
Str expected = StrInitFromZstr("Alice");
success = success && (StrCmp(&name, &expected) == 0);
StrDeinit(&expected);
StrClear(&name);
- In
Io.Read.c:329
:
expected = StrInitFromZstr("Bob");
success = success && (StrCmp(&name, &expected) == 0);
StrDeinit(&expected);
StrDeinit(&name);
- In
Io.Read.c:331
:
StrDeinit(&expected);
StrDeinit(&name);
return success;
- In
Io.Read.c:509
:
printf("str_val test: comparing with 'Hello', pass = %s\n", str_pass ? "true" : "false");
success = success && str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);
- In
Io.Read.c:510
:
success = success && str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);
// Test :c with quoted strings (should work like regular string reading)
- In
Io.Read.c:520
:
printf("quoted str_val test: comparing with 'World', pass = %s\n", quoted_str_pass ? "true" : "false");
success = success && quoted_str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);
- In
Io.Read.c:521
:
success = success && quoted_str_pass;
StrDeinit(&expected);
StrDeinit(&str_val);
printf("Overall success: %s\n", success ? "true" : "false");
- In
Io.Read.c:553
:
success = success && test1_pass;
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:554
:
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:577
:
success = success && test2_pass;
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:578
:
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:601
:
success = success && test3_pass;
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:602
:
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:625
:
success = success && test4_pass;
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:626
:
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:649
:
success = success && test5_pass;
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:650
:
StrDeinit(&expected);
StrDeinit(&result);
}
- In
Io.Read.c:674
:
(ZstrCompare(result1.data, "10110") == 0) ? "true" : "false"
);
StrDeinit(&result1);
BitVecDeinit(&bv1);
- In
Io.Read.c:704
:
(ZstrCompare(result4.data, "1101") == 0) ? "true" : "false"
);
StrDeinit(&result4);
BitVecDeinit(&bv4);
- In
Io.Read.c:718
:
(ZstrCompare(result5.data, "0") == 0) ? "true" : "false"
);
StrDeinit(&result5);
BitVecDeinit(&bv5);
- In
Str.Ops.c:47
:
result = result && (cmp5 != 0);
StrDeinit(&s1);
StrDeinit(&s2);
StrDeinit(&s3);
- In
Str.Ops.c:48
:
StrDeinit(&s1);
StrDeinit(&s2);
StrDeinit(&s3);
StrDeinit(&s4);
- In
Str.Ops.c:49
:
StrDeinit(&s1);
StrDeinit(&s2);
StrDeinit(&s3);
StrDeinit(&s4);
return result;
- In
Str.Ops.c:50
:
StrDeinit(&s2);
StrDeinit(&s3);
StrDeinit(&s4);
return result;
}
- In
Str.Ops.c:83
:
result = result && (found5 != NULL && ZstrCompareN(found5, "World", 3) == 0);
StrDeinit(&haystack);
StrDeinit(&needle1);
StrDeinit(&needle2);
- In
Str.Ops.c:84
:
StrDeinit(&haystack);
StrDeinit(&needle1);
StrDeinit(&needle2);
StrDeinit(&needle3);
- In
Str.Ops.c:85
:
StrDeinit(&haystack);
StrDeinit(&needle1);
StrDeinit(&needle2);
StrDeinit(&needle3);
return result;
- In
Str.Ops.c:86
:
StrDeinit(&needle1);
StrDeinit(&needle2);
StrDeinit(&needle3);
return result;
}
- In
Str.Ops.c:120
:
result = result && !StrEndsWithCstr(&s, "ello", 4);
StrDeinit(&s);
StrDeinit(&prefix);
StrDeinit(&suffix);
- In
Str.Ops.c:121
:
StrDeinit(&s);
StrDeinit(&prefix);
StrDeinit(&suffix);
return result;
- In
Str.Ops.c:122
:
StrDeinit(&s);
StrDeinit(&prefix);
StrDeinit(&suffix);
return result;
}
- In
Str.Ops.c:136
:
// Test multiple replacements
StrDeinit(&s1);
s1 = StrInitFromZstr("Hello Hello Hello");
StrReplaceZstr(&s1, "Hello", "Hi", 2);
- In
Str.Ops.c:142
:
// Test StrReplaceCstr - use the full "World" string instead of just "Wo"
StrDeinit(&s1);
s1 = StrInitFromZstr("Hello World");
StrReplaceCstr(&s1, "World", 5, "Universe", 8, 1);
- In
Str.Ops.c:148
:
// Test StrReplace
StrDeinit(&s1);
s1 = StrInitFromZstr("Hello World");
Str find = StrInitFromZstr("World");
- In
Str.Ops.c:155
:
result = result && (ZstrCompare(s1.data, "Hello Universe") == 0);
StrDeinit(&s1);
StrDeinit(&find);
StrDeinit(&replace);
- In
Str.Ops.c:156
:
StrDeinit(&s1);
StrDeinit(&find);
StrDeinit(&replace);
return result;
- In
Str.Ops.c:157
:
StrDeinit(&s1);
StrDeinit(&find);
StrDeinit(&replace);
return result;
}
- In
Str.Ops.c:203
:
VecDeinit(&iters);
StrDeinit(&s);
return result;
}
- In
Str.Ops.c:215
:
Str stripped = StrLStrip(&s1, NULL);
bool result = (ZstrCompare(stripped.data, "Hello ") == 0);
StrDeinit(&stripped);
// Test StrRStrip
- In
Str.Ops.c:220
:
stripped = StrRStrip(&s1, NULL);
result = result && (ZstrCompare(stripped.data, " Hello") == 0);
StrDeinit(&stripped);
// Test StrStrip
- In
Str.Ops.c:225
:
stripped = StrStrip(&s1, NULL);
result = result && (ZstrCompare(stripped.data, "Hello") == 0);
StrDeinit(&stripped);
// Test with custom strip characters
- In
Str.Ops.c:228
:
// Test with custom strip characters
StrDeinit(&s1);
s1 = StrInitFromZstr("***Hello***");
- In
Str.Ops.c:233
:
stripped = StrLStrip(&s1, "*");
result = result && (ZstrCompare(stripped.data, "Hello***") == 0);
StrDeinit(&stripped);
stripped = StrRStrip(&s1, "*");
- In
Str.Ops.c:237
:
stripped = StrRStrip(&s1, "*");
result = result && (ZstrCompare(stripped.data, "***Hello") == 0);
StrDeinit(&stripped);
stripped = StrStrip(&s1, "*");
- In
Str.Ops.c:241
:
stripped = StrStrip(&s1, "*");
result = result && (ZstrCompare(stripped.data, "Hello") == 0);
StrDeinit(&stripped);
StrDeinit(&s1);
- In
Str.Ops.c:243
:
StrDeinit(&stripped);
StrDeinit(&s1);
return result;
}