883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
29 lines
1.0 KiB
C
29 lines
1.0 KiB
C
#define _POSIX_C_SOURCE 200809L
|
|
#include "accepted_feature_defaults.h"
|
|
#include <assert.h>
|
|
|
|
#ifndef GW_TEST_EXPECT_DEFAULT
|
|
#error Expected production default must be explicit in this test
|
|
#endif
|
|
|
|
int main(void)
|
|
{
|
|
const char* names[] = {"GW_QUEST_POI_DATASET", "GW_GUILD_RANKS_PROTOTYPE",
|
|
"GW_GUILD_MANAGEMENT_PROTOTYPE"};
|
|
const char* disabled[] = {"0", "", "true", "01", "1 ", "2"};
|
|
unsigned i, j;
|
|
for (i = 0; i < sizeof(names) / sizeof(names[0]); ++i) {
|
|
assert(unsetenv(names[i]) == 0);
|
|
assert(gw_accepted_feature_enabled(names[i]) == GW_TEST_EXPECT_DEFAULT);
|
|
assert(setenv(names[i], "1", 1) == 0);
|
|
assert(gw_accepted_feature_enabled(names[i]) == 1);
|
|
for (j = 0; j < sizeof(disabled) / sizeof(disabled[0]); ++j) {
|
|
assert(setenv(names[i], disabled[j], 1) == 0);
|
|
assert(gw_accepted_feature_enabled(names[i]) == 0);
|
|
}
|
|
assert(unsetenv(names[i]) == 0);
|
|
assert(gw_accepted_feature_enabled(names[i]) == GW_TEST_EXPECT_DEFAULT);
|
|
}
|
|
return 0;
|
|
}
|