Skip to content

support for catching assertion assert() #809

Description

@nicola-lunghi

I have this code

int my_module_init(my_module_t *mymodule) {
    assert(mymodule != NULL);
    return 0;
}

how can I create a test that verify that the assertion is triggered?

void test_not_null() {

    UNITY_THROW_ASSERTION(myfunc(0));
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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