Syncing Test harness updates for Native Image 98/254498/1
authorDavid Steele <david.steele@samsung.com>
Wed, 3 Mar 2021 17:21:23 +0000 (17:21 +0000)
committerDavid Steele <david.steele@samsung.com>
Wed, 3 Mar 2021 17:21:23 +0000 (17:21 +0000)
Change-Id: I7103c24f187f1b18fc37ad2f3595446d9ef53134

automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h

index eac9db5..f2086d6 100644 (file)
  */
 
 #include "test-gl-abstraction.h"
+#include "test-trace-call-stack.h"
 
 namespace Dali
 {
 TestGlAbstraction::TestGlAbstraction()
-: mBufferTrace(true, "gl"),
-  mTextureTrace(true, "gl"),
+: mBufferTrace(true, std::string("gl")),
+  mCullFaceTrace(true, "gl"),
+  mEnableDisableTrace(true, "gl"),
+  mShaderTrace(true, "gl"),
+  mTextureTrace(true, std::string("gl")),
   mTexParameterTrace(true, "gl"),
-  mDrawTrace(true, "gl")
+  mDrawTrace(true, "gl"),
+  mDepthFunctionTrace(true, "gl"),
+  mStencilFunctionTrace(true, "gl"),
+  mScissorTrace(true, "gl"),
+  mSetUniformTrace(true, "Uniform "),
+  mViewportTrace(true, "gl")
 {
   Initialize();
 }
index 7aacf76..18fbbf1 100644 (file)
@@ -157,10 +157,10 @@ public:
     }
 
     std::stringstream out;
-    out << target << ", " << texture;
+    out << std::hex << target << ", " << std::dec << texture;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] << target;
+    namedParams["target"] << std::hex << target;
     namedParams["texture"] << texture;
 
     mTextureTrace.PushCall("BindTexture", out.str(), namedParams);
@@ -831,6 +831,9 @@ public:
       case GL_ACTIVE_UNIFORM_MAX_LENGTH:
         *params = 100;
         break;
+      case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
+        *params = 100;
+        break;
     }
   }
 
@@ -1580,7 +1583,12 @@ public:
 
   inline GLboolean UnmapBuffer(GLenum target) override
   {
-    return false;
+    if(mMappedBuffer)
+    {
+      free(mMappedBuffer);
+      mMappedBuffer = nullptr;
+    }
+    return true; // false indicates corruption, nothing else.
   }
 
   inline void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params) override
@@ -1629,7 +1637,8 @@ public:
 
   inline GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) override
   {
-    return NULL;
+    mMappedBuffer = reinterpret_cast<GLvoid*>(malloc(offset + length));
+    return mMappedBuffer;
   }
 
   inline void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) override
@@ -2425,6 +2434,7 @@ private:
   GLuint                                mCompileStatus;
   BufferDataCalls                       mBufferDataCalls;
   BufferSubDataCalls                    mBufferSubDataCalls;
+  GLvoid*                               mMappedBuffer{nullptr};
   GLuint                                mLinkStatus;
   GLint                                 mNumberOfActiveUniforms;
   GLenum                                mGetErrorResult;
index 6a01143..73be9ee 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_SYNC_ABSTRACTION_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -112,8 +112,8 @@ private:
 
   typedef std::vector<TestSyncObject*> SyncContainer;
   typedef SyncContainer::iterator      SyncIter;
-  SyncContainer                        mSyncObjects; ///< The sync objects
-  TraceCallStack                       mTrace;       ///< the trace call stack for testing
+  SyncContainer                        mSyncObjects;       ///< The sync objects
+  TraceCallStack                       mTrace{true, "gl"}; ///< the trace call stack for testing
 };
 
 } // namespace Dali
index 9d78225..4dc1eab 100644 (file)
@@ -32,7 +32,8 @@ TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
   mExtensionCreateCalls(0),
   mExtensionDestroyCalls(0),
   mTargetTextureCalls(0),
-  createResult(true)
+  createResult(true),
+  mCallStack(true, "NativeImage::")
 {
   mCallStack.EnableLogging(true);
 }
index 7a4f552..d134942 100644 (file)
@@ -116,7 +116,7 @@ public:
   int32_t                mTargetTextureCalls;
   uint32_t               mTargetTextureError{0u};
   bool                   createResult;
-  mutable TraceCallStack mCallStack{"NativeImage:"};
+  mutable TraceCallStack mCallStack;
 };
 
 } // namespace Dali
index 41ad1e5..290f663 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,7 @@
 namespace Dali
 {
 TestPlatformAbstraction::TestPlatformAbstraction()
-: mTrace(),
-  mIsLoadingResult(false),
+: mIsLoadingResult(false),
   mClosestSize(),
   mLoadFileResult(),
   mSaveFileResult(false),
index 9be034b..3146e2d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_PLATFORM_ABSTRACTION_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -195,7 +195,7 @@ private:
     Dali::Vector<unsigned char> buffer;
   };
 
-  mutable TraceCallStack mTrace;
+  mutable TraceCallStack mTrace{true, "PlatformAbstraction::"};
   bool                   mIsLoadingResult;
   ImageDimensions        mClosestSize;
 
index 9e4efe8..1a0ab3a 100644 (file)
@@ -46,13 +46,6 @@ std::string ToString(float x)
 /**
  * Constructor
  */
-TraceCallStack::TraceCallStack(std::string prefix)
-: mTraceActive(false),
-  mLogging(false),
-  mPrefix(prefix)
-{
-}
-
 TraceCallStack::TraceCallStack(bool logging, std::string prefix)
 : mTraceActive(false),
   mLogging(logging),
index 6b78c86..b7d9e46 100644 (file)
@@ -136,8 +136,10 @@ public:
   /**
    * Constructor
    */
-  TraceCallStack(std::string prefix = "gl");
-  TraceCallStack(bool logging, std::string prefix = "gl");
+  TraceCallStack(bool logging, std::string prefix);
+
+  TraceCallStack(const TraceCallStack&) = delete;
+  TraceCallStack(TraceCallStack&&)      = delete;
 
   /**
    * Destructor