Commit Graph
100 Commits
Author SHA1 Message Date
Patrick Pelissier abec9c37fa Clarify API
It iterates over UTF-8 code points, not Unicode characters
They can be different (!)
2022-09-10 10:32:34 +02:00
Patrick Pelissier 442b0e7cea Reduce size of struct string_it_t on 64 bits
by storing an offset to the next character
instead of a pointer. An offset can be stored as a
BYTE instead of a PTR since UT-8 can use at most
4 characters per code point.
2022-09-10 09:59:06 +02:00
Patrick Pelissier 0b853c6d52 Fix bug on bitset_resize function in case of increase of size:
the first limb may not be cleared properly in some cases.
(Reported by David M. Lary)
2022-09-04 19:27:38 +02:00
Patrick Pelissier cc7fc66899 Add bitset_ctz function 2022-08-29 19:31:19 +02:00
Patrick Pelissier 6b994c2928 Add m_core_ctz32 & m_core_ctz64 functions
(Count trailing zeros)
2022-08-29 19:30:09 +02:00
Patrick Pelissier e6fe36d3cd Revert "Perform coverage check by continuous integration tests."
as the numbers of lines generated by the generation macros
(which are included in the coverage measure)
through the C preprocessor depend on the exact version
of the C preprocessor.
There is no reliable way to get a measure on it,
except by always targeting the same compiler.
So, this measure of coverage (number of lines)
is not suitable for CIT. Ratio seems also not reliable enough.

This reverts commit f45ededf8b.
2022-08-22 23:53:10 +02:00
Patrick Pelissier f45ededf8b Perform coverage check by continuous integration tests. 2022-08-20 23:33:48 +02:00
Patrick Pelissier ed27bedcb4 Make coverage perfoms a check that the computed coverage is at least
not lower than the reference coverage, ensuring no regression
on the coverage of the tests can occur.

