Commit Graph
11129 Commits
Author SHA1 Message Date
Tobias Brunner 95e9915074 Enable leak detective for all test cases 2013-06-11 11:03:13 +02:00
Tobias Brunner 2b4902973b Added tests for bio_writer_t 2013-06-11 11:03:13 +02:00
Tobias Brunner eeb73dec79 Ensure buffer in bio_writer_t is properly increased
The previous code was problematic if bufsize/increase was smaller than 8
and an u_int64_t was written when the buffer was too small.  Also, for
large chunks and small bufsizes realloc() was called several times
instead of just once.
2013-06-11 11:03:13 +02:00
Tobias Brunner b4029a4aae Added tests for bio_reader_t 2013-06-11 11:03:13 +02:00
Tobias Brunner 01e15ab5c7 Add getter for the number of leaks to leak_detective_t 2013-06-11 11:03:13 +02:00
Tobias Brunner 80d9a9b722 Added tests for utils/enum.c 2013-06-11 11:03:13 +02:00
Tobias Brunner 9947a1f2f4 Gracefully handle NULL as argument for enum_from_name() 2013-06-11 11:03:13 +02:00
Tobias Brunner 06f6d80245 Additional tests for identification_t added 2013-06-11 11:03:13 +02:00
Tobias Brunner b1abf22bd0 Fail DN parsing if OID is unterminated
This is the case if the last OID is not followed by a = or if the string
starts with a =.
2013-06-11 11:03:12 +02:00
Tobias Brunner f00c350688 Fix DN printing if last RDN has an empty value 2013-06-11 11:03:12 +02:00
Tobias Brunner 10584df24f Fix DN parsing if last RDN has an empty value 2013-06-11 11:03:12 +02:00
Tobias Brunner c04498b608 Fix output of ASN.1 GN 2013-06-11 11:03:12 +02:00
Tobias Brunner 78c37de15a Use chunk_from_str in identification_from_string
We always have a non-empty string in those cases as "" is now handled
as ID_ANY.
2013-06-11 11:03:12 +02:00
Tobias Brunner c1be5d66cd Use local variable in chunk_from_str()
This allows using strdup() or other string functions as argument
without calling them twice.
2013-06-11 11:03:12 +02:00
Tobias Brunner 456a31e895 Parse empty string as ID_ANY 2013-06-11 11:03:12 +02:00
Tobias Brunner af67613ed6 Added tests for utils/utils.[ch] 2013-06-11 11:03:12 +02:00
Tobias Brunner 7b91011d6e Allow memstr() to be called with NULL arguments 2013-06-11 11:03:12 +02:00
Tobias Brunner 438a6693ca Removed unused clalloc() function 2013-06-11 11:03:12 +02:00
Tobias Brunner 819c02dbc6 timeval_add_ms() fixed
1000000us are exactly 1s so.
2013-06-11 11:03:12 +02:00
Tobias Brunner c2dba63bd4 Additional tests for chunk_t 2013-06-11 11:03:12 +02:00
Tobias Brunner ab73ae67d3 Also capture coverage data for tests but filter them from the result
Otherwise calls from test cases to static inline functions are not captured.
2013-06-11 11:03:12 +02:00
Tobias Brunner 9a8c873e90 Add tests for lib->get|set 2013-06-11 11:03:12 +02:00
Tobias Brunner 0e55270aea Remove dead code in token enumerator
Since we always search for the nearest separator (and strip them from
the front of the next token) there can't be any separators left at the
end of a token.
2013-06-11 11:03:12 +02:00
Tobias Brunner 7e9f6b276b Additional and improved enumerator_t tests 2013-06-11 11:03:11 +02:00
Tobias Brunner 0713c90927 Test remove and remove_at of hashtable_t if all items are in the same bucket 2013-06-11 11:03:11 +02:00
Tobias Brunner c721d6b6a3 Add test cases for invoke_* and clone_* of linked_list_t 2013-06-11 11:03:11 +02:00
Tobias Brunner afb6d9c301 Improve tests for linked_list_t.replace() 2013-06-11 11:03:11 +02:00
Tobias Brunner cca70ed331 Add additional tests for linked_list_t 2013-06-11 11:03:11 +02:00
Tobias Brunner bc90b3dd0a Improved test for linked_list_t.insert_before() 2013-06-11 11:03:11 +02:00
Tobias Brunner 01a3ba9e0f Enable coverage report for libstrongswan 2013-06-11 11:03:11 +02:00
Tobias Brunner 1f14b4a1f9 Add --enable-coverage configure option
This configure flag enables lcov [1] coverage generation and is intended
to be used with unit tests (--enable-unit-tests is implied).

