2 * Copyright 2008, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
18 printf("Test %d...\n", gTestNr
);
20 if (setenv("TEST_VARIABLE", "42", true) != 0)
21 fprintf(stderr
, "Test %d: setting variable failed!\n", gTestNr
);
28 if (getenv("TEST_VARIABLE") != NULL
)
29 fprintf(stderr
, "Test %d: not cleared!\n", gTestNr
);
30 if (setenv("OTHER_VARIABLE", "test", true) != 0)
31 fprintf(stderr
, "Test %d: setting other failed!\n", gTestNr
);
36 main(int argc
, char** argv
)
46 static char* emptyEnv
[1] = {NULL
};
52 environ
= (char**)calloc(1, sizeof(*environ
));
55 // clearenv() is not part of the POSIX specs