Skip to content

Commit

Permalink
fixup tests: avoid loading sconfdir conf
Browse files Browse the repository at this point in the history
  • Loading branch information
dacav committed Jan 3, 2025
1 parent e9ae9c6 commit bc8ec61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,17 @@ static void test_regular(void) {
int r;
cfg_t cfg, cfg_defaults;

conf_file_init(&cf, NULL);
argv[2] = cf.arg;

// 1. Load the default
r = cfg_init(&cfg_defaults, 0, 0, NULL);
assert(r == PAM_SUCCESS);

// 2. Write the configuration file, changing every field.
conf_file_init(&cf, NULL);
config_flip_all(&cf, &cfg_defaults);

// 3. Load from the file
argv[2] = cf.arg;
r = cfg_init(&cfg, 0, sizeof(argv) / sizeof(*argv), argv);
assert(r == PAM_SUCCESS);
conf_file_clear(&cf);
Expand Down

0 comments on commit bc8ec61

Please sign in to comment.