"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "utest/server/test_run_action.c" between
burp-2.3.14.tar.bz2 and burp-2.3.20.tar.bz2

About: Burp is a backup and restore program using librsync and also VSS (for Windows clients). Latest version.

test_run_action.c  (burp-2.3.14.tar.bz2):test_run_action.c  (burp-2.3.20.tar.bz2)
skipping to change at line 26 skipping to change at line 26
#define GLOBAL_CONF BASE "/burp-server.conf" #define GLOBAL_CONF BASE "/burp-server.conf"
#define CLIENTNAME "utestclient" #define CLIENTNAME "utestclient"
#define CCONFFILE CLIENTCONFDIR "/" CLIENTNAME #define CCONFFILE CLIENTCONFDIR "/" CLIENTNAME
struct parsedata struct parsedata
{ {
const char *str; const char *str;
enum action act; enum action act;
const char *backupnostr; const char *backupnostr;
const char *restoreregex; const char *restoreregex;
const char *input;
int ret; int ret;
}; };
static struct parsedata pd[] = { static struct parsedata pd[] = {
{ "restore 1:regex", ACTION_RESTORE, "1", "regex", 0 }, { "restore 1:regex", ACTION_RESTORE, "1", "regex", NULL, 0 },
{ "restore 2:", ACTION_RESTORE, "2", NULL, 0 }, { "restore 2:", ACTION_RESTORE, "2", NULL, NULL, 0 },
{ "restore 3", ACTION_RESTORE, "3", NULL, 0 }, { "restore 3", ACTION_RESTORE, "3", NULL, NULL, 0 },
{ "verify 1:regex", ACTION_VERIFY, "1", "regex", 0 }, { "restore restore_list 1:regex", ACTION_RESTORE, "1", "regex", "", 0 },
{ "verify 2:", ACTION_VERIFY, "2", NULL, 0 }, { "restore restore_list 2:", ACTION_RESTORE, "2", NULL, "", 0 },
{ "verify 3", ACTION_VERIFY, "3", NULL, 0 }, { "restore restore_list 3", ACTION_RESTORE, "3", NULL, "", 0 },
{ "backup 3", (enum action)0, NULL, NULL, -1 }, { "verify 1:regex", ACTION_VERIFY, "1", "regex", NULL, 0 },
{ "restore1:regex", (enum action)0, NULL, NULL, -1 }, { "verify 2:", ACTION_VERIFY, "2", NULL, NULL, 0 },
{ "", (enum action)0, NULL, NULL, -1 }, { "verify 3", ACTION_VERIFY, "3", NULL, NULL, 0 },
{ NULL, (enum action)0, NULL, NULL, -1 }, { "backup 3", (enum action)0, NULL, NULL, NULL, -1 },
{ "verify restore_list 1:regex", ACTION_VERIFY, "1", "regex", "", 0 },
{ "verify restore_list 2:", ACTION_VERIFY, "2", NULL, "", 0 },
{ "verify restore_list 3", ACTION_VERIFY, "3", NULL, "", 0 },
{ "restore1:regex", (enum action)0, NULL, NULL, NULL, -1 },
{ "", (enum action)0, NULL, NULL, NULL, -1 },
{ NULL, (enum action)0, NULL, NULL, NULL, -1 },
}; };
static void run_parse_test(struct parsedata *p) static void run_parse_test(struct parsedata *p)
{ {
int ret; int ret;
enum action act; enum action act;
struct conf **confs=NULL; struct conf **confs=NULL;
confs=confs_alloc(); confs=confs_alloc();
confs_init(confs); confs_init(confs);
ret=parse_restore_str_and_set_confs(p->str, &act, confs); ret=parse_restore_str_and_set_confs(p->str, &act, confs);
fail_unless(ret==p->ret); fail_unless(ret==p->ret);
if(!ret) if(!ret)
{ {
const char *backupnostr=NULL; const char *backupnostr=NULL;
const char *restoreregex=NULL; const char *restoreregex=NULL;
const char *input=NULL;
fail_unless(act==p->act); fail_unless(act==p->act);
backupnostr=get_string(confs[OPT_BACKUP]); backupnostr=get_string(confs[OPT_BACKUP]);
restoreregex=get_string(confs[OPT_REGEX]); restoreregex=get_string(confs[OPT_REGEX]);
input=get_string(confs[OPT_RESTORE_LIST]);
fail_unless(!strcmp(backupnostr, p->backupnostr)); fail_unless(!strcmp(backupnostr, p->backupnostr));
if(!p->restoreregex) if(p->restoreregex)
fail_unless(!strcmp(restoreregex, p->restoreregex));
else
fail_unless(restoreregex==NULL); fail_unless(restoreregex==NULL);
if(p->input)
fail_unless(!strcmp(input, p->input));
else else
fail_unless(!strcmp(restoreregex, p->restoreregex)); fail_unless(input==NULL);
} }
confs_free(&confs); confs_free(&confs);
alloc_check(); alloc_check();
} }
START_TEST(test_parse_restore_str_and_set_confs) START_TEST(test_parse_restore_str_and_set_confs)
{ {
FOREACH(pd) FOREACH(pd)
{ {
 End of changes. 7 change blocks. 
12 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)