1 #include <boost/test/unit_test.hpp>
3 #include "server/server.hpp"
4 #include "server/server_args.hpp"
6 #include "test_synth.hpp"
14 struct test_synth_prototype
:
15 public synth_prototype
17 test_synth_prototype(void):
18 synth_prototype(c_string("foo"))
21 abstract_synth
* create_instance(int node_id
)
23 return new test_synth(node_id
, this);
29 BOOST_AUTO_TEST_CASE( server_test_1
)
31 rt_pool
.init(1024 * 1024);
34 nova_server
server(server_arguments::initialize(0, 0));
35 rt_pool
.init(1024*1024);
37 server
.synth_factory::register_prototype(new test_synth_prototype());
39 node_position_constraint to_root
= std::make_pair(server
.root_group(), insert
);
41 abstract_synth
* s
= server
.add_synth("foo", 1, to_root
);
48 BOOST_AUTO_TEST_CASE( server_test_2
)
51 nova_server
server(server_arguments::initialize(0, 0));
52 server
.synth_factory::register_prototype(new test_synth_prototype());
54 node_position_constraint to_root
= std::make_pair(server
.root_group(), insert
);
56 abstract_synth
* s
= server
.add_synth("foo", 1, to_root
);
66 BOOST_AUTO_TEST_CASE( server_test_3
)
69 nova_server
server(server_arguments::initialize(0, 0));
70 server
.synth_factory::register_prototype(new test_synth_prototype());
72 parallel_group
* g
= new parallel_group(1);
76 node_position_constraint to_group
= std::make_pair(g
, insert
);
78 abstract_synth
* s1
= server
.add_synth("foo", 2, to_group
);
79 abstract_synth
* s2
= server
.add_synth("foo", 3, to_group
);
80 abstract_synth
* s3
= server
.add_synth("foo", 4, to_group
);