mirror of
https://github.com/tailix/libclayer.git
synced 2024-11-20 11:06:24 -05:00
46 lines
1.1 KiB
Django/Jinja
46 lines
1.1 KiB
Django/Jinja
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include "cmdline_test.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
void test_main()
|
|
{
|
|
{% for case in cases %}
|
|
{
|
|
{% if not case.error and len(case.result) %}
|
|
const char *const expected_argv[] = {
|
|
{% for item in case.result %}
|
|
{{ escape_str(item) }},
|
|
{% endfor %}
|
|
};
|
|
{% endif %}
|
|
|
|
test(
|
|
{{ escape_str(case.cmdline) }},
|
|
{{ escape_int(case.arg_count_max or 0) }},
|
|
{{ escape_int(case.buffer_size or 0) }},
|
|
{% if not case.error %}
|
|
true,
|
|
"",
|
|
{{ escape_int(len(case.result)) }},
|
|
{% if len(case.result) %}
|
|
expected_argv
|
|
{% else %}
|
|
NULL
|
|
{% endif %}
|
|
{% else %}
|
|
false,
|
|
{{ escape_str(case.error) }},
|
|
0,
|
|
NULL
|
|
{% endif %}
|
|
);
|
|
}
|
|
{% endfor %}
|
|
}
|