2023-06-13 07:15:20 -04:00
|
|
|
global name;
|
|
|
|
|
2023-06-18 05:11:23 -04:00
|
|
|
test_str(value, reach_value, description)
|
2023-06-12 14:26:35 -04:00
|
|
|
{
|
|
|
|
putstr(name);
|
2023-06-18 06:39:18 -04:00
|
|
|
if (strcmp(value, reach_value))
|
2023-06-12 14:26:35 -04:00
|
|
|
{
|
|
|
|
putstr(": ERROR: ");
|
|
|
|
putstr(", ");
|
2023-06-13 07:15:20 -04:00
|
|
|
putstr(description);
|
2023-06-12 14:26:35 -04:00
|
|
|
putstr(" [");
|
|
|
|
putstr(reach_value);
|
|
|
|
putstr(" != ");
|
|
|
|
putstr(value);
|
|
|
|
putstr("]");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
putstr(": OK: ");
|
2023-06-13 07:15:20 -04:00
|
|
|
putstr(description);
|
2023-06-12 14:26:35 -04:00
|
|
|
}
|
|
|
|
wrt '\n';
|
|
|
|
}
|
2023-06-18 06:39:18 -04:00
|
|
|
|
|
|
|
test_int(value, reach_value, description)
|
|
|
|
{
|
|
|
|
local value_str;
|
|
|
|
local reach_value_str;
|
|
|
|
|
|
|
|
putstr(name);
|
|
|
|
if (value != reach_value)
|
|
|
|
{
|
|
|
|
value_str = itoa(value);
|
|
|
|
if (value_str == 0)
|
|
|
|
return (0);
|
2023-06-18 09:21:02 -04:00
|
|
|
reach_value_str = itoa(reach_value);
|
2023-06-18 06:39:18 -04:00
|
|
|
if (reach_value_str == 0)
|
|
|
|
{
|
|
|
|
free(value_str);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
putstr(": ERROR: ");
|
|
|
|
putstr(", ");
|
|
|
|
putstr(description);
|
|
|
|
putstr(" [");
|
|
|
|
putstr(reach_value_str);
|
|
|
|
putstr(" != ");
|
|
|
|
putstr(value_str);
|
|
|
|
putstr("]");
|
|
|
|
free(value_str);
|
|
|
|
free(reach_value_str);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
putstr(": OK: ");
|
|
|
|
putstr(description);
|
|
|
|
}
|
|
|
|
wrt '\n';
|
|
|
|
}
|