try
{
resourceClient.SaveResource( aTicket, "model.dali-bin" ); // Should be outside range of valid resources!
- } catch (DaliException& e)
+ }
+ catch (DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
-
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mImpl->mTickets.find(ticket->GetId()) != mImpl->mTickets.end()", TEST_LOCATION );
}
try
{
resourceClient.SaveResource( aTicket, "model.dali-bin" ); // Should be outside range of valid resources!
- } catch (DaliException& e)
+ }
+ catch (DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
-
- DALI_TEST_EQUALS(e.mCondition, "ticket", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "ticket", TEST_LOCATION);
}
application.SendNotification(); // Flush update messages
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
assert1 = true;
}
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
assert2 = true;
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK( false );
}
catch (Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING(e, "encodedImage && \"Null image pointer passed-in for decoding from memory.\"", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "encodedImage && \"Null image pointer passed-in for decoding from memory.\"", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING(e, "encodedImageByteCount > 0U && \"Zero size passed for image resource in memory buffer.\"", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT(e, "encodedImageByteCount > 0U && \"Zero size passed for image resource in memory buffer.\"", TEST_LOCATION);
}
END_TEST;
}
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
catch( ... )
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "object", TEST_LOCATION);
}
END_TEST;
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "!vertices.empty()", TEST_LOCATION );
}
END_TEST;
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "!faceIndices.empty", TEST_LOCATION );
}
END_TEST;
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "material", TEST_LOCATION );
}
END_TEST;
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "entity.NumberOfMeshes() == 1", TEST_LOCATION);
DALI_TEST_CHECK( !actor );
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
}
END_TEST;
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
}
END_TEST;
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "knotIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "knotIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "knotIndex < mInTangents.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "knotIndex < mInTangents.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "knotIndex < mOutTangents.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "knotIndex < mOutTangents.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "numKnots > 1", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "numKnots > 1", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
}
END_TEST;
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End())", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End())", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End())", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION );
}
catch( ... )
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "VectorBase::mData", TEST_LOCATION );
}
catch(...)
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "VectorBase::mData", TEST_LOCATION );
}
catch(...)
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION );
}
catch(...)
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "(iterator < End()) && (iterator >= Begin())", TEST_LOCATION );
}
catch(...)
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < VectorBase::Count()", TEST_LOCATION );
}
catch(...)
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < VectorBase::Count()", TEST_LOCATION );
}
catch(...)
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( at <= End() ) && ( at >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( at <= End() ) && ( at >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( at <= End() ) && ( at >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( at <= End() ) && ( at >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( from <= to )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( first <= End() ) && ( first >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( first <= End() ) && ( first >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( last <= End() ) && ( last >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( last <= End() ) && ( last >= Begin() )", TEST_LOCATION );
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "( first <= last )", TEST_LOCATION );
}
catch( ... )
}
}
-/**
- * Test whether the assertion condition that failed and thus triggered the
- * exception \b e contained a given substring at the start of its literal text.
- * @param[in] e The exception that we expect was fired by a runtime assertion
- * failure.
- * @param[in] conditionSubString The text that we expect to be present in an
- * assertion which triggered the exception.
- * @param[in] location The TEST_LOCATION macro should be used here.
- *
- * @remark **Side-effects:** The result of the tet test is set to TET_PASS if
- * the substring is at the start of the exception's condition and
- * TET_FAIL if it isn't. Note, if the result of a test is set multiple
- * times, a TET_FAIL will override any number of TET_PASSes.
- */
void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location )
{
- if( 0u != e.mCondition.find( conditionSubString ))
+ if( NULL == strstr( e.condition, conditionSubString.c_str() ) )
{
- fprintf(stderr, "Assertion %s failed at %s\n", conditionSubString.c_str(), location);
+ fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location );
tet_result(TET_FAIL);
}
else
}
}
-/** Self-documenting wrapper for DALI_TEST_ASSERT.
- * @copydoc DALI_TEST_ASSERT()
- */
-void DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( DaliException& exceptionFromAssertion, std::string conditionSubString, const char* location )
-{
- DALI_TEST_ASSERT(exceptionFromAssertion, conditionSubString, location);
-}
-
// Functor to test whether an Applied signal is emitted
ConstraintAppliedCheck::ConstraintAppliedCheck( bool& signalReceived )
: mSignalReceived( signalReceived )
/**
* Test whether the assertion condition that failed and thus triggered the
- * exception \b e contained a given substring at the start of its literal text.
- * @param[in] e The exception that we expect was fired by a runtime assertion
- * failure.
+ * exception \b e contained a given substring.
+ * @param[in] e The exception that we expect was fired by a runtime assertion failure.
* @param[in] conditionSubString The text that we expect to be present in an
* assertion which triggered the exception.
* @param[in] location The TEST_LOCATION macro should be used here.
- *
- * @remark **Side-effects:** The result of the tet test is set to TET_PASS if
- * the substring is at the start of the exception's condition and
- * TET_FAIL if it isn't. Note, if the result of a test is set multiple
- * times, a TET_FAIL will override any number of TET_PASSes.
*/
void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location );
-/** Self-documenting wrapper for DALI_TEST_ASSERT.
- * @copydoc DALI_TEST_ASSERT()
+/**
+ * Print the assert
+ * @param[in] e The exception that we expect was fired by a runtime assertion failure.
*/
-void DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( DaliException& exceptionFromAssertion, std::string conditionSubString, const char* location );
-
+inline void DALI_TEST_PRINT_ASSERT( DaliException& e )
+{
+ tet_printf("Assertion %s failed at %s\n", e.condition, e.location );
+}
// Functor to test whether an Applied signal is emitted
struct ConstraintAppliedCheck
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "this != &child", TEST_LOCATION);
DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION );
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "!child.IsRoot()", TEST_LOCATION);
DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION );
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "actor", TEST_LOCATION);
DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION );
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "this != &child", TEST_LOCATION);
DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION );
}
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "actor", TEST_LOCATION);
DALI_TEST_EQUALS( parent.GetChildCount(), 1u, TEST_LOCATION );
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "numVertices > 0", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "faceIndices.size() > 0", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "faceIndex < numVertices", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "material", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < GetNumberOfVertices()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < GetNumberOfVertices()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < GetNumberOfVertices()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < GetNumberOfVertices()", TEST_LOCATION);
}
END_TEST;
}
catch ( DaliException& e )
{
- DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "( numVertices * 3 ) < DEFAULT_PROPERTY_MAX_COUNT", TEST_LOCATION );
+ DALI_TEST_ASSERT( e, "( numVertices * 3 ) < DEFAULT_PROPERTY_MAX_COUNT", TEST_LOCATION );
}
END_TEST;
}
}
catch (Dali::DaliException& e)
{
- // TODO: Determine why catch doesn't.
- //
-
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "durationSeconds > 0.0f", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "durationSeconds > 0.0f", TEST_LOCATION);
}
END_TEST;
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
}
END_TEST;
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
assert = true;
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
assert1 = true;
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
assert2 = true;
}
}
catch ( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "camera", TEST_LOCATION);
}
}
catch ( Dali::DaliException& e )
{
- tet_printf("Assertion %s test at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "camera", TEST_LOCATION);
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK(0);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK(0);
}
END_TEST;
detector.Attach(actor);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if ( exception.mCondition.find("detector") != std::string::npos )
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT( e, "detector", TEST_LOCATION );
}
END_TEST;
}
detector.Attach(actor);
tet_result(TET_PASS);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
END_TEST;
detector.Attach(actor);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if ( exception.mCondition.find("actor") != std::string::npos )
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT( e, "actor", TEST_LOCATION );
}
END_TEST;
}
detector.Detach(actor);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if ( exception.mCondition.find("actor") != std::string::npos )
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT( e, "actor", TEST_LOCATION );
}
END_TEST;
}
detector.Detach(actor2);
tet_result(TET_PASS);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
END_TEST;
detector.Detach(actor);
DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
END_TEST;
detector.DetachAll();
DALI_TEST_EQUALS(false, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
+ DALI_TEST_PRINT_ASSERT( e );
tet_result(TET_FAIL);
}
END_TEST;
catch (Dali::DaliException& e)
{
exception = true;
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
}
DALI_TEST_EQUALS(exception, true, TEST_LOCATION);
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "IsDefaultPropertyWritable(index) && \"Property is read-only\"", TEST_LOCATION);
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, exceptionString, TEST_LOCATION );
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < mPoint.Size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < mPoint.Size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < mControlPoint.Size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < mControlPoint.Size()", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "numSegments > 0", TEST_LOCATION);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "numSegments > 0", TEST_LOCATION);
}
END_TEST;
}
catch ( DaliException& e )
{
- DALI_TEST_ASSERT_CONDITION_STARTS_WITH_SUBSTRING( e, "false && \"Property notification added to non animatable property", TEST_LOCATION );
+ DALI_TEST_ASSERT( e, "false && \"Property notification added to event side only property", TEST_LOCATION );
}
END_TEST;
}
catch (Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK( !effect );
}
END_TEST;
}
catch(Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
tet_result( TET_FAIL );
}
END_TEST;
catch (Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK( !effect );
}
END_TEST;
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "NULL != mImpl && \"Text::operator[]: Text is uninitialized\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "NULL != mImpl && \"Text::operator[]: Text is uninitialized\"", TEST_LOCATION );
assert1 = true;
}
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "position < mString.Count() && \"Text::operator[]: Character position is out of bounds\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "position < mString.Count() && \"Text::operator[]: Character position is out of bounds\"", TEST_LOCATION );
assert2 = true;
}
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "position < mString.Count() && \"Text::Remove: Character position is out of bounds\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "position < mString.Count() && \"Text::Remove: Character position is out of bounds\"", TEST_LOCATION );
assert1 = true;
}
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "position + numberOfCharacters <= mString.Count() && \"Text::Remove: Character position + numberOfCharacters is out of bounds\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "position + numberOfCharacters <= mString.Count() && \"Text::Remove: Character position + numberOfCharacters is out of bounds\"", TEST_LOCATION );
assert2 = true;
}
}
catch( DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "NULL != mImpl && \"Text::Remove: Text is uninitialized\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "NULL != mImpl && \"Text::Remove: Text is uninitialized\"", TEST_LOCATION );
assert3 = true;
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < 2", TEST_LOCATION);
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < 2" , TEST_LOCATION);
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < 3", TEST_LOCATION );
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT(e, "index < 3", TEST_LOCATION);
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < 4", TEST_LOCATION );
}
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_ASSERT( e, "index < 4", TEST_LOCATION );
}
END_TEST;
return result;
}
-DALI_EXPORT_API DaliException::DaliException(const char *location, const char* condition)
-: mLocation(location), mCondition(condition)
+DALI_EXPORT_API DaliException::DaliException( const char* location, const char* condition )
+: location( location ), condition( condition )
{
// Note, if a memory error has occured, then the backtrace won't work - backtrace_symbols relies on
// allocating memory.
// Initial dlog error message is output in DALI_ASSERT_ALWAYS macro
// Also output on stderr
- fprintf(stderr, "Exception: \n%s\n thrown at %s\nSee dlog for backtrace\n", mCondition.c_str(), mLocation.c_str());
+#if defined(DEBUG_ENABLED)
+ fprintf(stderr, "Exception: \n%s\n thrown at %s\nSee dlog for backtrace\n", condition, location);
+#else
+ fprintf(stderr, "Exception: \n%s\n thrown\nSee dlog for backtrace\n", condition );
+#endif
DALI_LOG_ERROR_NOFN("Backtrace:\n");
#else // BACKTRACE_ENABLED
-
-DALI_EXPORT_API DaliException::DaliException(const char *location, const char* condition)
-: mLocation(location), mCondition(condition)
+DALI_EXPORT_API DaliException::DaliException( const char* location, const char* condition )
+: location( location ), condition( condition )
{
- printf("Exception: \n%s\n thrown at %s\nSee dlog for backtrace\n", mCondition.c_str(), mLocation.c_str());
+#if defined(DEBUG_ENABLED)
+ printf("Exception: \n%s\n thrown at %s\n", condition, location );
+#else
+ printf("Exception: \n%s\n thrown\n", condition );
+#endif
}
#endif // BACKTRACE_ENABLED
-
-DALI_EXPORT_API void DaliAssertMessage(const char* condition, const char* file, int line)
+DALI_EXPORT_API void DaliAssertMessage( const char* location, const char* condition )
{
- DALI_LOG_ERROR_NOFN( "Assertion (%s) failed in: %s:%d\n", condition, file, line );
+#if defined(DEBUG_ENABLED)
+ DALI_LOG_ERROR_NOFN( "Assert (%s) failed in: %s\n", condition, location );
+#else
+ DALI_LOG_ERROR_NOFN( "Assert (%s) failed\n", condition );
+#endif
}
} // Dali
*/
// EXTERNAL INCLUDES
-#include <string>
#include <cstdio>
#ifdef EMSCRIPTEN
/**
* @brief Method to log assertion message in DALI_ASSERT_ALWAYS macro below.
*
+ * @param[in] location Where the assertion occurred
* @param[in] condition The assertion condition
- * @param[in] file The file in which the assertion occurred
- * @param[in] line The line number at which the assertion occured
*/
-DALI_IMPORT_API void DaliAssertMessage(const char* condition, const char* file, int line);
+DALI_IMPORT_API void DaliAssertMessage( const char* location, const char* condition );
/**
* @brief Exception class for Dali Core library - Raised by assertions in codebase.
* @param[in] location - the location of the assertion
* @param[in] condition - The assertion condition
*/
- DaliException(const char *location, const char* condition);
+ DaliException( const char* location, const char* condition );
- std::string mLocation; ///< Location in code of the assertion
- std::string mCondition; ///< The assertion string
+ const char* location;
+ const char* condition;
};
}// Dali
* (which it is often equivalent to in effect).
* It should not be used for simple parameter validation for instance.
*/
+
+/**
+ * Strip assert location for release builds, assert text is descriptive enough
+ * This is to save space for low spec devices
+ */
+#if defined(DEBUG_ENABLED)
+#define ASSERT_LOCATION __PRETTY_FUNCTION__
+#else
+#define ASSERT_LOCATION NULL
+#endif
+
#ifdef EMSCRIPTEN
#define DALI_ASSERT_ALWAYS(cond) \
if(!(cond)) \
{ \
- Dali::DaliAssertMessage(#cond, __FILE__, __LINE__); \
- throw Dali::DaliException(__PRETTY_FUNCTION__, #cond); \
+ Dali::DaliAssertMessage( ASSERT_LOCATION, #cond ); \
+ throw Dali::DaliException( ASSERT_LOCATION, #cond ); \
EM_ASM(print(new Error().stack)); \
- }\
-
+ }
#else
#define DALI_ASSERT_ALWAYS(cond) \
if(!(cond)) \
{ \
- Dali::DaliAssertMessage(#cond, __FILE__, __LINE__); \
- throw Dali::DaliException(__PRETTY_FUNCTION__, #cond); \
- }\
-
+ Dali::DaliAssertMessage( ASSERT_LOCATION, #cond ); \
+ throw Dali::DaliException( ASSERT_LOCATION, #cond ); \
+ }
#endif
/**