/[svn]/linuxsampler/trunk/src/testcases/MutexTest.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/testcases/MutexTest.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 62 by schoenebeck, Sun May 2 17:45:43 2004 UTC revision 63 by schoenebeck, Tue May 4 18:52:24 2004 UTC
# Line 20  class MutexTest : public CppUnit::TestFi Line 20  class MutexTest : public CppUnit::TestFi
20      CPPUNIT_TEST(testLock);      CPPUNIT_TEST(testLock);
21      CPPUNIT_TEST(testUnlock);      CPPUNIT_TEST(testUnlock);
22      CPPUNIT_TEST(testDoubleLock);      CPPUNIT_TEST(testDoubleLock);
23        CPPUNIT_TEST(testDoubleLockStillBlocksConcurrentThread);
24      CPPUNIT_TEST_SUITE_END();      CPPUNIT_TEST_SUITE_END();
25    
26      private:      private:
27            // dummy thread to simulate usage of a shared resource
28          class ConcurrentThread : public Thread {          class ConcurrentThread : public Thread {
29              public:              public:
30                  int resource;                  int resource;
# Line 31  class MutexTest : public CppUnit::TestFi Line 33  class MutexTest : public CppUnit::TestFi
33                  ConcurrentThread();                  ConcurrentThread();
34                  int Main();                  int Main();
35          };          };
36    
37            // dummy thread we use to check if the Mutex falsely blcoks if we do a double lock and to avoid that our unit test main thread gets blocked
38            class DummyThread : public Thread {
39                public:
40                    int resource;
41    
42                    DummyThread();
43                    int Main();
44                private:
45                    Mutex mutex;
46            };
47    
48            bool doubleLockSucceeded; // true if testDoubleLock() was successful
49      public:      public:
50          void setUp();          void setUp();
51          void tearDown();          void tearDown();
# Line 39  class MutexTest : public CppUnit::TestFi Line 54  class MutexTest : public CppUnit::TestFi
54          void testLock();          void testLock();
55          void testUnlock();          void testUnlock();
56          void testDoubleLock();          void testDoubleLock();
57            void testDoubleLockStillBlocksConcurrentThread();
58  };  };
59    
60  #endif // __LS_MUTEXTEST_H__  #endif // __LS_MUTEXTEST_H__

Legend:
Removed from v.62  
changed lines
  Added in v.63

  ViewVC Help
Powered by ViewVC