You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of dynamic structures use self-referencing when empty.
A macro like TEST_ASSERT_NOT_EQUAL_PTR enables simple empty/not-empty checks for such structures.
see linuxs list implementation as an example:
/**
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
static inline int list_empty(const struct list_head *head)
{
return READ_ONCE(head->next) == head;
}
Further negated macros for strings and memory would enable checking if some memory areas were touched.
laurencedv, dominickpastore, guenhter and magnushedin