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

add check-api in the CI #485

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ runs:
# This is needed for yices2 to find libpoly.so.0. /usr/local/lib not searched by default?
export LD_LIBRARY_PATH=/usr/local/lib/:${LD_LIBRARY_PATH}
make MODE=${{ inputs.mode }} check
make MODE=${{ inputs.mode }} check-api
36 changes: 26 additions & 10 deletions tests/api/test_model_hint.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,14 @@ static void check_with_sat_model(bool use_hint) {
smt_status_t status;
if (use_hint) {
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 0);
assert(status == STATUS_SAT);
} else {
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 1);
assert(status == STATUS_SAT);
}

if (status != STATUS_SAT) {
assert(false);
}

yices_free_model(model);
yices_free_context(ctx);
}
Expand All @@ -149,10 +152,14 @@ static void check_with_unsat_model(bool use_hint) {
smt_status_t status;
if (use_hint) {
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 0);
assert(status == STATUS_SAT);
if (status != STATUS_SAT) {
assert(false);
}
} else {
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 1);
assert(status == STATUS_UNSAT);
if (status != STATUS_UNSAT) {
assert(false);
}
}
yices_free_model(model);
yices_free_context(ctx);
Expand All @@ -171,7 +178,10 @@ static void check_sat_with_empty_model(void) {

smt_status_t status;
status = check_with_model_and_hint(ctx, model, assertion, 0, vars, 0);
assert(status == STATUS_SAT);
if (status != STATUS_SAT) {
assert(false);
}

yices_free_model(model);
yices_free_context(ctx);
}
Expand All @@ -189,7 +199,9 @@ static void check_unsat_with_empty_model(void) {

smt_status_t status;
status = check_with_model_and_hint(ctx, model, assertion, 0, vars, 0);
assert(status == STATUS_UNSAT);
if (status != STATUS_UNSAT) {
assert(false);
}

yices_free_model(model);
yices_free_context(ctx);
Expand All @@ -215,17 +227,19 @@ static void check_unsat_with_model(bool use_hint) {
smt_status_t status;
if (use_hint) {
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 0);
assert(status == STATUS_UNSAT);
} else {
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 1);
assert(status == STATUS_UNSAT);
}

if (status != STATUS_UNSAT) {
assert(false);
}

yices_free_model(model);
yices_free_context(ctx);
}

void check_simple() {
void check_simple(void) {
context_t *ctx;
model_t *model;
term_t vars[2];
Expand All @@ -244,7 +258,9 @@ void check_simple() {

smt_status_t status;
status = check_with_model_and_hint(ctx, model, assertion, 1, vars, 0);
assert(status == STATUS_SAT);
if (status != STATUS_SAT) {
assert(false);
}

yices_free_model(model);
yices_free_context(ctx);
Expand Down