-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Activate the tests, fix broken funcs #10
Comments
The tests actually do not return FAIL on any fails. They only checked if crashing or not, but didn't promote any functional tests error, like wrong result or wrong error code. See #10
The tests actually do not return FAIL on any fails. They only checked if crashing or not, but didn't promote any functional tests error, like wrong result or wrong error code. See #10
The tests actually do not return FAIL on any fails. They only checked if crashing or not, but didn't promote any functional tests error, like wrong result or wrong error code. See #10
The tests actually do not return FAIL on any fails. They only checked if crashing or not, but didn't promote any functional tests error, like wrong result or wrong error code. See #10 Tests or impl. fixed in subsequent commits
The tests actually do not return FAIL on any fails. They only checked if crashing or not, but didn't promote any functional tests error, like wrong result or wrong error code. See #10 Tests or impl. fixed in subsequent commits
You can try unity framework, wherein you can have test assertions on failure. For example: If you intend to test strcpy_s and you know that return value is EOK on success then any scenario of buffer overflow should make this test fail. Using TEST_ASSERT_EQUAL which takes first parameter as expected and second as actual, you can get appropriate test assertions. TEST( C11AnnexK, strcpy_s_ReturnsEOKWhenCopyIsSuccess) { int retVal; // To catch return Value char src[] = "strcpy_s Test"; char dest [5]; // Purposely dest is choosen smaller than src to demonstrate assertion retVal = strcpy_s (destLargerThanSrc, sizeof(destLargerThanSrc, src); TEST_ASSERT_EQUAL( EOK, retVal); // This should fail as retVal would differ (retVal will be ESNOSPC in this scenario) // This will result in assertion claiming that this test failed } |
There are many such C test frameworks. |
Fixed with 2.1 |
The tests actually do not return FAIL on any fails.
They only checked if crashing or not, but didn't promote any functional tests error, like wrong result or wrong error code.
In particular throw ESLEMAX when smax exceeds max, before the smax>dmax check (ESNOSPC).
Broken tests or functions:
The text was updated successfully, but these errors were encountered: