mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 16:38:45 +00:00
ensure that assertions within the unit tests are exercised in all build modes, remove special handling of SASSERT for release mode #1163
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
3f8b63f5a8
commit
b1298d7bde
67 changed files with 1277 additions and 1285 deletions
|
@ -27,8 +27,8 @@ static void tst1() {
|
|||
point * p1 = new (s) point(10, 20);
|
||||
point * p2 = new (s) point(30, 40);
|
||||
void * ptr = s.allocate(16000);
|
||||
SASSERT(p2->first == 30 && p2->second == 40);
|
||||
SASSERT(p1->first == 10 && p1->second == 20);
|
||||
ENSURE(p2->first == 30 && p2->second == 40);
|
||||
ENSURE(p1->first == 10 && p1->second == 20);
|
||||
s.deallocate(static_cast<int*>(ptr));
|
||||
s.deallocate(p2);
|
||||
s.deallocate(p1);
|
||||
|
@ -38,8 +38,8 @@ static void tst2(unsigned num, unsigned del_rate) {
|
|||
ptr_vector<char> ptrs;
|
||||
stack s;
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
SASSERT(ptrs.empty() == s.empty());
|
||||
SASSERT(s.empty() || ptrs.back() == s.top());
|
||||
ENSURE(ptrs.empty() == s.empty());
|
||||
ENSURE(s.empty() || ptrs.back() == s.top());
|
||||
if (!ptrs.empty() && rand() % del_rate == 0) {
|
||||
s.deallocate();
|
||||
ptrs.pop_back();
|
||||
|
@ -57,8 +57,8 @@ static void tst2(unsigned num, unsigned del_rate) {
|
|||
}
|
||||
}
|
||||
while (s.empty()) {
|
||||
SASSERT(ptrs.empty() == s.empty());
|
||||
SASSERT(s.empty() || ptrs.back() == s.top());
|
||||
ENSURE(ptrs.empty() == s.empty());
|
||||
ENSURE(s.empty() || ptrs.back() == s.top());
|
||||
s.deallocate();
|
||||
ptrs.pop_back();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue