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
API tests #187
Comments
API tests should explicitly perform tests with variously unaligned input/output buffers. (not likely to currently be a source of bugs except through compiler screwup, but if anyone starts going around adding SIMD code it would rapidly become a potential source of extremely hard to spot bugs). |
I would describe that test as the opposite of an api test: All it tests is the payloads, the usage of the API is hardcoded into the harness. An API test does stuff like calls with a null context or a number of pubkeys = 0, it acts like callers that fail to check errors or which call functions out of order... the goal is to validate the contract implied by the header documentation and maybe a little beyond it. |
It seems to me one of the first steps here is to separate the library code from the test code better. (Compile the library, then compile tests that link to that library from code in a separate directory) Broadly I see:
|
We're under-covered currently for tests that simulate crazy callers. The practise of asserting on statically wrong use limits the space of things that can / need to be tested here, but there is still some freedom.
This should be less "test" and more "mechanical verification that the interface we present to callers isn't unintentionally changed".
(As an example, libopus' test_opus_api, calls into the library about 116 million times. I'd say that libopus has an API surface area of about 50x larger that libsecp256k1)
The text was updated successfully, but these errors were encountered: