Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix unit testing #191

Open
wants to merge 9 commits into
base: New-Antares-Emulator-4
Choose a base branch
from

Conversation

meslubi2021
Copy link
Collaborator

No description provided.

- New file tree "tests" next to "src" dir containing :
  + source files (tests-matrix.*) with 20 tests on class Matrix
  + a cmake tree of CMakelists.txt (+ 1 file *.cmake) in order to generate makefiles or a .sln file (depending on the os)

- note that, in order to shorten the time between a refactoring of Matrix and a unit test run on Matrix, a convenient
  tiny matrix.lib (libmatrix.a) is created at compilation. This library is built from matrix.h/hxx and the smallest set of Antares source files
  that are needed to isolate Matrix class, so that it can be unit-tested.
  If Matrix changes, it can be compiled and tested swiftly, apart from Antares software.
…nit tests

- the jit manager is supposed to make more clear usage of just-in-time which is quite confusing otherwise.
- we start to replace some code snippet with usage of jit manager in Matrix::saveToCSVFile(...)
- we add 3 more unit tests to characterize the matrix unload following the matrix saving
we only enrich the jit manager with 2 new methods, more clear in their names (and therefore their intention) than the previous
piece of code they replace
The added unit tests regard the saving itself, not the previous possible matrix load or the just-in-time.
Matrices' internal save to CSV file descriptor function not entirely covered by unit tests run,
so we build a new test for it.
addHint turned to true means : starts printing file by printing the matrix dimensions.
This is unclear.
 addHint becomes print_dimensions
Method internalSaveToFileDescriptor(...) (that handles matrix-to-buffer dumping) contains a complicated if-else, and code duplication.
We export this complexity elsewhere, under the form of a polymorphism : creation of a matrix-to-buffer dumper depending
on the matrix size and coefficients type, and on the numbers after decimal is asked for.
@meslubi2021 meslubi2021 self-assigned this Jul 17, 2024
Copy link

mergify bot commented Jul 17, 2024

⚠️ The sha of the head commit of this PR conflicts with #26. Mergify cannot evaluate rules on this PR. ⚠️

Copy link

Stale pull request message

Copy link

mergify bot commented Oct 10, 2024

⚠️ The sha of the head commit of this PR conflicts with #26. Mergify cannot evaluate rules on this PR. ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants