Skip to content

support for catching assertion assert() #809

@nicola-lunghi

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));
}

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