A html coverage report can be generated by issuing the following command
in the toplevel build directory:

make coverage

[1] - http://ltp.sourceforge.net/coverage/lcov.php

Based on a patch by Adrian-Ken Rueegsegger.
2013-06-11 11:03:11 +02:00
Tobias Brunner 952073b8a7 Use proper type for enumerator_t/linked_list_t tests
Worked with -O2 but not with -O0.
2013-06-11 11:03:11 +02:00
Tobias Brunner de42bf35f9 Converted test for recursive mutex_t 2013-06-11 11:03:11 +02:00
Tobias Brunner bed4bc1327 Randomly allocate chunk_hash() key during first use
This avoids hash flooding attacks.
2013-06-11 11:03:11 +02:00
Tobias Brunner d1953fe403 Replace chunk_hash() with output from chunk_mac()
The quality is way better, the calculation is a bit slower though.

The key is statically initialized to zero, which will be changed later
to prevent hash flooding.
2013-06-11 11:03:11 +02:00
Tobias Brunner 1255de5a20 Adding chunk_mac() which calculates a 64-bit MAC using SipHash-2-4 2013-06-11 11:03:11 +02:00
Tobias Brunner 4e67f19528 Converted tests for chunk_t 2013-06-11 11:03:11 +02:00
Tobias Brunner e09461bf77 Converted and added tests for hashtable_t 2013-06-11 11:03:10 +02:00
Tobias Brunner 0298be5705 Converted tests for identification_t 2013-06-11 11:03:10 +02:00
Tobias Brunner 3cbacad40b Remove obsolete enumerator/linked_list tests in unit_tester plugin 2013-06-11 11:03:10 +02:00
Tobias Brunner 26e8375b14 Add tests combining linked_list_t and enumerators 2013-06-11 11:03:10 +02:00
Tobias Brunner d3b06618f8 Some minor Doxygen fixes for linked_list_t 2013-06-11 11:03:10 +02:00
Tobias Brunner ff8f12298f Add basic tests for linked_list_t 2013-06-11 11:03:10 +02:00
Tobias Brunner 0d67c8329b Redirect test runner output to stderr
This allows redirecting stdout of 'make check' to /dev/null.
2013-06-11 11:03:10 +02:00
Tobias Brunner f15fcdc9d8 Add tests for enumerator_t 2013-06-11 11:03:10 +02:00
Tobias Brunner 156dcbc12e Add test runner for unit tests in libstrongswan 2013-06-11 11:03:10 +02:00
Tobias Brunner 62516a7465 testing: Increase base image size so there is space for test results on winnetou 2013-06-11 11:01:26 +02:00
Tobias Brunner 053ad34959 testing: Ignore errors when searching for imcv log entries in daemon.log 2013-06-10 18:52:32 +02:00
Tobias Brunner 5d52087b54 Added missing string for full-length HMAC-SHA512 signer 2013-06-10 11:48:18 +02:00
Tobias Brunner cfae3a227d attr: Fix handling of invalid IPs listed after valid ones
Invalid IPs listed after a valid one resulted in an attribute
of the same type but with invalid data.
2013-06-05 17:26:24 +02:00