NOTE: some tests (m-i-shared) perform some dynamic test cases
where the exact coverage depend on the exact dynamic behavior
of the test. And this behavior is not always reproducible
(for exact the calls to m_core_backoff_wait may not occur
if the threads are not trying to grab the resource at the
exact same time).
As such, the reference of such tests is taken from the worst
case of execution of the coverage (with the lowest number
of lines covered).
2022-08-20 23:29:02 +02:00
Patrick Pelissier eb1a7a0435 Add more tests for tree 2022-08-19 23:16:42 +02:00
Patrick Pelissier de00fdc5f7 Update documentation 2022-08-13 23:50:51 +02:00
Patrick Pelissier 8febe12c5c Make stdlib an optional header 2022-08-09 00:20:32 +02:00
Patrick Pelissier 1368b201eb Fix warnings in release mode. 2022-08-09 00:19:55 +02:00
Patrick Pelissier 4ca166b0b9 Update examples to remove warnings with assertion disabled. 2022-08-09 00:19:26 +02:00
Patrick Pelissier c13533cf21 Fix naming 2022-08-08 01:22:05 +02:00
Patrick Pelissier 9fdf0f76e7 Add documentation of generic tree. 2022-08-08 01:20:30 +02:00
Patrick Pelissier 308f513edc As the allocated array offers write access to the index -1
remove if conditions to always access the array even for -1
The term tab[-1] will be filled with no pertinent value, but
we don't care about it.
2022-08-02 23:21:39 +02:00
Patrick Pelissier 900bcc3819 The internal array of the tree always allocates one more term,
so that the index -1 in the array exists and can be written.
2022-08-02 23:02:59 +02:00
Patrick Pelissier b6e0994dfc Add test case for _init_set with empty tree. 2022-08-02 23:02:33 +02:00
Patrick Pelissier 121339d948 Add _move_* functions for generic tree. 2022-08-01 22:17:26 +02:00
Patrick Pelissier c5bb84013a Create _raw methods for insertions. 2022-08-01 22:13:41 +02:00
Patrick Pelissier 65b49268d3 Fix allow_realloc for tree 2022-07-30 16:14:03 +02:00
Patrick Pelissier ecebd62f86 Update API compatibility documentation due to the _str to _cstr suffix change.
Note: the old (& still official) naming for the string functions
is still compatible since we have changed only the new namings (with m_ prefix).
See #99
2022-07-30 12:02:58 +02:00
Patrick Pelissier 6a8c9a703d Rename string functions as per latests changes 2022-07-30 12:02:32 +02:00
Patrick Pelissier ad05ae9aa5 Rename the string _suffix for Bounded Strings from _str to _cstr
See #99
2022-07-30 12:01:36 +02:00
Patrick Pelissier abffe201e5 Change the suffix of the functions dealing with C-String to _cstr
instead of _str.
See #99 for details.
2022-07-30 12:00:55 +02:00
Patrick Pelissier ee2bc27bda Fix issue in serial-bin
Note: this is a classic c error, so it may be interresting to discover
why the static analysis tools didn't report this error.
2022-07-30 04:40:09 +02:00
Patrick Pelissier 14b94865b7 Starting document tree. 2022-07-28 23:25:57 +02:00
Patrick Pelissier 6e1ceafcc2 Add more tests for tree. 2022-07-28 23:22:07 +02:00
Patrick Pelissier 58746560e9 Add comment 2022-07-28 23:21:54 +02:00
Patrick Pelissier 082adca3e6 Add test case 2022-07-27 23:48:59 +02:00
Patrick Pelissier ee1dc2a8e8 Fix issue in _graft_child 2022-07-27 23:48:40 +02:00
Patrick Pelissier 92e2d835bd Add more generic random tests 2022-07-26 23:12:41 +02:00
Patrick Pelissier 22aba04b47 Activate optimisation for coverage 2022-07-26 23:12:19 +02:00
Patrick Pelissier 399c615915 Fix issue in unlink 2022-07-26 23:04:15 +02:00
Patrick Pelissier cbdba0941a Adding more test cases 2022-07-26 22:49:07 +02:00
Patrick Pelissier 90c54a48d0 Remove uneeded test 2022-07-26 22:48:47 +02:00
Patrick Pelissier 22b18830f7 Improve test suite by performing no op swap operation randomly 2022-07-24 21:12:59 +02:00
Patrick Pelissier dab085e3a7 Fix other issue 2022-07-24 21:11:08 +02:00
Patrick Pelissier 66fac10a98 Fix corner case 2022-07-24 21:09:35 +02:00
Patrick Pelissier e5fb5ddde1 Fix some issues in insertion 2022-07-24 20:40:31 +02:00
Patrick Pelissier dcf20fbbd6 Add some tests for swap_at 2022-07-24 00:48:18 +02:00
Patrick Pelissier 5d659877fe Fix some bugs in the swap of node in a tree 2022-07-24 00:47:43 +02:00
Patrick Pelissier a30dd69aaa Add more tests for tree 2022-07-18 23:42:25 +02:00
Patrick Pelissier b1f698bb7b Fix tree _prune function 2022-07-18 23:42:13 +02:00
Patrick Pelissier 2323420a87 Add more test cases 2022-07-15 17:23:56 +02:00
Patrick Pelissier 7e120a3615 Add missing assertions 2022-07-15 16:54:51 +02:00
Patrick Pelissier 804db294ca Update test suite 2022-07-15 16:48:54 +02:00
Patrick Pelissier d12aa6c263 Don't expand tree contract for coverage 2022-07-15 00:32:26 +02:00
Patrick Pelissier d59e87d2bf Adding tests for OUT_STR/IN_STR 2022-07-07 22:21:29 +02:00
Patrick Pelissier 8f3c0af548 Add OUT_STR & IN_STR methods for tree 2022-07-07 22:21:14 +02:00
Patrick Pelissier 1f3013c445 Adding more corner cases 2022-07-07 22:10:00 +02:00
Patrick Pelissier f13e99ab1a Add coverage computation for tree 2022-07-07 22:09:51 +02:00
Patrick Pelissier fb8ad84675 Add more tests 2022-07-05 22:46:24 +02:00
Patrick Pelissier 12608afe10 Fix issue in comparing tree 2022-07-05 22:46:13 +02:00
Patrick Pelissier f97e92b4cb Complement basic tests 2022-07-04 20:47:53 +02:00
Patrick Pelissier a74e26e3de Add random generated insertion in a tree 2022-07-04 20:38:51 +02:00
Patrick Pelissier a30b783692 First basic test of tree container 2022-06-28 23:28:45 +02:00
Patrick Pelissier e64a6a22e7 Fix issues in tree 2022-06-28 23:28:09 +02:00
Patrick Pelissier 76892afa13 Fix some warnings. 2022-06-27 23:35:05 +02:00
Patrick Pelissier dcb1eb0d94 First version of IO for the tree container 2022-06-25 17:29:04 +02:00
Patrick Pelissier 950ea224ff Adding untested classic functions for tree (_init_set, _set, _equal, _hash, ...) 2022-06-18 15:26:19 +02:00
Patrick Pelissier b22a844007 update doc 2022-06-17 22:56:37 +02:00
Patrick Pelissier 502756c731 Simplify the control flow to count for utf8 encoded characters 2022-06-16 23:58:23 +02:00
Patrick Pelissier e38dc19ea1 Add current restriction on worker_spawn 2022-06-15 00:55:41 +02:00
Patrick Pelissier 2bebb2b4a1 Update example with new tree functions 2022-06-13 23:21:06 +02:00
Patrick Pelissier 5b7be93c1a Update tree:
* fix swap and add an additional argument to swap or not the child
* add sort functions for the children of a nodes
2022-06-13 23:21:06 +02:00
Patrick Pelissier d04270ae3f Proper use of API transformation for CMP operator in tuples 2022-06-13 23:21:06 +02:00
Patrick Pelissier 1bef7c1977 Fix formatting 2022-06-13 23:21:06 +02:00
Patrick Pelissier ae037ff7af Fix location of library in makefile 2022-06-13 22:12:56 +02:00
Patrick Pelissier a4267d60df Add usage of emplace with tuple 2022-06-04 23:44:22 +02:00
Patrick Pelissier 47e32ab2b3 Add support for EMPLACE_TYPE in TUPLE generations.
As a consequence, the oplist arguments for TUPLE_OPLIST
are much more rigorous. It shall really be the real oplists
of the types used to create the tuple, otherwise a compilation
error may be generated.
2022-06-04 23:41:18 +02:00
Patrick Pelissier 5ac08e42d8 Adding const for the type generation in emplace 2022-06-04 23:40:36 +02:00
Patrick Pelissier 9c59684b61 Fix the OPLIST args of TUPLE_OPLIST so that the given oplists match the types used for the definition of the tuple 2022-06-04 23:34:46 +02:00
Patrick Pelissier f26e1e5a12 Fix issue in case of recursive call of INIT_WITH with conditionnal INIT_WITH 2022-06-04 23:27:13 +02:00
Patrick Pelissier 1cde4633e6 Adding more corner cases 2022-06-04 23:26:03 +02:00
Patrick Pelissier 1393f8e9aa Update comments 2022-06-04 16:03:06 +02:00
Patrick Pelissier bfffa1d245 Update comments & naming 2022-06-04 16:02:58 +02:00
Patrick Pelissier 3a6b568ccc Update example to count the number of lines 2022-06-04 14:55:32 +02:00
Patrick Pelissier 453a920af8 Add methods to scan in post-order a sub-tree 2022-06-04 14:54:51 +02:00
Patrick Pelissier 1fd86ffc2e Update & fix 2022-06-03 22:59:55 +02:00
Patrick Pelissier 96a0639a8a Add more functions for TREE 2022-06-03 21:43:33 +02:00
Patrick Pelissier c12d0a3f23 Update comments 2022-06-03 21:43:15 +02:00
Patrick Pelissier cac8790405 Start working on example with generic tree 2022-06-01 19:52:28 +02:00
Patrick Pelissier ccd9726e01 Fix some warnings / errors 2022-06-01 19:51:50 +02:00
Patrick Pelissier 5516b50b3a Add WIP / untested generic tree datastructure 2022-05-31 23:00:19 +02:00
Patrick Pelissier b5a3e010d8 Add {} for if 2022-05-26 22:13:24 +02:00
Patrick Pelissier 2d7d267252 Update doc 2022-05-26 18:33:43 +02:00
Patrick Pelissier bd5d7aaada Fix wrong prototype in docs 2022-05-24 23:58:20 +02:00
Patrick Pelissier 18b6be8e00 Update doc 2022-05-24 23:56:34 +02:00
Patrick Pelissier 958abfef93 Make INIT_SET operator optional 2022-05-24 23:30:14 +02:00
Patrick Pelissier 198be1062b Update doc 2022-05-24 23:25:37 +02:00
Patrick Pelissier 0cfee02641 Make INIT operator optional 2022-05-24 23:22:36 +02:00
Patrick Pelissier 48dc38508a Factorize the documentation by using the generic interface (WIP) 2022-05-23 23:49:57 +02:00
Patrick Pelissier e763204bf7 Fix example 2022-05-22 22:54:25 +02:00
Patrick Pelissier 370baf56ab Factorize the documentation by using the generic interface (WIP) 2022-05-22 00:22:36 +02:00
Patrick Pelissier 4fd6bcbf99 Factorize the documentation by using the generic interface (WIP) 2022-05-19 22:41:19 +02:00
Patrick Pelissier 59d1e23dea Factorize the documentation by using the generic interface (WIP) 2022-05-19 22:28:53 +02:00
Patrick Pelissier cb173f2f81 Update doc 2022-05-19 21:45:16 +02:00
Patrick Pelissier d047174c2f Update doc 2022-05-19 21:43:42 +02:00
Patrick Pelissier df25159d03 Add generic interface chapter & start factorizing duplicate specification 2022-05-19 00:30:47 +02:00