}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewRelayout::CalculateXoffset: Wrong horizontal text alignment. Did you set a vertical one?\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewRelayout::CalculateXoffset: Wrong horizontal text alignment. Did you set a vertical one?\"", TEST_LOCATION );
assert1 = true;
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewRelayout::CalculateXoffset: Wrong vertical text alignment. Did you set an horizontal one?\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewRelayout::CalculateXoffset: Wrong vertical text alignment. Did you set an horizontal one?\"", TEST_LOCATION );
assert2 = true;
}
catch( ... )
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
assert1 = true;
}
try
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
assert2 = true;
}
try
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
assert3 = true;
}
try
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
assert4 = true;
}
try
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
assert5 = true;
}
try
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
assert6 = true;
}
}
catch( Dali::DaliException& e )
{
- tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
- DALI_TEST_EQUALS( e.mCondition, "!\"TextViewProcessor::MergeParagraph(). ERROR: A paragraph can't be merged to another paragraph which finishes with a new paragraph character.\"", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeParagraph(). ERROR: A paragraph can't be merged to another paragraph which finishes with a new paragraph character.\"", TEST_LOCATION );
assert1 = true;
}
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)
{
// 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)
{
// 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(!view);
}
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)
{
// 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)
{
// 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)
{
// 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(!view);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
tet_result(TET_FAIL);
}
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)
{
// 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(!view);
}
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)
{
// 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)
{
// 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;
// should assert
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e )
+ catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "child", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "child", TEST_LOCATION);
}
END_TEST;
}
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("1. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
}
try
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("2. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
}
try
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("3. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
}
try
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("4. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
}
// relatives...
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("5. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
}
try
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("6. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
}
try
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("7. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
}
try
tet_result(TET_FAIL);
}
- catch( Dali::DaliException &e)
+ catch( Dali::DaliException& e )
{
- tet_printf("8. Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "columnIndex < mRelativeWidths.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_EQUALS(e.mCondition, "false", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "false", TEST_LOCATION);
}
catch( ... )
{
}
catch( DaliException& e )
{
- tet_printf("Assertion %s failed at %s when an unitialized layer is added.\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS( e.mCondition, "layer", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "layer", TEST_LOCATION );
}
// Test: get a layer which was not added before.
}
catch( DaliException& e )
{
- tet_printf("Assertion %s failed at %s when trying to add background to the view and the view is not on the stage.\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS( e.mCondition, "mBackgroundLayer.OnStage()", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS( e.condition, "mBackgroundLayer.OnStage()", TEST_LOCATION );
assert = true;
}
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)
{
// 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( true );
}
END_TEST;
effect.GetAmplitude(9999);
tet_result(TET_FAIL);
}
- catch(DaliException& exception)
+ catch(DaliException& e)
{
- if (exception.mCondition == "index < mNumberOfWaves")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "index < mNumberOfWaves", TEST_LOCATION );
}
END_TEST;
}
effect.GetCenter(9999);
tet_result(TET_FAIL);
}
- catch(DaliException& exception)
+ catch(DaliException& e)
{
- if (exception.mCondition == "index < mNumberOfWaves")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "index < mNumberOfWaves", TEST_LOCATION );
}
END_TEST;
}
effect.GetPropagation(9999);
tet_result(TET_FAIL);
}
- catch(DaliException& exception)
+ catch(DaliException& e)
{
- if (exception.mCondition == "index < mNumberOfWaves")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "index < mNumberOfWaves", TEST_LOCATION );
}
END_TEST;
}
}
}
-/**
- * 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
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if (exception.mCondition == "alignment")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "alignment", TEST_LOCATION );
}
END_TEST;
}
{
Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::HorizontalLeft | Alignment::HorizontalCenter));
-
- try
- {
- alignment.SetAlignmentType(type);
- tet_result(TET_FAIL);
- }
- catch (DaliException& exception)
- {
- if (exception.mCondition == "!horizontalSet")
- {
- tet_result(TET_PASS);
- }
- }
+ alignment.SetAlignmentType(type);
+ // center will prevail in conflict
+ DALI_TEST_CHECK( Alignment::HorizontalCenter & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::HorizontalLeft & alignment.GetAlignmentType()) );
}
// Setting HorizontalCenter, HorizontalRight
Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::HorizontalCenter | Alignment::HorizontalRight));
- try
- {
- alignment.SetAlignmentType(type);
- tet_result(TET_FAIL);
- }
- catch (DaliException& exception)
- {
- if (exception.mCondition == "!horizontalSet")
- {
- tet_result(TET_PASS);
- }
- }
+ alignment.SetAlignmentType(type);
+ // center will prevail in conflict
+ DALI_TEST_CHECK( Alignment::HorizontalCenter & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::HorizontalRight & alignment.GetAlignmentType()) );
}
// Setting VerticalTop, VerticalCenter
{
Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::VerticalTop | Alignment::VerticalCenter));
-
- try
- {
- alignment.SetAlignmentType(type);
- tet_result(TET_FAIL);
- }
- catch (DaliException& exception)
- {
- if (exception.mCondition == "!verticalSet")
- {
- tet_result(TET_PASS);
- }
- }
+ alignment.SetAlignmentType(type);
+ // center will prevail in conflict
+ DALI_TEST_CHECK( Alignment::VerticalCenter & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::VerticalTop & alignment.GetAlignmentType()) );
}
// Setting VerticalCenter, VerticalBottom
{
Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::VerticalTop | Alignment::VerticalBottom));
-
- try
- {
- alignment.SetAlignmentType(type);
- tet_result(TET_FAIL);
- }
- catch (DaliException& exception)
- {
- if (exception.mCondition == "!veritcalSet")
- {
- tet_result(TET_PASS);
- }
- }
+ alignment.SetAlignmentType(type);
+ // top will prevail in conflict
+ DALI_TEST_CHECK( Alignment::VerticalTop & alignment.GetAlignmentType() );
+ DALI_TEST_CHECK( !(Alignment::VerticalBottom & alignment.GetAlignmentType()) );
}
END_TEST;
}
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
}
try
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
}
try
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", TEST_LOCATION );
}
try
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& exception)
+ catch (DaliException& e)
{
- if (exception.mCondition == "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )")
- {
- tet_result(TET_PASS);
- }
+ DALI_TEST_ASSERT(e, "( padding.left >= 0.f ) && ( padding.top >= 0.f ) && ( padding.right >= 0.f ) && ( padding.bottom >= 0.f )", 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, "density>0 && density<=9", 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, "density>0 && density<=9", 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)
{
// 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_EQUALS(e.mCondition, "initialAutoRepeatingDelay > 0.f", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "initialAutoRepeatingDelay > 0.f", TEST_LOCATION);
assert1 = true;
}
}
catch( Dali::DaliException& e )
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_EQUALS(e.mCondition, "nextAutoRepeatingDelay > 0.f", TEST_LOCATION);
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_EQUALS(e.condition, "nextAutoRepeatingDelay > 0.f", TEST_LOCATION);
assert2 = true;
}
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)
{
// 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)
{
// 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 )
{
- DALI_TEST_EQUALS( e.mCondition, "!\"TextView::CombineExceedPolicies() Invalid width and height exceed policies combination\"", TEST_LOCATION );
+ DALI_TEST_EQUALS( e.condition, "!\"TextView::CombineExceedPolicies() Invalid width and height exceed policies combination\"", TEST_LOCATION );
}
catch( ... )
{
void Alignment::SetAlignmentType( Toolkit::Alignment::Type type )
{
// Horizontal Alignment
- bool horizontalSet(false);
-
+ if( type & Toolkit::Alignment::HorizontalRight )
+ {
+ mHorizontal = Toolkit::Alignment::HorizontalRight;
+ }
if( type & Toolkit::Alignment::HorizontalLeft )
{
mHorizontal = Toolkit::Alignment::HorizontalLeft;
- horizontalSet = true;
}
if( type & Toolkit::Alignment::HorizontalCenter )
{
- DALI_ASSERT_ALWAYS(!horizontalSet);
mHorizontal = Toolkit::Alignment::HorizontalCenter;
- horizontalSet = true;
- }
- if( type & Toolkit::Alignment::HorizontalRight )
- {
- DALI_ASSERT_ALWAYS(!horizontalSet);
- mHorizontal = Toolkit::Alignment::HorizontalRight;
}
// Vertical Alignment
- bool verticalSet(false);
-
+ if( type & Toolkit::Alignment::VerticalBottom )
+ {
+ mVertical = Toolkit::Alignment::VerticalBottom;
+ }
if( type & Toolkit::Alignment::VerticalTop )
{
mVertical = Toolkit::Alignment::VerticalTop;
- verticalSet = true;
}
if( type & Toolkit::Alignment::VerticalCenter )
{
- DALI_ASSERT_ALWAYS(!verticalSet);
mVertical = Toolkit::Alignment::VerticalCenter;
- verticalSet = true;
- }
- if( type & Toolkit::Alignment::VerticalBottom )
- {
- DALI_ASSERT_ALWAYS(!verticalSet);
- mVertical = Toolkit::Alignment::VerticalBottom;
}
RelayoutRequest();
/**
* @brief Sets the new alignment. By default ( HorizontalCenter | VerticalCenter ).
+ * Note! there should only be one horizontal and one vertical policy
* @param [in] type The new alignment option.
*/
void SetAlignmentType( Type type );