aboutsummaryrefslogtreecommitdiff
path: root/tests/test_spm_mkdtemp.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2020-04-18 23:54:54 -0400
committerGitHub <noreply@github.com>2020-04-18 23:54:54 -0400
commit59f7d29e2d707373ba1153337dca3279a2e3acc5 (patch)
treeffb98ee034d8f3a08366041ea2bd596c0c15986f /tests/test_spm_mkdtemp.c
parente0af560cabe6343e38061884c8361daddb5c7545 (diff)
parent262a399beb9c525633d5ac96d15754faeb65a28c (diff)
downloadspmc-59f7d29e2d707373ba1153337dca3279a2e3acc5.tar.gz
Merge pull request #26 from jhunkeler/fix_spm_mkdtemp
spm_mkdtemp requires a base directory:
Diffstat (limited to 'tests/test_spm_mkdtemp.c')
-rw-r--r--tests/test_spm_mkdtemp.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/test_spm_mkdtemp.c b/tests/test_spm_mkdtemp.c
index 619ca42..43bb8b6 100644
--- a/tests/test_spm_mkdtemp.c
+++ b/tests/test_spm_mkdtemp.c
@@ -8,15 +8,9 @@ struct TestCase testCase[] = {
size_t numCases = sizeof(testCase) / sizeof(struct TestCase);
int main(int argc, char *argv[]) {
- // SPM initializes a series of global variables when the main program kicks off.
- // We are not fully initializing SPM...
-
- TMP_DIR = calloc(PATH_MAX, sizeof(char));
- TMP_DIR[0] = '.';
-
for (size_t i = 0; i < numCases; i++) {
- char *result = spm_mkdtemp(testCase[i].arg[0].sptr, testCase[i].arg[2].sptr);
- myassert(result != NULL, "unexpected NULL\n");
+ char *result = spm_mkdtemp(".", testCase[i].arg[0].sptr, testCase[i].arg[2].sptr);
+ myassert(result != NULL, "unexpected NULL on case %zu\n", i);
int present = access(result, F_OK);
myassert(present == 0, "%s: %s\n", result, strerror(errno));
rmdirs(result);
@@ -24,4 +18,4 @@ int main(int argc, char *argv[]) {
}
free(TMP_DIR);
return 0;
-} \ No newline at end of file
+}