ctest
ctest copied to clipboard
Added string compare test utility
I added string compare test utility ASSERT_STRSTR and ASSERT_NOT_STRSTR. I found it really usefull for testing json string output.
Enjoy!
There are some issues i see:
- cointain -> contain
- why do you check the combinations of hackstack + needle, where one can be NULL? Why not force both of them to be non-NULL?
There are some issues i see:
- cointain -> contain
- why do you check the combinations of hackstack + needle, where one can be NULL? Why not force both of them to be non-NULL?
You are right! I fixed it so : ASSERT_NOT_STRSTR(NULL, ""); => PASS ASSERT_NOT_STRSTR("", NULL); => PASS ASSERT_NOT_STRSTR(NULL, NULL); => PASS ASSERT_STRSTR(NULL, ""); => FAIL ASSERT_STRSTR("", NULL); => FAIL ASSERT_STRSTR(NULL, NULL); => FAIL Both ASSERT_NOT_STRSTR(NULL, NULL) and ASSERT_STRSTR(NULL, NULL) are bit ambiguous as one could argue that NULL does contain NULL. Would you make a special case for those?