corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmke...@apache.org
Subject [77/92] [abbrv] incubator-corinthia git commit: dfutil: Don't create temp directory for tests
Date Wed, 17 Dec 2014 13:29:27 GMT
dfutil: Don't create temp directory for tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/08938e76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/08938e76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/08938e76

Branch: refs/heads/stable
Commit: 08938e76c7c2ad62f7232002574d117ad3e6fc8a
Parents: 1f9b2b1
Author: Peter Kelly <peter@uxproductivity.com>
Authored: Mon Dec 8 10:00:07 2014 +0700
Committer: Peter Kelly <peter@uxproductivity.com>
Committed: Mon Dec 8 10:00:07 2014 +0700

----------------------------------------------------------------------
 consumers/dfutil/src/TestCase.c      |  2 --
 consumers/dfutil/src/TestCase.h      |  2 --
 consumers/dfutil/src/TestFunctions.c | 33 ++-----------------------------
 3 files changed, 2 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/08938e76/consumers/dfutil/src/TestCase.c
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/TestCase.c b/consumers/dfutil/src/TestCase.c
index 848db6f..65d3924 100644
--- a/consumers/dfutil/src/TestCase.c
+++ b/consumers/dfutil/src/TestCase.c
@@ -41,8 +41,6 @@ void TestCaseFree(TestCase *tc)
     free(tc->path);
     DFHashTableRelease(tc->input);
     DFBufferRelease(tc->output);
-    free(tc->tempPath);
-    free(tc->abstractPath);
     free(tc);
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/08938e76/consumers/dfutil/src/TestCase.h
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/TestCase.h b/consumers/dfutil/src/TestCase.h
index e79a12e..1721373 100644
--- a/consumers/dfutil/src/TestCase.h
+++ b/consumers/dfutil/src/TestCase.h
@@ -32,8 +32,6 @@ struct TestCase {
     char *path;
     DFHashTable *input;
     DFBuffer *output;
-    char *tempPath;
-    char *abstractPath;
 };
 
 TestCase *TestCaseNew(const char *path, DFHashTable *input);

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/08938e76/consumers/dfutil/src/TestFunctions.c
----------------------------------------------------------------------
diff --git a/consumers/dfutil/src/TestFunctions.c b/consumers/dfutil/src/TestFunctions.c
index 02ccbe7..91f5af5 100644
--- a/consumers/dfutil/src/TestFunctions.c
+++ b/consumers/dfutil/src/TestFunctions.c
@@ -307,7 +307,7 @@ end:
 static void LaTeX_testCreate(TestCase *script, int argc, const char **argv)
 {
     DFError *error = NULL;
-    DFPackage *htmlPackage = DFPackageNewFilesystem(script->abstractPath,DFFileFormatHTML);
+    DFPackage *htmlPackage = DFPackageNewMemory(DFFileFormatHTML);
     DFDocument *htmlDoc = TestCaseGetHTML(script,htmlPackage,&error);
     DFPackageRelease(htmlPackage);
     if (htmlDoc == NULL) {
@@ -423,40 +423,11 @@ static struct {
     { NULL, NULL },
 };
 
-static int testSetup(TestCase *script)
-{
-    DFError *error = NULL;
-    script->tempPath = createTempDir(&error);
-    if (script->tempPath == NULL) {
-        DFBufferFormat(script->output,"createTempDir: %s\n",DFErrorMessage(&error));
-        DFErrorRelease(error);
-        return 0;
-    }
-
-    script->abstractPath = DFAppendPathComponent(script->tempPath,"abstract");
-
-    if (!DFCreateDirectory(script->abstractPath,1,&error)) {
-        DFBufferFormat(script->output,"%s: %s",script->abstractPath,DFErrorMessage(&error));
-        DFErrorRelease(error);
-        return 0;
-    }
-
-    return 1;
-}
-
-static void testTeardown(TestCase *script)
-{
-    DFDeleteFile(script->tempPath,NULL);
-}
-
 void runTest(TestCase *script, const char *name, int argc, const char **argv)
 {
     for (int i = 0; testFunctions[i].name != NULL; i++) {
         if (!strcmp(testFunctions[i].name,name)) {
-            if (testSetup(script)) {
-                testFunctions[i].fun(script,argc,argv);
-                testTeardown(script);
-            }
+            testFunctions[i].fun(script,argc,argv);
             return;
         }
     }


Mime
View raw message