add and Update mutex test that is no longer necessary now that glib has been fixed
This commit is contained in:
parent
a8647faca7
commit
020ca43ed0
24
libs/pbd/test/mutex_test.cc
Normal file
24
libs/pbd/test/mutex_test.cc
Normal file
@ -0,0 +1,24 @@
|
||||
#include "mutex_test.h"
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION (MutexTest);
|
||||
|
||||
using namespace std;
|
||||
|
||||
MutexTest::MutexTest ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
MutexTest::testBasic ()
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (m_mutex);
|
||||
|
||||
CPPUNIT_ASSERT (lm.locked());
|
||||
|
||||
/* This will fail on POSIX systems but not on some older versions of glib
|
||||
* on win32 as TryEnterCriticalSection is used and it will return true
|
||||
* as CriticalSection is reentrant and fail the assertion.
|
||||
*/
|
||||
CPPUNIT_ASSERT (!m_mutex.trylock());
|
||||
|
||||
}
|
17
libs/pbd/test/mutex_test.h
Normal file
17
libs/pbd/test/mutex_test.h
Normal file
@ -0,0 +1,17 @@
|
||||
#include <cppunit/TestFixture.h>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
#include "glibmm/threads.h"
|
||||
|
||||
class MutexTest : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE (MutexTest);
|
||||
CPPUNIT_TEST (testBasic);
|
||||
CPPUNIT_TEST_SUITE_END ();
|
||||
|
||||
public:
|
||||
MutexTest ();
|
||||
void testBasic ();
|
||||
|
||||
private:
|
||||
Glib::Threads::Mutex m_mutex;
|
||||
};
|
Loading…
Reference in New Issue
Block a user