From: Zdenek C. <zde...@gm...> - 2010-12-01 07:32:01
|
Hi Chris, I'm glad that I could contribute a bit to the project that helped me so much. > I renamed _macro_x and _macro_y to > _ck_x and _ck_y. I took a look on the modified commit and I noticed that you swapped temporary variables in string comparison macro too. The swapped order of X and Y variables was not mistake but intention (I should have commented on that, my fault here). Consider following use case: _ck_assert_str("aaa", <, "bbb") will become ck_assert_msg( 0 < strcmp("aaa", "bbb"), ....) which will become ck_assert_msg( 0 < -1, ...) which will fail the test case even if "aaa" is less than "bbb" if you swap the X and Y parameters to the strcmp call, you will end with ck_assert_msg( 0 < strcmp("bbb", "aaa"), ....) which will become ck_asssert_msg( 0 < 1, ...) and the test case will pass (as it should) The same would be true for <=, > and >= comparison operators. I'm attaching patch which swaps strcmp parameters again and adds test for using other operators than ==, != in _ck_assert_str macro(). Regards, Zdenek Crha |