change wl_signal_emit_mutable into wl_signal_emit
[platform/core/uifw/libds-tizen.git] / tests / tc_allocator_tbm.cpp
1 #include "tc_main.h"
2 #include <libds-tizen/allocator/tbm.h>
3 #include <drm_fourcc.h>
4
5 class AllocatorTbmTest : public ::testing::Test
6 {
7   public:
8     void SetUp(void) override;
9     void TearDown(void) override;
10 };
11
12 void
13 AllocatorTbmTest::SetUp(void)
14 {
15 }
16
17 void
18 AllocatorTbmTest::TearDown(void)
19 {
20 }
21
22 TEST_F(AllocatorTbmTest, Create_P)
23 {
24     struct ds_allocator *allocator;
25
26     allocator = ds_tbm_allocator_create();
27     EXPECT_TRUE(allocator != NULL);
28
29     ds_allocator_destroy(allocator);
30 }
31
32 TEST_F(AllocatorTbmTest, GetSurface_P)
33 {
34     struct ds_allocator *allocator;
35     struct ds_buffer *buffer;
36     void *tbm_buffer;
37
38     allocator = ds_tbm_allocator_create();
39     EXPECT_TRUE(allocator != NULL);
40
41     buffer =
42         ds_allocator_create_buffer(allocator, 100, 100, DRM_FORMAT_XRGB8888);
43     EXPECT_TRUE(buffer != NULL);
44
45     tbm_buffer = ds_tbm_buffer_get_surface(buffer);
46     EXPECT_TRUE(tbm_buffer != NULL);
47
48     ds_allocator_destroy(allocator);
49 }