17 #ifndef PAGESPEED_KERNEL_SHAREDMEM_SHARED_MEM_TEST_BASE_H_
18 #define PAGESPEED_KERNEL_SHAREDMEM_SHARED_MEM_TEST_BASE_H_
28 namespace net_instaweb {
67 bool CreateChild(TestMethod method);
92 static const int kLarge = 0x1000 - 4;
93 static const int kNumIncrements = 0xFFFFF;
97 return reinterpret_cast<volatile int*
>(&seg->
Base()[offset]);
102 void DestroyDefault();
105 void WriteSeg1Child();
108 void WriteSeg2Child();
110 void TestReadWriteChild();
111 void TestLargeChild();
112 void TwoKidsChild1();
113 void TwoKidsChild2();
129 template<
typename ConcreteTestEnv>
142 TYPED_TEST_P(SharedMemTestTemplate, TestRewriteReattach) {
146 TYPED_TEST_P(SharedMemTestTemplate, TestLarge) {
150 TYPED_TEST_P(SharedMemTestTemplate, TestDistinct) {
154 TYPED_TEST_P(SharedMemTestTemplate, TestDestroy) {
158 TYPED_TEST_P(SharedMemTestTemplate, TestCreateTwice) {
162 TYPED_TEST_P(SharedMemTestTemplate, TestTwoKids) {
166 TYPED_TEST_P(SharedMemTestTemplate, TestMutex) {
170 REGISTER_TYPED_TEST_CASE_P(SharedMemTestTemplate, TestRewrite,
171 TestRewriteReattach, TestLarge, TestDistinct,
172 TestDestroy, TestCreateTwice, TestTwoKids,
void TestMutex()
Test for mutex operation.
void TestDistinct()
Make sure that 2 segments don't interfere.
Definition: mock_message_handler.h:39
void TestLarge()
Test with large data; also test initialization.
virtual volatile char * Base()=0
Definition: shared_mem_test_base.h:61
Definition: scoped_ptr.h:30
Definition: function.h:47
virtual void WaitForChildren()=0
Definition: abstract_shared_mem.h:86
void TestTwoKids()
Make sure between two kids see the SHM as well.
virtual void ShortSleep()=0
Runtime-specific short sleep.
Definition: shared_mem_test_base.h:33
virtual void ChildFailed()=0
Called in a child to denote it exiting with failure.
Definition: abstract_shared_mem.h:31
Definition: shared_mem_test_base.h:130
void TestReadWrite(bool reattach)
Basic read/write operation test.
void TestDestroy()
Make sure destruction destroys things properly...
virtual bool CreateChild(Function *callback)=0