jasmcaus / tau

A Micro (1k lines of code) Unit Test Framework for C/C++
MIT License
158 stars 30 forks source link

Add dedicated macros for pointer comparisons #46

Closed stefano-p closed 1 day ago

stefano-p commented 2 days ago

Add pointer comparison macros

Add new macros CHECK_PTR_EQ/NE and REQUIRE_PTR_EQ/NE to simplify pointer comparisons. These macros automatically handle void* casting and use the appropriate %p format specifier for pointer output.

Before: CHECK_EQ((void)ptr1, (void)ptr2);

After: CHECK_PTR_EQ(ptr1, ptr2);

This change improves code readability while maintaining consistency with the existing CHECK_NULL/NOT_NULL macros. The new macros follow TAU's established pattern and style conventions.