beep beeeeep | you're crushing my apartment with your vehicle, human | so to these asm boughs I shall give my soul to keep | petals, my shroud gently carry me to sleep | murmurs and other tales
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Luiserebii 49e27f2ec1
Minor changes, minor additions
1 gadu atpakaļ
..
README.md Minor changes, minor additions 1 gadu atpakaļ

README.md

Mintx86asm32 API

This section contains documentation on using the Mint test framework. Each function is documented with its prototype and a brief description. Similar functions will be grouped together and described for brevity.

Running an assertion function causes a line to print to the standard output stream describing the success or failure of the assertion. Each assertion function takes a title argument, which is printed as the name of the assertion which succeeded or failed.

Booleans

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).

  • #### void test_assert(int32_t cond, char* title)

Alias of test_assert_true().

  • #### void test_assert_true(int32_t cond, char* title)

Asserts cond as true.

  • #### void test_assert_false(int32_t cond, char* title)

Asserts cond as false.

Integers

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.

  • #### void test_assert_equal(int32_t val, int32_t exp, char* title)

Alias of test_assert_equal_uint.

  • #### void test_assert_equal_uint(int32_t val, int32_t exp, char* title)

Asserts the equality of val to exp. On failure, prints integers as unsigned integers in decimal.

  • #### void test_assert_equal_bin(int32_t val, int32_t exp, char* title)

Asserts the equality of val to exp. On failure, prints integers in binary.

  • #### void test_assert_equal_oct(int32_t val, int32_t exp, char* title)

Asserts the equality of val to exp. On failure, prints integers in octal.

  • #### void test_assert_equal_hex(int32_t val, int32_t exp, char* title)

Asserts the equality of val to exp. On failure, prints integers in hexadecimal.

Strings

The functions below assert string values, or char arrays, testing the equality of the values in a string (s) against an expected string (exp).

  • #### void test_assert_equal_string(char* s, char* exp, char* title)

Assert the equality of s to exp.

  • #### void test_assert_equal_string_len(char* s, char* exp, int32_t n, char* title)

Assert the equality of the first n chars from both s and exp. In other words, the equality of the values in the range [a, a + n) and [b, b + n) is asserted.

Memory

This function asserts the equality of values along two regions of memory, comparing them byte-by-byte. If an unexpected byte is found, the index of the byte is printed alongside the byte expected, and the byte found.

  • #### void test_assert_equal_memory(void* ptr, void* exp, int32_t n, char* title)

Assert the equality of the first n bytes from both ptr and exp. In other words, the equality of the values in the range [a, a + n) and [b, b + n) is asserted.

Other

  • #### int test_end()

Prints a line summarizing the number of tests passed, and the number of tests failed. Returns an exit code to forward to the exit syscall.