summaryrefslogtreecommitdiff
path: root/libs/pbd/test/mutex_test.cc
blob: 52c36c469559def92c3a4345f3f65438ab5920c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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());

}