summaryrefslogtreecommitdiff
path: root/29_outname/outname_test.c
diff options
context:
space:
mode:
Diffstat (limited to '29_outname/outname_test.c')
-rw-r--r--29_outname/outname_test.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/29_outname/outname_test.c b/29_outname/outname_test.c
new file mode 100644
index 0000000..6a9493a
--- /dev/null
+++ b/29_outname/outname_test.c
@@ -0,0 +1,18 @@
+#include "outname.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#define NUM_TESTS 3
+int main(void) {
+ char * testNames[NUM_TESTS] = {"input.txt",
+ "anotherTestFileName.txt",
+ "somethingelse"};
+
+ for (int i = 0; i < NUM_TESTS; i++) {
+ char * outName = computeOutputFileName(testNames[i]);
+ printf("'%s' => '%s'\n", testNames[i], outName);
+ free(outName);
+ }
+ return EXIT_SUCCESS;
+}