Fix issue 36. Give each unit test a fresh configuration context - helps tests pass when a config file is passed in, which can

mess up the "expected" output, as this is testing loading
values into the configuration system.
remotes/origin/master-1.0.x
Jason Ish 15 years ago committed by Victor Julien
parent 749647a69d
commit 668b86cba4

@ -302,6 +302,9 @@ rule-files:\n\
default-log-dir: /tmp\n\
";
ConfCreateContextBackup();
ConfInit();
ConfNode *node;
ConfYamlLoadString(input, strlen(input));
node = ConfGetNode("rule-files");
@ -326,6 +329,9 @@ default-log-dir: /tmp\n\
i++;
}
ConfDeInit();
ConfRestoreContextBackup();
return 1;
}
@ -342,6 +348,9 @@ logging:\n\
log-level: info\n\
";
ConfCreateContextBackup();
ConfInit();
ConfYamlLoadString(input, strlen(input));
ConfNode *outputs;
@ -393,6 +402,9 @@ logging:\n\
if (strcmp(output_param->val, "info") != 0)
return 0;
ConfDeInit();
ConfRestoreContextBackup();
return 1;
}

Loading…
Cancel
Save