Commit graph

250 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
c8be5ec837 Document all the hash and checksum functions. 2016-09-17 17:30:13 +02:00
Dag-Erling Smørgrav
859ef07fa0 The Adler-32 checksum is described in RFC 1950, not RFC 1905. 2016-09-17 17:22:38 +02:00
Dag-Erling Smørgrav
0471eb2d33 Clean up the cryb_strl*(3) man pages. 2016-09-17 16:50:37 +02:00
Dag-Erling Smørgrav
615c273ae2 Clean up the cryb_sha1(3) man page and add man pages for the SHA-2 functions. 2016-09-17 16:50:12 +02:00
Dag-Erling Smørgrav
36a0135a73 Add missing third clause to new files. 2016-09-17 16:22:19 +02:00
Dag-Erling Smørgrav
2d526210c3 Add tests for each library's cryb_foo_version() function.
This may seem stupid, but I've found bugs in the past which would have been caught by unit tests which I didn't write because they seemed stupid.
2016-09-17 16:14:00 +02:00
Dag-Erling Smørgrav
43587fe51a Remove unneeded #includes. 2016-09-17 16:05:31 +02:00
Dag-Erling Smørgrav
b9cf4fb835 Implement the full range of BSD endianness conversion functions. 2016-09-15 11:18:01 +02:00
Dag-Erling Smørgrav
94a942caf0 Add support for __builtin_bswap16. 2016-09-15 11:09:34 +02:00
Dag-Erling Smørgrav
54cbd9c65b Import AX_GCC_BUILTIN from the GNU Autoconf Archive. 2016-09-15 11:09:16 +02:00
Dag-Erling Smørgrav
fa68f15c34 Ensure that we always have off_t and ssize_t in scope.
POSIX requires <stdio.h> and <unistd.h> to define off_t and ssize_t like <sys/types.h> does, but not all platforms respect that.  Play it safe by always including <sys/types.h>.
2016-09-15 10:15:00 +02:00
Dag-Erling Smørgrav
c55a3c4e09 Fix signed / unsigned mismatch. 2016-09-05 15:46:29 +02:00
Dag-Erling Smørgrav
f7a2f301ef Rename a few more files. 2016-09-04 16:34:30 +02:00
Dag-Erling Smørgrav
8ceb5a646c Only run Coverity Scan on the "scan" branch. 2016-09-04 16:32:17 +02:00
Dag-Erling Smørgrav
df0b4f11d6 Include <unistd.h> for ssize_t, which is used by the string library. 2016-09-04 16:20:24 +02:00
Dag-Erling Smørgrav
66715646d1 Respect user's CC 2016-09-04 16:18:13 +02:00
Dag-Erling Smørgrav
087aeca634 Bump version 2016-09-04 15:04:26 +02:00
Dag-Erling Smørgrav
68f20a9213 Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
Dag-Erling Smørgrav
c030e63ef2 Bump version 2016-03-21 12:35:42 +01: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
c68fd1098d We need <cryb/attributes.h> here for the CRYB_PRINTF() macro. 2016-03-15 14:28:47 +01:00
Dag-Erling Smørgrav
34fe861a36 <cryb/coverage.h> needs to be installed along with libcryb-test. 2016-03-15 14:27:02 +01:00
Dag-Erling Smørgrav
61a83a1fae Cosmetic: use angle brackets instead of double quotes 2016-03-15 14:26:32 +01:00
Dag-Erling Smørgrav
4d1703c77a Don't try to memset NULL if allocation fails.
Always emit UTRACE records, even for failed allocations.
When allocating more than was requested, fill the slop with garbage.
2016-02-19 12:23:17 +01:00
Dag-Erling Smørgrav
1d0f2a4ff3 Reserve room in the label buffer for the terminating NUL. 2016-02-19 12:20:25 +01:00
Dag-Erling Smørgrav
3fbaf4e647 Enable Coverity Scan addon. 2016-02-19 11:41:39 +01:00
Dag-Erling Smørgrav
0917eee32e Move configure to before_script. 2016-02-19 11:15:13 +01:00
Dag-Erling Smørgrav
c044f2580b Fix buffer over-read in percent_decode().
When decoding a trigram, percent_decode() would correctly increment the input pointer by an extra two characters (three total) but would not decrement the input length by the same amount.  This would result in a buffer over-read when decoding unterminated strings.
2016-01-10 23:29:03 +01:00
Dag-Erling Smørgrav
476374323d Vastly improve unit tests for percent-encoding API. 2016-01-10 23:28:04 +01:00
Dag-Erling Smørgrav
e40f2f7d4b Improve and document percent-encoding API.
- Ensure that the output is always NUL-terminated.
- Always include the terminating NUL in the returned length.
- Allow out == NULL, allowing the caller to check how much space is required before allocating.
- Add man page.
2016-01-10 23:25:28 +01:00
Dag-Erling Smørgrav
6eaaac308f Add a t_compare_strn() function which is to t_compare_str() what strncmp() is to
strcmp().
2016-01-10 18:49:19 +01:00
Dag-Erling Smørgrav
d2a98cd870 Generate .xz tarball by default, not .gz 2016-01-09 20:26:40 +01:00
Dag-Erling Smørgrav
e370978433 Run BullseyeCoverage tools quietly 2016-01-09 20:23:33 +01:00
Dag-Erling Smørgrav
9905f08c80 Change tarname to cryb-to to match github project name etc. 2016-01-09 20:16:04 +01:00
Dag-Erling Smørgrav
afe99d57dd Bump internal version number. 2016-01-09 20:12:01 +01:00
Dag-Erling Smørgrav
2237a13d5b Hide the no-op default case when not instrumenting for coverage analysis. 2016-01-09 18:37:36 +01:00
Dag-Erling Smørgrav
e5b9a12a35 Add -Wshadow. 2016-01-09 18:37:05 +01:00
Dag-Erling Smørgrav
da40b1fad8 Add man pages for a few functions. 2016-01-08 17:27:27 +01:00
Dag-Erling Smørgrav
6fd1a01fd2 Activate Travis CI 2015-12-15 21:55:35 +01:00
Dag-Erling Smørgrav
f9c8ce7c65 Build system overhaul 2015-12-14 18:08:22 +01:00
Dag-Erling Smørgrav
278ff6d113 GC empty directory 2015-12-14 17:51:01 +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
f04b77e2a5 typo 2015-12-14 16:05:18 +01:00
Dag-Erling Smørgrav
4d7893004c Prepare for moving to Github 2015-12-14 15:55:38 +01:00
Dag-Erling Smørgrav
d69c5dcdf8 Correct copyright ranges 2015-12-14 15:55:04 +01:00
Dag-Erling Smørgrav
5584b68908 Fix t_malloc_snapshot(): stash the difference between nalloc and nfree,
not the numbers themselves.

In t_malloc_printstats(), show information about mapped allocations.

In t_malloc_leaked(), check for leaked mapped allocations.  Note that
they would show up anyway since the metadata are allocated from the
bucket allocator, but this makes them more visible.
2015-11-02 19:45:12 +00:00
Dag-Erling Smørgrav
7b48030ada Revert accidental commit 2015-11-02 19:34:54 +00:00
Dag-Erling Smørgrav
955cbc3013 Add t_malloc_snapshot() which writes a snapshot of the allocator state to
a caller-provided buffer.  Use it to warn about leaks in each individual
test case.  Note that we can't fail a test case for leaking, because
individual test cases in a unit may modify shared state which is cleaned
up at the end of the series.
2015-11-02 19:34:03 +00: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
fd515ccd79 Clear up confusion between lengths and sizes.
Fix a harmless bug in string_shrink().
2015-10-13 21:42:57 +00:00