unittest: change set_active test protocol 63/196263/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 27 Dec 2018 01:20:41 +0000 (10:20 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 27 Dec 2018 01:20:48 +0000 (10:20 +0900)
send width, height, format info

Change-Id: I98cc2a79b9891481b3b85a36676ee54eb3724dda
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
protocol/wayland-tbm-test.xml
unittests/src/ut_base.cpp
unittests/src/ut_wayland_tbm.cpp

index 9def0fd..f573cf5 100644 (file)
@@ -41,6 +41,9 @@
       <arg name="usage" type="uint"/>
       <arg name="queue_size" type="uint"/>
       <arg name="need_flush" type="uint"/>
+      <arg name="width" type="uint"/>
+      <arg name="height" type="uint"/>
+      <arg name="format" type="uint"/>
     </request>
     <request name="queue_flush">
       <arg name="surface" type="object" interface="wl_surface"/>
index 319d086..d2d6f4d 100644 (file)
@@ -245,7 +245,10 @@ _wl_tbm_test_set_active(struct wl_client *client, struct wl_resource *resource,
                                        uint32_t active,
                                        uint32_t usage,
                                        uint32_t queue_size,
-                                       uint32_t need_flush)
+                                       uint32_t need_flush,
+                                       uint32_t width,
+                                       uint32_t height,
+                                       uint32_t format)
 {
        wlt_surface *wlt_surf;
        wayland_tbm_client_queue *wlt_queue;
@@ -268,7 +271,7 @@ _wl_tbm_test_set_active(struct wl_client *client, struct wl_resource *resource,
                wayland_tbm_server_client_queue_set_dequeue_cb(wlt_queue, _wl_tbm_test_queue_dequeue_cb, wlt_surf);
 
                while (i < queue_size) {
-                       tbm_surf = tbm_surface_create(100, 200, TBM_FORMAT_ARGB8888);
+                       tbm_surf = tbm_surface_create(width, height, format);
                        if (i == 0)
                                wl_buf = wayland_tbm_server_client_queue_export_buffer(wlt_queue, tbm_surf, 0xFF,
                                                _wl_tbm_test_server_surface_destroy_cb, nullptr);
index 928a9f1..7d7fddc 100644 (file)
@@ -531,7 +531,7 @@ TEST_F(UtWlTbm, BufQueueActiveReq)
        ASSERT_NE(tbm_queue, nullptr);
        ASSERT_EQ(CheckServerError(), 0);
 
-       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1);
+       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1, 100, 200, TBM_FORMAT_ABGR8888);
        ASSERT_EQ(CheckServerError(), 0);
        active = wayland_tbm_client_queue_check_activate(wl_tbm_client, tbm_queue);
        ASSERT_EQ(CheckServerError(), 0);
@@ -556,7 +556,7 @@ TEST_F(UtWlTbm, BufQueueActiveReqNoFlush)
        ASSERT_NE(tbm_queue, nullptr);
        ASSERT_EQ(CheckServerError(), 0);
 
-       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 0);
+       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 0, 100, 200, TBM_FORMAT_ABGR8888);
        ASSERT_EQ(CheckServerError(), 0);
        active = wayland_tbm_client_queue_check_activate(wl_tbm_client, tbm_queue);
        ASSERT_EQ(CheckServerError(), 0);
@@ -581,13 +581,13 @@ TEST_F(UtWlTbm, BufQueueDeactiveReq)
        ASSERT_NE(tbm_queue, nullptr);
        ASSERT_EQ(CheckServerError(), 0);
 
-       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1);
+       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1, 100, 200, TBM_FORMAT_ABGR8888);
        ASSERT_EQ(CheckServerError(), 0);
        active = wayland_tbm_client_queue_check_activate(wl_tbm_client, tbm_queue);
        ASSERT_EQ(CheckServerError(), 0);
        ASSERT_EQ(active, 1);
 
-       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 0, 0, 0, 0);
+       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 0, 0, 0, 0, 0, 0, 0);
        ASSERT_EQ(CheckServerError(), 0);
        active = wayland_tbm_client_queue_check_activate(wl_tbm_client, tbm_queue);
        ASSERT_EQ(CheckServerError(), 0);
@@ -603,6 +603,7 @@ TEST_F(UtWlTbm, BufQueueBufDestroyReq)
        struct wl_surface *wlt_surface;
        struct wl_tbm *wlt_tbm;
        tbm_surface_queue_h tbm_queue;
+       int active;
 
        wlt_surface = wl_tbm_test_create_surface(wl_tbm_test);
        ASSERT_NE(wlt_surface, nullptr);
@@ -612,8 +613,11 @@ TEST_F(UtWlTbm, BufQueueBufDestroyReq)
        ASSERT_NE(tbm_queue, nullptr);
        ASSERT_EQ(CheckServerError(), 0);
 
-       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1);
+       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1, 100, 200, TBM_FORMAT_ABGR8888);
+       ASSERT_EQ(CheckServerError(), 0);
+       active = wayland_tbm_client_queue_check_activate(wl_tbm_client, tbm_queue);
        ASSERT_EQ(CheckServerError(), 0);
+       ASSERT_EQ(active, 1);
 
        wlt_tbm = wayland_tbm_client_get_wl_tbm(wl_tbm_client);
        wl_tbm_test_destroy_queue_buffer(wl_tbm_test, wlt_tbm, wlt_surface);
@@ -632,6 +636,7 @@ TEST_F(UtWlTbm, BufQueueDequeue)
        tbm_surface_h tbm_surf;
        tbm_surface_queue_error_e tbm_err;
        struct wl_buffer *wl_buf;
+       int active;
 
        wlt_surface = wl_tbm_test_create_surface(wl_tbm_test);
        ASSERT_NE(wlt_surface, nullptr);
@@ -641,8 +646,11 @@ TEST_F(UtWlTbm, BufQueueDequeue)
        ASSERT_NE(tbm_queue, nullptr);
        ASSERT_EQ(CheckServerError(), 0);
 
-       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1);
+       wl_tbm_test_set_active(wl_tbm_test, wlt_surface, 1, 0, 3, 1, 100, 200, TBM_FORMAT_ARGB8888);
+       ASSERT_EQ(CheckServerError(), 0);
+       active = wayland_tbm_client_queue_check_activate(wl_tbm_client, tbm_queue);
        ASSERT_EQ(CheckServerError(), 0);
+       ASSERT_EQ(active, 1);
 
        while (i < 3) {
                if (tbm_surface_queue_can_dequeue(tbm_queue, 0)) {