aboutsummaryrefslogtreecommitdiffstats
path: root/dispasstest.c
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-17 01:08:10 +0100
committerGravatar Tom Willemse2013-11-17 01:13:08 +0100
commit6aa289c124bd823ee352fa5bda5c9d7c792c7bf5 (patch)
treede4fccaaa3504f15bde9988ddab236c4bcab9687 /dispasstest.c
parent19129006d3e6507b7192d16fe10a29f3374b9df1 (diff)
downloadlibdispass-6aa289c124bd823ee352fa5bda5c9d7c792c7bf5.tar.gz
libdispass-6aa289c124bd823ee352fa5bda5c9d7c792c7bf5.zip
Remove main from libdispass, add test executable
- Add ~dispasstest~ which is used to test the DisPass algorithms. - Remove =main= from libdispass since shared libraries shouldn't have main functions - Add ~dispass.h~ which defines and exports the DisPass algorithms. - Make some functions in ~dispass.c~ static to make clear they're not exported anywhere.
Diffstat (limited to 'dispasstest.c')
-rw-r--r--dispasstest.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/dispasstest.c b/dispasstest.c
new file mode 100644
index 0000000..abf9750
--- /dev/null
+++ b/dispasstest.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dispass.h"
+
+int main(int argc, char *argv[])
+{
+ char *test1, *test2, *test3, *test4;
+
+ test1 = dispass1("test", "qqqqqqqq", 30, 0);
+ test2 = dispass1("test2", "qqqqqqqq", 50, 0);
+ test3 = dispass2("test", "qqqqqqqq", 30, 1);
+ test4 = dispass2("test2", "qqqqqqqq", 50, 10);
+
+ printf("%s\n", test1);
+ printf("%s\n", test2);
+ printf("%s\n", test3);
+ printf("%s\n", test4);
+
+ free(test1);
+ free(test2);
+ free(test3);
+ free(test4);
+
+ return 0;
+}