Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test harnesses should mock unused functions #73

Open
sallaigy opened this issue Dec 17, 2020 · 0 comments
Open

Test harnesses should mock unused functions #73

sallaigy opened this issue Dec 17, 2020 · 0 comments
Labels
enhancement New feature or request Trace

Comments

@sallaigy
Copy link
Member

Consider the following code:

#include <assert.h>

int nondet1();
int nondet2();

int nevercalled() {
    return nondet2();
}

int main(void) {
    int x = nondet1();
    assert(x != 0);

    return 0;
}

The analysis produces a test harness which is incomplete and cannot be linked against the original program. This is due to the way the analysis works: as main is the entry point, nevercalled will never be executed and thus the nondeterministic call to nondet2 is not part of the counterexample, so it is not part of the trace. However, it should be part of the generated test harness, otherwise we will not be able to compile it and link it against the original program.

@sallaigy sallaigy added enhancement New feature or request Trace labels Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Trace
Projects
None yet
Development

No branches or pull requests

1 participant