Browse Source

Adding documentation on functions testing for integer equality

Luiserebii 1 year ago
parent
commit
f73a19975f
Signed by: Luiserebii <luis@serebii.io> GPG Key ID: 525A84BC981B7D3E
1 changed files with 28 additions and 3 deletions
  1. 28
    3
      docs/README.md

+ 28
- 3
docs/README.md View File

@@ -8,15 +8,40 @@ Running an assertion function causes a line to print to the standard output stre
8 8
 
9 9
 The functions below assert a particular boolean value, which parallels the way expressions are evaluated and determine the behavior of control structures in C (i.e. `true` as non-zero and `false` otherwise).
10 10
 
11
-### test\_assert(int32\_t cond, char\* title)
11
+#### test\_assert(int32\_t cond, char\* title)
12 12
 
13 13
 Asserts `cond` as true. Alias of `test_assert_true()`.
14 14
 
15
-### test\_assert\_true(int32\_t cond, char\* title)
15
+#### test\_assert\_true(int32\_t cond, char\* title)
16 16
 
17 17
 Asserts `cond` as true.
18 18
 
19
-### test\_assert\_false(int32\_t cond, char\* title)
19
+#### test\_assert\_false(int32\_t cond, char\* title)
20 20
 
21 21
 Asserts `cond` as false.
22 22
 
23
+## Testing Integer Equality
24
+
25
+The functions below assert integer values, testing the equality of a value (`val`) against an expected value (`exp`). All of these functions perform the same logic in equality, but differ in terms of the formatting of the values when printing them on failure.
26
+
27
+#### test\_assert\_equal(int32\_t val, int32\_t exp, char\* title)
28
+
29
+Alias of `test_assert_equal_uint`.
30
+
31
+#### test\_assert\_equal\_uint(int32\_t val, int32\_t exp, char\* title)
32
+
33
+Asserts the equality of `val` to `exp`. On failure, prints integers as unsigned integers in decimal.
34
+
35
+#### test\_assert\_equal\_bin(int32\_t val, int32\_t exp, char\* title)
36
+
37
+Asserts the equality of `val` to `exp`. On failure, prints integers in binary.
38
+
39
+#### test\_assert\_equal\_oct(int32\_t val, int32\_t exp, char\* title)
40
+
41
+Asserts the equality of `val` to `exp`. On failure, prints integers in octal.
42
+
43
+#### test\_assert\_equal\_hex(int32\_t val, int32\_t exp, char\* title)
44
+
45
+Asserts the equality of `val` to `exp`. On failure, prints integers in hexadecimal.
46
+
47
+

Loading…
Cancel
Save