3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-03 22:05:45 +00:00

other components

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-02 11:48:48 -07:00
parent e9eab22e5c
commit 68269c43a6
250 changed files with 70871 additions and 0 deletions

48
test/buffer.cpp Normal file
View file

@ -0,0 +1,48 @@
/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
buffer.cpp
Abstract:
Test buffers.
Author:
Leonardo de Moura (leonardo) 2011-03-03.
Revision History:
--*/
#include"ptr_scoped_buffer.h"
typedef std::pair<int, int> point;
template class ptr_scoped_buffer<point>;
static void tst1() {
ptr_scoped_buffer<point> b;
SASSERT(b.empty());
b.push_back(alloc(point, 10, 20));
SASSERT(!b.empty());
point * p1 = alloc(point, 30, 20);
b.push_back(p1);
SASSERT(b.get(1) == p1);
b.push_back(alloc(point, 40, 20));
SASSERT(b.size() == 3);
b.pop_back();
SASSERT(b.get(0) != p1);
SASSERT(b.get(1) == p1);
point * p2 = alloc(point, 30, 20);
SASSERT(b.get(0) != p2);
b.set(0, p2);
SASSERT(b.get(0) == p2);
SASSERT(b.size() == 2);
b.push_back(alloc(point, 40, 40));
}
void tst_buffer() {
tst1();
}