| | |
| | | BOOST_CHECK(!p); |
| | | BOOST_CHECK(p.get() == 0); |
| | | const char *str = "basic"; |
| | | p = str; |
| | | p = str; |
| | | BOOST_CHECK(p); |
| | | BOOST_CHECK(p.get() == str); |
| | | p = 0; |
| | |
| | | auto Code = [&](int id) { |
| | | typedef ShmObject<s1000> Int; |
| | | std::string name = std::to_string(id); |
| | | auto a0 = Avail(); |
| | | auto a0 = Avail(); |
| | | Int i1(shm, name); |
| | | auto a1 = Avail(); |
| | | BOOST_CHECK_LT(a1, a0); |
| | |
| | | |
| | | { |
| | | auto old = Avail(); |
| | | void *p = shm.Alloc(1024); |
| | | void *p = shm.Alloc(1024); |
| | | shm.Dealloc(p); |
| | | BOOST_CHECK_EQUAL(old, Avail()); |
| | | } |
| | |
| | | // boost::timer::auto_cpu_timer timer; |
| | | ThreadManager threads; |
| | | int nthread = 1; |
| | | int nloop = 1; |
| | | int nloop = 1; |
| | | for (int i = 0; i < nthread; ++i) { |
| | | threads.Launch(BasicTest, i, nloop); |
| | | } |
| | |
| | | int ms = i * 100; |
| | | printf("Timeout Test %4d: ", ms); |
| | | boost::timer::auto_cpu_timer timer; |
| | | BHMsg msg; |
| | | MsgI msg; |
| | | bool r = q.Recv(msg, ms); |
| | | BOOST_CHECK(!r); |
| | | } |