Commit graph

11 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
d0236914f7 Add test cases for the new string functions. 2016-09-17 23:32:11 +02:00
Dag-Erling Smørgrav
401465d8ea Move main() from libcryb-test to the test program.
Instead of having libcryb-test provide main() and assume that the test program defines t_prepare() and t_cleanup(), have libcryb-test provide a t_main() function which the test program calls with pointers to its prepare and cleanup functions.
2016-03-15 14:29:44 +01:00
Dag-Erling Smørgrav
0995671d43 Don't rely on side effects between sequence points 2015-12-14 17:49:49 +01:00
Dag-Erling Smørgrav
3e88a08c10 Clean up a bit and add more test cases, including comprehensive tests for
string_append_{cs,string}().
2015-10-13 21:44:37 +00:00
Dag-Erling Smørgrav
4fa82f7c7b Simplify existing tests:
- Set t_malloc_fatal so we don't have to check for allocation failures
  (the driver will catch the SIGABRT).
- Use string_dup_cs() instead of string_new() + string_append_cs().
2015-10-13 20:22:07 +00:00
Dag-Erling Smørgrav
e6049c1d6a Add string_len() (return length of string) and string_dup_cs() (create a
string from a null-terminated string).  Add test for string_trunc().
2015-10-12 10:23:24 +00:00
Dag-Erling Smørgrav
7a09b0638f I had forgotten that t_add_test() is actually a printf()-like variadic
function, which obviates the need for asprintf() in the string comparison
and equality tests.
2014-12-29 14:24:08 +00:00
Dag-Erling Smørgrav
0dae3b2417 Test string_equal() using the same test cases as for string_compare().
Improve test case descriptions.
2014-12-29 13:36:06 +00:00
Dag-Erling Smørgrav
2ad45cfccf Add a string comparison function and a string equality predicate.
Write test cases for the former.
2014-12-29 12:41:39 +00:00
Dag-Erling Smørgrav
479ffbba4a Remove author and sponsor tags; we'll deal with that some other way.
Remove $Cryb$ tags as it is likely that the code will move to git.
2014-08-01 14:31:07 +00:00
Dag-Erling Smørgrav
cc8109c760 WIP: unit tests for managed strings. 2014-08-01 13:55:01 +00:00