Commit Graph

7 Commits

Author SHA1 Message Date
Bailey Thompson
411af131c2 Fix negative modulo for C89 (#45)
In C89, negative integer division and modulo is implementation-defined.

Case 1: division rounds to 0 (C89/90, C99, C11, C18)
-9 / 7 -> -1
-9 % 7 -> -2

Case 2: division rounds to negative infinity (C89/90)
-9 / 7 -> -2
-9 % 7 -> 5

This change fixes the deque data structure from having negative division and modulo to prevent this implementation-defined behavior.
2019-05-21 17:46:53 -04:00
Bailey Thompson
4332c05e0b Add compilation documentation (#36)
Add documentation for how to compile dynamic and static libraries.
2019-05-08 04:33:25 -04:00
Bailey Thompson
e2d596e4bd Refactor tests (#31)
Refactor tests in order for the component or logic that they are testing to be contained into individual sub-tests instead of all tests being contained in one big test for the whole data structure.

Add testing for out-of-memory (OOM) conditions. This makes the source code now 100% covered.

Bug fix! A bug has been identified and fixed in the list data structure in the list_add_last function. This bug would occur when adding an item to the back of the list because the pointers were not being updated properly.

Minor Bug fix! A bug has been identified and fixed in the unordered_set, unordered_map, unordered_multiset, and unordered_multimap data structures in their respective unordered_xxx_put functions. This bug would occur in an out-of-memory condition, which would cause the size of the collection to increase without actually adding the new element to it.
2019-05-04 17:59:20 -04:00
Bailey Thompson
24ca9d9d9b Make c89 compatible (#27) 2019-05-02 19:34:27 -04:00
Bailey Thompson
5fe6b40c3e Make c90 compatible (#26) 2019-05-02 14:49:36 -04:00
Bailey Thompson
6b297bfc51 Add code coverage (#22) 2019-04-30 03:23:35 -04:00
Bailey Thompson
f38199c743 Add continuous integration (#17) 2019-04-11 01:10:22 -07:00