|
|
|
@@ -110,14 +110,14 @@ void Test::testCondition() {
|
|
|
|
|
osl::Mutex mutex;
|
|
|
|
|
std::unique_ptr< salhelper::Condition > p(new DerivedCondition(mutex));
|
|
|
|
|
CPPUNIT_ASSERT(typeid (*p.get()) != typeid (salhelper::Condition));
|
|
|
|
|
CPPUNIT_ASSERT(typeid (p.get()) == typeid (salhelper::Condition *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (p.get()) == typeid (salhelper::Condition *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::Condition const * >(p.get()))
|
|
|
|
|
== typeid (salhelper::Condition const *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::Condition const *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::Condition volatile * >(p.get()))
|
|
|
|
|
== typeid (salhelper::Condition volatile *));
|
|
|
|
|
CPPUNIT_ASSERT(typeid (salhelper::Condition *) == getConditionTypeInfo());
|
|
|
|
|
== typeid (salhelper::Condition volatile *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (salhelper::Condition *) == getConditionTypeInfo()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
@@ -129,45 +129,45 @@ void Test::testCondition() {
|
|
|
|
|
|
|
|
|
|
void Test::testConditionModifier() {
|
|
|
|
|
salhelper::ConditionModifier * p = nullptr;
|
|
|
|
|
CPPUNIT_ASSERT(typeid (*p) == typeid (salhelper::ConditionModifier));
|
|
|
|
|
CPPUNIT_ASSERT(typeid (p) == typeid (salhelper::ConditionModifier *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (*p) == typeid (salhelper::ConditionModifier)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (p) == typeid (salhelper::ConditionModifier *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ConditionModifier const * >(p))
|
|
|
|
|
== typeid (salhelper::ConditionModifier const *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::ConditionModifier const *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ConditionModifier volatile * >(p))
|
|
|
|
|
== typeid (salhelper::ConditionModifier volatile *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::ConditionModifier volatile *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (salhelper::ConditionModifier *)
|
|
|
|
|
== getConditionModifierTypeInfo());
|
|
|
|
|
== getConditionModifierTypeInfo()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Test::testConditionWaiter() {
|
|
|
|
|
salhelper::ConditionWaiter * p = nullptr;
|
|
|
|
|
CPPUNIT_ASSERT(typeid (*p) == typeid (salhelper::ConditionWaiter));
|
|
|
|
|
CPPUNIT_ASSERT(typeid (p) == typeid (salhelper::ConditionWaiter *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (*p) == typeid (salhelper::ConditionWaiter)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (p) == typeid (salhelper::ConditionWaiter *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ConditionWaiter const * >(p))
|
|
|
|
|
== typeid (salhelper::ConditionWaiter const *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::ConditionWaiter const *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ConditionWaiter volatile * >(p))
|
|
|
|
|
== typeid (salhelper::ConditionWaiter volatile *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
typeid (salhelper::ConditionWaiter *) == getConditionWaiterTypeInfo());
|
|
|
|
|
== typeid (salhelper::ConditionWaiter volatile *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (salhelper::ConditionWaiter *) == getConditionWaiterTypeInfo()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Test::testConditionWaiterTimedout() {
|
|
|
|
|
salhelper::ConditionWaiter::timedout x;
|
|
|
|
|
CPPUNIT_ASSERT(typeid (x) == typeid (salhelper::ConditionWaiter::timedout));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
typeid (&x) == typeid (salhelper::ConditionWaiter::timedout *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (x) == typeid (salhelper::ConditionWaiter::timedout)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (&x) == typeid (salhelper::ConditionWaiter::timedout *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ConditionWaiter::timedout const * >(&x))
|
|
|
|
|
== typeid (salhelper::ConditionWaiter::timedout const *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::ConditionWaiter::timedout const *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
(typeid
|
|
|
|
|
(const_cast< salhelper::ConditionWaiter::timedout volatile * >(&x)))
|
|
|
|
|
== typeid (salhelper::ConditionWaiter::timedout volatile *));
|
|
|
|
|
== typeid (salhelper::ConditionWaiter::timedout volatile *)));
|
|
|
|
|
try {
|
|
|
|
|
throw salhelper::ConditionWaiter::timedout();
|
|
|
|
|
} catch (salhelper::ConditionWaiter::timedout &) {
|
|
|
|
@@ -179,16 +179,16 @@ void Test::testConditionWaiterTimedout() {
|
|
|
|
|
void Test::testORealDynamicLoader() {
|
|
|
|
|
salhelper::ORealDynamicLoader * p = nullptr;
|
|
|
|
|
CPPUNIT_ASSERT(typeid (p) != typeid (salhelper::ORealDynamicLoader));
|
|
|
|
|
CPPUNIT_ASSERT(typeid (p) == typeid (salhelper::ORealDynamicLoader *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
CPPUNIT_ASSERT(bool(typeid (p) == typeid (salhelper::ORealDynamicLoader *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ORealDynamicLoader const * >(p))
|
|
|
|
|
== typeid (salhelper::ORealDynamicLoader const *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::ORealDynamicLoader const *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::ORealDynamicLoader volatile * >(p))
|
|
|
|
|
== typeid (salhelper::ORealDynamicLoader volatile *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::ORealDynamicLoader volatile *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (salhelper::ORealDynamicLoader *)
|
|
|
|
|
== getORealDynamicLoaderTypeInfo());
|
|
|
|
|
== getORealDynamicLoaderTypeInfo()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
@@ -200,18 +200,18 @@ void Test::testSimpleReferenceObject() {
|
|
|
|
|
try {
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
typeid (*p) != typeid (salhelper::SimpleReferenceObject));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
typeid (p) == typeid (salhelper::SimpleReferenceObject *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (p) == typeid (salhelper::SimpleReferenceObject *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (const_cast< salhelper::SimpleReferenceObject const * >(p))
|
|
|
|
|
== typeid (salhelper::SimpleReferenceObject const *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::SimpleReferenceObject const *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
(typeid
|
|
|
|
|
(const_cast< salhelper::SimpleReferenceObject volatile * >(p)))
|
|
|
|
|
== typeid (salhelper::SimpleReferenceObject volatile *));
|
|
|
|
|
CPPUNIT_ASSERT(
|
|
|
|
|
== typeid (salhelper::SimpleReferenceObject volatile *)));
|
|
|
|
|
CPPUNIT_ASSERT(bool(
|
|
|
|
|
typeid (salhelper::SimpleReferenceObject *)
|
|
|
|
|
== getSimpleReferenceObjectTypeInfo());
|
|
|
|
|
== getSimpleReferenceObjectTypeInfo()));
|
|
|
|
|
} catch (...) {
|
|
|
|
|
delete static_cast< DerivedSimpleReferenceObject * >(p);
|
|
|
|
|
throw;
|
|
|
|
|