6 // Mock implementation: return UNDEF for the 5th invocation, otherwise it just
7 // returns the result of the real invocation.
8 Z3_lbool Z3_API
Z3_solver_check(Z3_context c
, Z3_solver s
) {
9 static Z3_lbool (*OriginalFN
)(Z3_context
, Z3_solver
);
11 OriginalFN
= (Z3_lbool(*)(Z3_context
, Z3_solver
))dlsym(RTLD_NEXT
,
15 // Invoke the actual solver.
16 Z3_lbool Result
= OriginalFN(c
, s
);
18 // Mock the 5th invocation to return UNDEF.
19 static unsigned int Counter
= 0;
21 fprintf(stderr
, "Z3_solver_check returns a mocked value: UNDEF\n");
24 fprintf(stderr
, "Z3_solver_check returns the real value: %s\n",
25 (Result
== Z3_L_UNDEF
? "UNDEF"
26 : ((Result
== Z3_L_TRUE
? "TRUE" : "FALSE"))));