supernova: jack backend - improve xrun handling
[supercollider.git] / testsuite / supernova / static_pool_test.cpp
blob5b5c07198eb4aa2ce2638664e41dd6c4b8891e33
1 #include <boost/test/unit_test.hpp>
3 #include <string>
5 #include "utilities/static_pool.hpp"
7 using namespace nova;
8 using namespace std;
10 namespace
13 struct foo
15 foo(void)
17 int data[4];
22 BOOST_AUTO_TEST_CASE( static_pool_test )
24 static_pool<16*1024> pool;
26 foo* f1 = static_cast<foo*>(pool.malloc(sizeof(f1)));
27 ::new(f1) foo();
28 f1->~foo();
29 pool.free(f1);
32 BOOST_AUTO_TEST_CASE( static_pool_test_locked )
34 static_pool<16*1024> pool(true);
36 foo* f1 = static_cast<foo*>(pool.malloc(sizeof(f1)));
37 ::new(f1) foo();
38 f1->~foo();
39 pool.free(f1);