Merge "Make do not caching pixelBuffer in texture-manager." into devel/master
authorDavid Steele <david.steele@samsung.com>
Wed, 25 Nov 2020 10:10:12 +0000 (10:10 +0000)
committerGerrit Code Review <gerrit@review>
Wed, 25 Nov 2020 10:10:12 +0000 (10:10 +0000)
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder-impl.h

index 2c1c703..b8de978 100644 (file)
@@ -378,6 +378,34 @@ inline void DALI_TEST_PRINT_ASSERT(DaliException& e)
     DALI_TEST_ASSERT(e, assertstring, TEST_LOCATION);                                                       \
   }
 
+/**
+ * Test that given piece of code triggers an exception
+ * Fails the test if the exception didn't occur.
+ * Turns off logging during the execution of the code to avoid excessive false positive log output from the assertions
+ * @param expressions code to execute
+ * @param except the exception expected in the assert
+ */
+#define DALI_TEST_THROWS(expressions, except)                                                               \
+  try                                                                                                       \
+  {                                                                                                         \
+    TestApplication::EnableLogging(false);                                                                  \
+    expressions;                                                                                            \
+    TestApplication::EnableLogging(true);                                                                   \
+    fprintf(stderr, "Test failed in %s, expected exception: '%s' didn't occur\n", __FILELINE__, #except);   \
+    tet_result(TET_FAIL);                                                                                   \
+    throw("TET_FAIL");                                                                                      \
+  }                                                                                                         \
+  catch(except &)                                                                                           \
+  {                                                                                                         \
+    tet_result(TET_PASS);                                                                                   \
+  }                                                                                                         \
+  catch(...)                                                                                                \
+  {                                                                                                         \
+    fprintf(stderr, "Test failed in %s, unexpected exception\n", __FILELINE__);                             \
+    tet_result(TET_FAIL);                                                                                   \
+    throw;                                                                                                  \
+  }
+
 // Functor to test whether an Applied signal is emitted
 struct ConstraintAppliedCheck
 {
index 203ac73..86b3bd9 100644 (file)
@@ -67,6 +67,8 @@ public:
 
   Integration::StencilBufferAvailable GetStencilBufferRequired() override { return Integration::StencilBufferAvailable::FALSE; };
 
+  int GetOrientation() const override {return 0;};
+
   void SetBackgroundColor( Vector4 color ) {};
 
   Vector4 GetBackgroundColor() { return Color::WHITE; };