/* * check_rules.c, SJ */ #include "test.h" struct rule_test { char filename[SMALLBUFSIZE]; char *expected_result; int days; }; struct rule_query { char query[SMALLBUFSIZE]; uint64 id; }; struct rule_query rules[] = { {"insert into archiving_rule (`from`, `days`) values('hirlevel@jatekokbirodalma.hu', 101)", 0}, {"insert into archiving_rule (`to`, `days`) values('xxx@acts.hu', 102)", 0}, {"insert into archiving_rule (`to`, `subject`, `days`) values('sj@acts.hu', 'ultra slim', 103)", 0}, {"insert into archiving_rule (`body`, `days`) values('quality and price is very good', 104)", 0}, {"insert into archiving_rule (`attachment_type`, _attachment_size, attachment_size, `days`) values('image', '>', 2000000, 105)", 0}, {"insert into archiving_rule (`attachment_type`, _attachment_size, attachment_size, `days`) values('image', '>', 20000, 106)", 0} }; static void fill_rule_table(struct config *cfg){ unsigned int i; struct session_data sdata; if(open_database(&sdata, cfg) == ERR){ printf("cannot open database\n"); return; } printf("adding testing rules...\n"); for(i=0; i20000,spam=-1", 0} }; if(open_database(&sdata, cfg) == ERR){ printf("cannot open database\n"); return; } inithash(data.mydomains); load_mydomains(&sdata, &data, cfg); initrules(data.archiving_rules); load_rules(&sdata, data.archiving_rules, SQL_ARCHIVING_RULE_TABLE); for(i=0; i