OpenCL-CTS
OpenCL-CTS copied to clipboard
printf is very undertested
The printf tests don't cover
- multiple arguments
- no arguments
- data before format specifier
It should also cover more special cases. E.g. both of these two:
printf("")
printf("%s", "")
.. should print an empty string. Furthermore, i think the test of printf with NaN is problematic. This test
{"%f","sqrt(-1.0f)"},
expects a -nan
to be printed, however it makes two assumptions, 1) that the sqrt operation returns a negative nan (not positive), and 2) that printf prints the sign of the nan. AFAICT, both are incorrect; the IEEE 754 does not assign any meaning to sign bit of the NaN, and printing out the sign is optional.
printf("%%")
could be interesting to test as well.
Can we put this to the "mobica-backlog"? Thanks!
Based on previous discussion and spec investigation below is a work plan to extend the current framework of printf tests. I will appreciate any suggestions and corrections:
New set of printf tests with multiple arguments. It will take into account:
- [x] various types of arguments test
- [x] no arguments test
- [x] additional data before/after format specifiers
New tests related to printout formatting:
- [x] verification of
space
flag prefixing - [x] verification of
zero
flag padding
Corrections for previous tests:
- [x] Completing vector tests to take into account all vector variants and conversions specifiers
- [x] Completing all floating precision printf tests with missing conversions %a, %A, %F
- [ ] Completing
TYPE_INT
test with long arguments - [x] Completing floating precision printf tests with
TYPE_DOUBLE
andTYPE_DOUBLE_LIMITS
- [x] Completing string tests with special cases and precision number
- [ ] Completing all non-vector conversions with length modifiers tests
- [x] Correction for nan/inf printf tests