@@ -18,6 +18,7 @@ header library.
1818 * [ Assertion macros] ( #assertion-macros )
1919 * [ Interaction/behaviour validation macros] ( #interaction-or-behaviour-validation-macros )
2020 * [ Mock or Fake function creation macros] ( #mock-or-fake-function-declaration )
21+ * [ Breaking changes - Upgrade guide] ( #upgrade-guide )
2122* [ Testing yukti.h] ( #running-tests )
2223* [ Versioning] ( #versioning )
2324* [ Feedback] ( #feedback )
@@ -57,7 +58,6 @@ Different examples are placed in the [example](./example) folder.
5758
5859### Test macros
5960
60-
6161` YT_TEST ` & ` YT_TESTP ` macros are used to create a non-parameterised test and a parameterised
6262test respectively. Tests functions are identified by their name, that is the 2nd argument in these
6363macros. These tests functions need to be called in the ` main() ` function explicitly. Arguments for
@@ -98,13 +98,13 @@ these macros.
9898| ` YT_EQ_DOUBLE_REL(a, b, e) ` | Approx match a == b. Passes if ` mod(a - b) <= max(a,b)*e ` |
9999| ` YT_NEQ_DOUBLE_REL(a, b, e) ` | Approx match a != b. Passes if ` mod(a - b) > max(a,b)*e ` |
100100
101- ` YT_EQ_DOUBLE_REL(a, b, e) ` passes if the difference of a & b is less or equal to e % of the largest
102- of the two floating point numbers . For example, ` YT_EQ_DOUBLE_REL(1.1234, 1.12, 0.01) ` passes
103- because their difference of 0.0034 is < 1% of 1.1234.
101+ ` YT_EQ_DOUBLE_REL(a, b, e) ` passes if ` abs(a - b) ` is ` <= ` than ` e ` % of the larger floating point
102+ number . For example, ` YT_EQ_DOUBLE_REL(1.1234, 1.12, 0.01) ` passes because their difference of
103+ 0.0034 is < 1% of 1.1234.
104104
105105See [ Basic tests] ( ./example/basic_tests.c ) example
106106
107- #### Interaction or behaviour validation macros
107+ ### Interaction or behaviour validation macros
108108
109109More complex files work in conjunction with mocked functions. They help in validating interaction
110110between SUT and external functions. They help in determining if these external functions were called
@@ -139,6 +139,12 @@ validations and one can modify the behaviour of these fake functions in various
139139
140140See [ Mocking and faking] ( ./example/sensor_test.c ) example
141141
142+ ## Upgrade guide
143+
144+ * Old ` YT_EQ_DOUBLE ` was equivalent to ` YT_EQ_DOUBLE_ABS ` , so the former can be replaced with the
145+ later.
146+ * When comparing large floating point numbers, the newer ` YT_EQ_DOUBLE_REL ` works better.
147+
142148## Running tests
143149
144150In order to test yukti.h run ` tests/run_all_tests.sht ` . This runs integration tests & examples.
0 commit comments