lichao
2021-03-31 6eefba812ede29549af3633c490f2e85a4805524
utest/simple_tests.cpp
@@ -18,8 +18,9 @@
#include "util.h"
struct s1000 { char a[1000]; };
struct s1000 {
   char a[1000];
};
BOOST_AUTO_TEST_CASE(BasicTest)
{
@@ -42,12 +43,10 @@
    BOOST_CHECK(!p);
    BOOST_CHECK(p.get() == 0);
    auto init_avail = Avail();
    auto BasicTest = [&](int tid, int nloop) {
        auto Code = [&](int id) {
            typedef ShmObject<s1000> Int;
            std::string name = std::to_string(id);
            auto a0 = Avail();
@@ -82,8 +81,7 @@
    ThreadManager threads;
    int nthread = 1;
    int nloop = 1;
    for (int i = 0; i < nthread; ++i)
    {
   for (int i = 0; i < nthread; ++i) {
        threads.Launch(BasicTest, i, nloop);
    }
    BOOST_CHECK_EQUAL(init_avail, Avail());
@@ -140,4 +138,3 @@
    BOOST_CHECK_EQUAL(m1.Release(shm), 0);
    BOOST_CHECK(!m1.IsCounted());
}