aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/shmat_ut.cpp
blob: 45921aaa88b55cbe1cb67965e3a70f3d1dc5c682 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "shmat.h"

#include <library/cpp/testing/unittest/registar.h>

Y_UNIT_TEST_SUITE(TTestSharedMemory) { 
    Y_UNIT_TEST(TestInProc) { 
        TSharedMemory m1;
        TSharedMemory m2;

        UNIT_ASSERT(m1.Create(128));
        UNIT_ASSERT(m2.Open(m1.GetId(), m1.GetSize()));

        *(ui32*)m1.GetPtr() = 123;

        UNIT_ASSERT_VALUES_EQUAL(*(ui32*)m2.GetPtr(), 123);
    }
}