objective c - Assertion debug type independent? -


i have written own assertion debug.

#define assert_equals(a,b) \ { \     if ((a)!=(b)) \     { \         printf(". assert_equals (%s:%d) %d!=%d\n",__function__,__line__,a,b); \     } \ } while (0)      

however compatible integer types. there way can change can support float/double types well?

thanks.

maybe should print them floats.

#define assert_equals(a, b) \   { \     if ((a)!=(b)) { \       printf(". assert_equals (%s:%d) %f!=%f\n",__function__,__line__,(float)(a),(float)(b)); \     } \   } while (0) 

it looks bad integers, example 1 show 1.00000, work both types.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -