mirror of
https://github.com/Z3Prover/z3
synced 2025-05-08 08:15:47 +00:00
other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e9eab22e5c
commit
68269c43a6
250 changed files with 70871 additions and 0 deletions
47
test/symbol_table.cpp
Normal file
47
test/symbol_table.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
tst_symbol_table.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Test symbol table module.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2006-09-19.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"symbol_table.h"
|
||||
|
||||
static void tst1() {
|
||||
symbol_table<int> t;
|
||||
t.insert(symbol("foo"), 35);
|
||||
SASSERT(t.contains(symbol("foo")));
|
||||
SASSERT(!t.contains(symbol("boo")));
|
||||
t.begin_scope();
|
||||
t.insert(symbol("boo"), 20);
|
||||
SASSERT(t.contains(symbol("boo")));
|
||||
#ifdef Z3DEBUG
|
||||
int tmp;
|
||||
#endif
|
||||
SASSERT(t.find(symbol("boo"), tmp) && tmp == 20);
|
||||
SASSERT(t.find(symbol("foo"), tmp) && tmp == 35);
|
||||
t.insert(symbol("foo"), 100);
|
||||
SASSERT(t.find(symbol("foo"), tmp) && tmp == 100);
|
||||
t.end_scope();
|
||||
SASSERT(t.find(symbol("foo"), tmp) && tmp == 35);
|
||||
SASSERT(!t.contains(symbol("boo")));
|
||||
t.reset();
|
||||
SASSERT(!t.contains(symbol("boo")));
|
||||
SASSERT(!t.contains(symbol("foo")));
|
||||
}
|
||||
|
||||
void tst_symbol_table() {
|
||||
tst1();
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue