Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added macro to testing framework - `assert_eq_buf` Added the new `assert_eq_buf` macro to the testing framework in `test.h` this macro is used in unit tests and can check if two buffers, `a` and `b` have the same length and values data pairs. This macro is especially useful when unit tests are rolled out for indivdual instructons to compare buffers and expected outcomes. * Added `assert_eq_buf_arr` A suppliment to previosuly added macro - `assert_eq_buf` in commit number c9fb1ef, this checks for the same values in two arrays instead of two value buffers as such of the ones defined in `buffer.c`, giving greater flexability * Updated `test.h` testing library - Abstracted the `assert_eq_buf` macro to leverage the behavior of the new `assert_eq_buf_arr` macro by providing `.data` member to the `arr_len` argument. - Adding error exiting function call when the assertion statement does not turn true to be consisten with other macros * Added test case Added a test case specifically aimed at the `mr` instruction iden- ity, this unit test and the whole instruction testing in general will spilt out each unit as instruction encoder identities as described in `encoder.h`, allowing the modular integration and testing of instructions in an organised and clean way * Reverted change in previous commit in #11 The `instr_test` macro for the testing framework introduced into this header of commit no 63f8455 (as part of Pull request #11) Has been proved useless in further development and being a pain the ass to deal with, therefore, this macro will be removed for now, we can go back and revert this comm- it in the future if this functionality is needed again. (I mean, we can always revise a new and better solution if needed) * Finished filling out the `mov` test This commit describes the changes that has completed the develop- ment of the `mov` test which tests the `mov` instruction, (*clap* *clap* wow!) This test works by leveraging the power from the standard C pre- processor, this test first defines the set of expected values in hex, then feeds it into a macro that runs the `assemble_instr` function and compares the bytes returned.
- Loading branch information