You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
302 B
24 lines
302 B
14 years ago
|
#include <cxxtest/TestSuite.h>
|
||
|
|
||
|
#include "ScopedLock.hpp"
|
||
|
|
||
|
|
||
|
class TestScopedLock : public CxxTest::TestSuite
|
||
|
{
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
void testBasic( void )
|
||
|
{
|
||
|
Mutex m;
|
||
|
|
||
|
{
|
||
|
ScopedLock sl(m);
|
||
|
TS_ASSERT_EQUALS ( m.tryLock(0), false );
|
||
|
}
|
||
|
TS_ASSERT_EQUALS ( m.tryLock(0), true );
|
||
|
}
|
||
|
|
||
|
};
|