Skip to content

Missing TEST_ASSERT_NOT_EQUAL_{PTR,STRING,MEMORY} macros #491

@nopeslide

Description

@nopeslide

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions