Commit graph

2672 commits

Author SHA1 Message Date
thorkill
4b6e956a2d Added first version of cmocka based unittest
To compile the test you will need cmocka installed on system.
Checks in configure.ac are still missing.

$ cd tinc/test/; make simple
to generate testing directory you can use cmocka-simple.sh
$ ./cmocka-simple.sh
‘mocks/conf1’ -> ‘/tmp/tmp.PtS9r796ns/conf1’
To run the test do: cd /tmp/tmp.PtS9r796ns ; ./simple

$ ./simple
[==========] Running 6 test(s).
[ RUN      ] test_edge_init
0 != 0x2
simple.c:73: error: Failure!

[  FAILED  ] test_edge_init
[ RUN      ] test_read_config_file
[       OK ] test_read_config_file
[ RUN      ] test_config_add_item
[       OK ] test_config_add_item
[ RUN      ] test_config_add_item_no_filename
value
simple.c:234: error: Failure!

[  FAILED  ] test_config_add_item_no_filename
[ RUN      ] test_splay_tree_init
[       OK ] test_splay_tree_init
[ RUN      ] test_splay_tree_basic
[       OK ] test_splay_tree_basic
[==========] 6 test(s) run.
[  PASSED  ] 4 test(s).
[  FAILED  ] 2 test(s), listed below:
[  FAILED  ] test_edge_init
[  FAILED  ] test_config_add_item_no_filename

 2 FAILED TEST(S)
2015-07-01 19:46:28 +02:00
thorkill
536256b2da Added support for cmocka *alloc 2015-07-01 19:04:22 +02:00
thorkill
dca3558d05 Leave a notice in the log when aborting 2015-07-01 19:01:42 +02:00
thorkill
24cea32efb Fix memory leak in splay_delete_tree
Use splay_delete_node to properly decrease counters and release memory.
2015-07-01 16:57:05 +02:00
thorkill
faef01317b Do not free splay_tree when tree->count != 0 2015-07-01 16:56:07 +02:00
thorkill
278cd4d856 Added missing libchacha_poly1305 while linking sptps_* tools
- should work on gentoo and Arch Linux - AUR
2015-07-01 13:54:57 +02:00
thorkill
905572863c Added support for darwin
Darwin does not have -lrt
2015-07-01 11:18:29 +02:00
thorkill
fbb62fa80e Make proper checks in configure
now compiles with gcc 5.1.0
2015-06-30 23:20:31 +02:00
thorkill
c3f8a93d52 Define variables in getopt.h 2015-06-30 22:50:29 +02:00
thorkill
82300c623d Make sptps_speed and sptps_test compile
TODO: tests do not work
2015-06-30 22:49:11 +02:00
thorkill
4bfa726f8b Cleanup src/Makefile.am
Make it compile on FreeBSD
2015-06-30 22:48:15 +02:00
thorkill
f8154e3012 Initialize values in tincctl.c 2015-06-30 19:51:19 +02:00
thorkill
6a6113b366 Initialize variables in info.c 2015-06-30 19:48:49 +02:00
thorkill
84d34f4f35 Initialize variables in invitation.c 2015-06-30 19:46:14 +02:00
thorkill
8fb52e05f3 Define g_argv as static 2015-06-30 19:44:35 +02:00
thorkill
de9f04c30e Initialize variables in linux/device.c 2015-06-30 19:42:37 +02:00
thorkill
fb2942a249 Initialize result 2015-06-30 19:40:33 +02:00
thorkill
7a61acabea Added hash_t definitions 2015-06-30 19:39:11 +02:00
thorkill
9e0c77e21f Initialize variables in splay_tree.c - splay_top_down() 2015-06-30 19:35:13 +02:00
thorkill
044fc684d0 Initialize variables in route.c 2015-06-30 19:33:22 +02:00
thorkill
6b3b90a7b1 Initialize variables in protocol_subnet.c 2015-06-30 19:29:44 +02:00
thorkill
932dc76f43 Initialize variables in protocol_edge.c 2015-06-30 19:28:11 +02:00
thorkill
fb1a8fd631 Initialize variables in protocol.c 2015-06-30 19:26:42 +02:00
thorkill
0bd116195a Initialize variables in node.c 2015-06-30 19:24:27 +02:00
thorkill
d803ac93dc Initialize variables in netutl.c 2015-06-30 19:23:15 +02:00
thorkill
e2245da720 Initialize addrinfo hint 2015-06-30 19:20:57 +02:00
thorkill
94b9723917 Initialize sock 2015-06-30 19:19:30 +02:00
thorkill
c17cb1a0f2 Proper initialization of subnet 2015-06-30 19:15:43 +02:00
thorkill
7ed725888b Do not exit on unused-parameters 2015-06-30 19:15:22 +02:00
thorkill
78be3b19de Fixed signal_t initialization 2015-06-30 19:14:54 +02:00
thorkill
8f5a59a027 Included missing names.h 2015-06-30 19:11:45 +02:00
thorkill
3dc9542ec2 Disable -fno-strict-overflow and enable some -Werror= 2015-06-30 19:06:17 +02:00
thorkill
c67a956351 removed afl atm 2015-06-30 18:48:48 +02:00
thorkill
daf99058e3 Moved few config parameters to make lib usage possible. 2015-06-30 18:43:37 +02:00
thorkill
e9e3811657 Added tests into automake files. 2015-06-30 18:38:48 +02:00
thorkill
68644500b8 Added libtool support. 2015-06-30 18:38:11 +02:00
thorkill
6633bf52e3 First working version 2015-06-30 18:36:57 +02:00
thorkill
6d9853618a Working on libs 2015-06-30 18:36:46 +02:00
thorkill
d24a91a7cf Include m4 directory and changed default CFLAGS to -g -O0 2015-06-30 18:16:54 +02:00
thorkill
6b62992c25 Revert "Silence most noisy sources of memory leakage."
This reverts commit 408fb3b011.
2015-06-30 18:10:38 +02:00
thorkill
c53a9719d5 Revert "s_errno was nerver used"
This reverts commit 157ee90568.
2015-06-30 18:10:23 +02:00
thorkill
d661be413f Revert "Proper variable initialization"
This reverts commit bf91a8a340.
2015-06-30 18:10:20 +02:00
thorkill
54b8bc6e86 Revert "Type mismatch and debug_t is always >= 0"
This reverts commit 62dc7b6fe5.
2015-06-30 18:10:18 +02:00
thorkill
8a39621c64 Revert "make usage of function parameters"
This reverts commit 8108b0d5eb.
2015-06-30 18:10:16 +02:00
thorkill
f5f35bd148 Revert "initialize variables used in conditional jumps"
This reverts commit f89b38947a.
2015-06-30 18:10:10 +02:00
thorkill
104017df7a Revert "Added UNUSED macro to silnce unused-parameter warnings"
This reverts commit 8d4b974dda.
2015-06-30 18:10:07 +02:00
thorkill
c68aa9d5cc Revert "explicit middle parameter definition"
This reverts commit 0ef605d864.
2015-06-30 18:10:05 +02:00
thorkill
ce7b019067 Revert "Added type casting from debug_t to int"
This reverts commit 3bfb343b85.
2015-06-30 18:10:02 +02:00
thorkill
d7c623b8c7 Revert "Changed int size into size_t"
This reverts commit f755d57f4e.
2015-06-30 18:10:00 +02:00
thorkill
5dac5eb451 Revert "Marked unused parameters"
This reverts commit 3a61d104d4.
2015-06-30 18:09:50 +02:00