OpenVPN
|
#include "config.h"
#include "syshead.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <setjmp.h>
#include <cmocka.h>
#include <assert.h>
#include "argv.h"
#include "buffer.h"
Go to the source code of this file.
Macros | |
#define | PATH1 "/s p a c e" |
#define | PATH2 "/foo bar/baz" |
#define | PARAM1 "param1" |
#define | PARAM2 "param two" |
#define | SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\"" |
Functions | |
int | __wrap_parse_line (const char *line, char **p, const int n, const char *file, const int line_num, int msglevel, struct gc_arena *gc) |
static void | argv_printf__multiple_spaces_in_format__parsed_as_one (void **state) |
static void | argv_printf_cat__multiple_spaces_in_format__parsed_as_one (void **state) |
static void | argv_printf__combined_path_with_spaces__argc_correct (void **state) |
static void | argv_parse_cmd__command_string__argc_correct (void **state) |
static void | argv_parse_cmd__command_and_extra_options__argc_correct (void **state) |
static void | argv_printf_cat__used_twice__argc_correct (void **state) |
static void | argv_str__multiple_argv__correct_output (void **state) |
static void | argv_insert_head__empty_argv__head_only (void **state) |
static void | argv_insert_head__non_empty_argv__head_added (void **state) |
int | main (void) |
#define PARAM1 "param1" |
Definition at line 19 of file test_argv.c.
Referenced by __wrap_parse_line(), argv_printf_cat__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__used_twice__argc_correct(), and argv_str__multiple_argv__correct_output().
#define PARAM2 "param two" |
Definition at line 20 of file test_argv.c.
Referenced by __wrap_parse_line(), argv_printf_cat__used_twice__argc_correct(), and argv_str__multiple_argv__correct_output().
#define PATH1 "/s p a c e" |
Definition at line 17 of file test_argv.c.
Referenced by __wrap_parse_line(), argv_insert_head__empty_argv__head_only(), argv_insert_head__non_empty_argv__head_added(), argv_parse_cmd__command_and_extra_options__argc_correct(), argv_printf__combined_path_with_spaces__argc_correct(), argv_printf__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__used_twice__argc_correct(), and argv_str__multiple_argv__correct_output().
#define PATH2 "/foo bar/baz" |
Definition at line 18 of file test_argv.c.
Referenced by __wrap_parse_line(), argv_insert_head__non_empty_argv__head_added(), argv_printf__combined_path_with_spaces__argc_correct(), argv_printf__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__used_twice__argc_correct(), and argv_str__multiple_argv__correct_output().
#define SCRIPT_CMD "\"" PATH1 PATH2 "\"" PARAM1 "\"" PARAM2 "\"" |
Definition at line 21 of file test_argv.c.
Referenced by argv_parse_cmd__command_and_extra_options__argc_correct(), and argv_parse_cmd__command_string__argc_correct().
int __wrap_parse_line | ( | const char * | line, |
char ** | p, | ||
const int | n, | ||
const char * | file, | ||
const int | line_num, | ||
int | msglevel, | ||
struct gc_arena * | gc | ||
) |
|
static |
Definition at line 131 of file test_argv.c.
References argv_insert_head(), argv_new(), argv_reset(), assert_int_equal, assert_string_equal, and PATH1.
|
static |
Definition at line 145 of file test_argv.c.
References argv::argc, argv::argv, argv_insert_head(), argv_new(), argv_printf(), argv_reset(), assert_int_equal, assert_string_equal, PATH1, and PATH2.
Referenced by main().
|
static |
Definition at line 85 of file test_argv.c.
References argv::argc, argv_new(), argv_parse_cmd(), argv_printf_cat(), argv_reset(), assert_int_equal, PATH1, and SCRIPT_CMD.
Referenced by main().
|
static |
Definition at line 74 of file test_argv.c.
References argv::argc, argv_new(), argv_parse_cmd(), argv_reset(), assert_int_equal, and SCRIPT_CMD.
Referenced by main().
|
static |
Definition at line 57 of file test_argv.c.
References argv::argc, argv_new(), argv_printf(), argv_reset(), assert_int_equal, PATH1, and PATH2.
Referenced by main().
|
static |
Definition at line 34 of file test_argv.c.
References argv::argc, argv_new(), argv_printf(), argv_reset(), assert_int_equal, PATH1, and PATH2.
Referenced by main().
|
static |
Definition at line 45 of file test_argv.c.
References argv::argc, argv_new(), argv_printf(), argv_printf_cat(), argv_reset(), assert_int_equal, PARAM1, PATH1, and PATH2.
Referenced by main().
|
static |
Definition at line 97 of file test_argv.c.
References argv::argc, argv_new(), argv_printf(), argv_printf_cat(), argv_reset(), assert_int_equal, PARAM1, PARAM2, PATH1, and PATH2.
Referenced by main().
|
static |
Definition at line 110 of file test_argv.c.
References argv_new(), argv_printf(), argv_printf_cat(), argv_reset(), argv_str(), assert_string_equal, gc_free(), gc_new(), PA_BRACKET, PARAM1, PARAM2, PATH1, and PATH2.
Referenced by main().
int main | ( | void | ) |
Definition at line 170 of file test_argv.c.
References argv_insert_head__non_empty_argv__head_added(), argv_parse_cmd__command_and_extra_options__argc_correct(), argv_parse_cmd__command_string__argc_correct(), argv_printf__combined_path_with_spaces__argc_correct(), argv_printf__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__multiple_spaces_in_format__parsed_as_one(), argv_printf_cat__used_twice__argc_correct(), argv_str__multiple_argv__correct_output(), cmocka_run_group_tests_name, and cmocka_unit_test.