1 /**************************************************************************
3 * Copyright 2016 Samsung Electronics co., Ltd. All Rights Reserved.
5 * Contact: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
6 * Contact: Andrii Sokolenko <a.sokolenko@samsung.com>
7 * Contact: Roman Marchenko <r.marchenko@samsung.com>
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the
11 * "Software"), to deal in the Software without restriction, including
12 * without limitation the rights to use, copy, modify, merge, publish,
13 * distribute, sub license, and/or sell copies of the Software, and to
14 * permit persons to whom the Software is furnished to do so, subject to
15 * the following conditions:
17 * The above copyright notice and this permission notice (including the
18 * next paragraph) shall be included in all copies or substantial portions
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 **************************************************************************/
38 #include <gmock/gmock.h>
40 #include <tbm_bufmgr_int.h>
41 #include <wayland-server-protocol.h>
43 #define TBM_UT_ENTRY() \
44 TBM_INFO("--------------------------------------------- %s", typeid(*this).name())
46 #define TBM_UT_CHECK_FLAG(FLAG) \
49 TBM_INFO("[ ] not supported");\
52 #define TBM_UT_SKIP_FLAG(FLAG) \
55 TBM_INFO("[ SKIPPED ] not supported");\
60 #define TBM_UT_NEVER_GET_HERE() \
62 TBM_INFO("!!! TBM UT NEVER GET HERE !!!");\
64 #define TBM_UT_RETURN_IF_FAIL(cond) { \
66 TBM_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \
70 #define TBM_UT_RETURN_FALSE_IF_FAIL(cond) { \
72 TBM_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \
76 #define TBM_UT_GOTO_IF_FAIL(cond, dst) { \
78 TBM_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \
83 #define TBM_UT_DUMP_DIR "/tmp/tbm_dump"
84 #define UT_TBM_INVALID_VALUE -42
85 #define TBM_UT_INVALID_UINT_VALUE 99999
86 #define UT_TBM_BO_SIZE 1024
87 #define UT_TBM_SURFACE_QUEUE_SIZE 4
89 using ::testing::TestWithParam;
90 using ::testing::Bool;
91 using ::testing::Values;
92 using ::testing::Combine;
94 class TBMEnv : public TestWithParam< std::tuple<bool, bool, const char*> >
101 class TBMBufmgr : public TBMEnv