Menu

#17 New CU_ASSERT_HEX_EQUALfor comparing hex and not strings

open
None
5
2012-10-25
2010-11-12
No

It is needed to add the CU_ASSERT_HEX_EQUAL(actual, expected) which will do a memcmp and not a strcmp!!

I do this because the current CU_ASSERT_NSTRING_EQUAL will not detect the following snippet:

CU_ASSERT_NSTRING_EQUAL("\x3A\x00\xFF","\x3A\x00\xC6",3);

This is because the \x00 means end of string and thus it will return that the both data are equal.

Regards!
Mario

Discussion

Anonymous
Anonymous

Add attachments
Cancel