All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Fixes for very strict compiler warning flags.
atto_zeros()andatto_nzeros()fixes:- cast the buffer to verify to
const unsigned charinstead ofunsigned charto avoid dropping anyconstqualifier of the buffer - use
(unsigned) charinstead ofuint8_tto avoid needingstdint.h - avoid using variable names starting with double underscores as those are reserved handles and the compiler might complain
- cast the buffer to verify to
- Add missing
#include "atto.h"inatto.c. While typically works without it, some compilers are complaining
- Replace forced CMake compiler warning flags with
CMakePresets.jsonto make them recommended but optional - Introduce
.gitattributes, mostly to force native line endings in Git working directory - Introduce
.editorconfig, mostly to force length limits for lines of Markdown - Introduce
.clang-format - Autoformat everything, including Readme, Changelog, CMakeLists, and C code (
according to newly added
.clang-format)
Counters of assertion passes and failures, simple status report printing, check for non-all-zero arrays, fixes to avoid compilation warnings.
- Counters
atto_counter_assert_passesandatto_counter_assert_failurescounting the amount of assertionsatto_assert()or other aliases for it that failed or passed, to be able to see the progress through the test suite. atto_report()to provide a simple one-line indication of what is the status of the 2 counters above at any point in the test suite, including at the very end.atto_nzeros()which is the opposite ofatto_zeros(), checking that there is at least one non-zero value in the array of bytes. Useful to check whether a memory location has been initialised to non-zero values, especially for random strings or data from an outside source we don't know the exact format of.- GitHub workflow scripts to build and self-test on different operating systems. Fancy badges in the readme included.
- CMake configuration now uses a more portable set of compiler flags, taken from LibAscon.
- Some macro arguments did not have round brackets around them.
- Self-test changed to avoid compilation warnings due to improper use of types (integers for float/double functions and signed/unsigned warnings).
- Cast the length values passed to
atto_zeros()tosize_tto avoid warnings about signed/unsigned integer comparison. - Remove
.ideafolder from Git repo from now on. - Fixed some typos/missing words in the BSD 3-Clause license text file.
- Renamed Doxygen build target to avoid name clashes.
- Fix typo in Doxygen config, now it should properly exclude the test and source file.
- Fixed self-test skipping some of the checks.
No changes in the code, only documentation.
- Missing home page of the Doxygen documentation (being the content of the Readme)
- Missing title of the v1.3.0 release.
Clickable links to failed assertions!
atto_true()which simply maps toatto_assert()to have an opposite ofatto_false()with consistent naming.
- The printed text in case of a failed testcase now combines the filename and
the line together in the format like
filename.c:42with42being the line. This allows some IDEs to recognise it as a link to a specific code line and make them clickable for much easier testing and debugging.
-
atto_zeros(x, len)supports any kind of address asx, even nonuint8_t*thus allowing to scan arrays of other integers or floats or strings for zeros without explicitly casting them. They are converted touint8_t*internally. -
Replace Doxyfile with CMake building it instead. Add stricter options.
Two more macros, some project structure changes (new atto.c file, new src/
folder).
atto_memneq(a, b, len), the negation ofatto_memeq(), checks that two memory segments are not equal.atto_zeros(x, len)checks that a memory segment is filled with zeros.
- Move
atto_at_least_one_failvariable into new separateatto.cfile. Required as importingatto.hfile in many locations leads to many static copies of the same variable to be set, which means that different files see a different variable. - Move selftest into subfolder
tst/, movedatto.handatto.cintosrc/Required as when incorporating this whole project (or repo) into another C project, the IDE may interpret selftest.c as part of the main project, while it's not relevant. With this trick, one can set the atto/src folder as the only relevant one. - Variety of minor fixes in the readme.
More specialized macros for operators and floats, simpler examples, self test.
atto_false(x), the negation ofatto_assert(), to avoid forgetting the!when calling something likeatto_assert(!x)- Equality, inequality and other comparision operators, in particular to avoid
mistyping the operator, especially the
==into an assignment=when calling something likeatto_assert(a == b)- Equality
atto_eq(a, b) - Inequality
atto_neq(a, b) - Less-Than
atto_lt(a, b) - Less-Equal
atto_le(a, b) - Greater-Than
atto_gt(a, b) - Greater-Equal
atto_ge(a, b)
- Equality
- Floating point equality with a custom absolute tolerance
- For floats
atto_fdelta(a, b, abstol) - For doubles
atto_ddelta(a, b, abstol)
- For floats
- Non-finite floating point values checks
- Value is NaN
atto_nan(x) - Value is +/- Infinity
atto_inf(x) - Value is +Infinity
atto_plusinf(x) - Value is -Infinity
atto_minusinf(x) - Value is NaN or +/- Infinity
atto_notfinite(x) - Value is anything but Nan or +/- Infinity
atto_finite(x)
- Value is NaN
- Proper self-test
selftest.cof the whole Atto framework. - More compiler flags to check for errors during compilation of the self-test.
example.ctest file. Instead a simpler example is provided within the Readme.
Initial version.
- Various macros to test an assertion:
atto_assert()atto_fapprox()atto_dapprox()atto_flag()atto_noflag()atto_streq()atto_memeq()atto_fail()