ValidateStrs
- Function
- August 22, 2025
Table of Contents
ValidateStrs
ValidateStrs
Description
Validate whether a given Strs
object is valid. Not foolproof but will work most of the time. Aborts if provided Strs
is not valid.
Parameters
Name | Direction | Description |
---|---|---|
vs | in | Pointer to Strs object to validate. |
Success
Continue execution, meaning given Strs
object is most probably valid.
Failure
abort
Usage example (Cross-references)
- In
Str.c:865
:
}
void ValidateStrs(const Strs* vs) {
VecForeachPtr(vs, sp, { ValidateStr(sp); });
}
- In
Str.Type.c:92
:
// Test ValidateStrs macro
bool test_validate_strs(void) {
printf("Testing ValidateStrs macro\n");
// Create a valid Strs
- In
Str.Type.c:98
:
// This should not crash
ValidateStrs(&sv);
// Note: We can't really test invalid Strs objects here as ValidateStrs
- In
Str.Type.c:130
:
// 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");
// Create an invalid Strs by corrupting its fields
- In
Str.Type.c:141
:
// This should abort the program
ValidateStrs(&sv);
// Should never reach here