]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
added more tests, changed makefile
authorPaul Cruz <paulcruz74@fb.com>
Wed, 5 Jul 2017 21:36:09 +0000 (14:36 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Wed, 5 Jul 2017 21:36:09 +0000 (14:36 -0700)
contrib/adaptive-compression/Makefile
contrib/adaptive-compression/multi.c
contrib/adaptive-compression/run.sh

index c6862198b3a21df7e83b59a41d3bc88e6fe67cdd..2ebec9ba9055b3042ecd602e0e750516e357bdbc 100644 (file)
@@ -29,4 +29,6 @@ clean:
        @$(RM) -f single multi
        @$(RM) -rf *.dSYM
        @$(RM) -f tmp*
+       @$(RM) -f tests/*.zst
+       @$(RM) -f tests/tmp*
        @echo "finished cleaning"
index a6fd64ce8518b6e017fe977d550f72d123814b1d..089dfe5a3f83bfedf8a436bfb941096b8f7d16e1 100644 (file)
@@ -1,6 +1,6 @@
 #define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
 #define FILE_CHUNK_SIZE 4 << 20
-#define MAX_NUM_JOBS 30;
+#define MAX_NUM_JOBS 50;
 #define stdinmark  "/*stdin*\\"
 #define stdoutmark "/*stdout*\\"
 #define MAX_PATH 256
@@ -96,7 +96,7 @@ static adaptCCtx* createCCtx(unsigned numJobs, const char* const outFilename)
     }
     memset(ctx, 0, sizeof(adaptCCtx));
     ctx->compressionLevel = 6; /* default */
-    pthread_mutex_init(&ctx->jobCompleted_mutex, NULL);
+    pthread_mutex_init(&ctx->jobCompleted_mutex, NULL); /* TODO: add checks for errors on each mutex */
     pthread_cond_init(&ctx->jobCompleted_cond, NULL);
     pthread_mutex_init(&ctx->jobReady_mutex, NULL);
     pthread_cond_init(&ctx->jobReady_cond, NULL);
index e6cb2066ec9621a6b4f3299cbfc5c54fcdf0a77c..b906ae7d1ef4246a41ca3ed1149bccf6c3b79e77 100755 (executable)
@@ -76,4 +76,34 @@ diff tmp tests/test.pdf
 echo "diff test complete: test.pdf"
 rm tmp*
 
+echo "Running multi-file tests"
+./multi tests/*
+zstd -d tests/test.pdf.zst -o tests/tmp
+zstd -d tests/test2.pdf.zst -o tests/tmp2
+zstd -d tests/test4.pdf.zst -o tests/tmp4
+zstd -d tests/test8.pdf.zst -o tests/tmp8
+zstd -d tests/test16.pdf.zst -o tests/tmp16
+zstd -d tests/test32.pdf.zst -o tests/tmp32
+zstd -d tests/test64.pdf.zst -o tests/tmp64
+zstd -d tests/test128.pdf.zst -o tests/tmp128
+zstd -d tests/test256.pdf.zst -o tests/tmp256
+zstd -d tests/test512.pdf.zst -o tests/tmp512
+zstd -d tests/test1024.pdf.zst -o tests/tmp1024
+zstd -d tests/test2048.pdf.zst -o tests/tmp2048
+
+diff tests/test.pdf tests/tmp
+diff tests/test2.pdf tests/tmp2
+diff tests/test4.pdf tests/tmp4
+diff tests/test8.pdf tests/tmp8
+diff tests/test16.pdf tests/tmp16
+diff tests/test32.pdf tests/tmp32
+diff tests/test64.pdf tests/tmp64
+diff tests/test128.pdf tests/tmp128
+diff tests/test256.pdf tests/tmp256
+diff tests/test512.pdf tests/tmp512
+diff tests/test1024.pdf tests/tmp1024
+diff tests/test2048.pdf tests/tmp2048
+
+echo "finished with tests"
+
 make clean