-project('libds_tizen', 'c',
+project('libds_tizen',
+ ['c', 'cpp'],
license: 'MIT',
version: '0.1.2',
default_options: [
'warning_level=1',
- 'c_std=gnu99',
+ 'c_std=gnu99', 'cpp_std=c++20',
'buildtype=debug'
]
)
%{_includedir}/libds-tizen/allocator/tbm.h
%{_libdir}/pkgconfig/libds-tizen-allocator-tbm.pc
%{_libdir}/libds-tizen-allocator-tbm.so
+%{_bindir}/libds-tizen-allocator-tbm-tests
%files backend-tdm
%manifest %{name}.manifest
--- /dev/null
+deps_test_common = [
+ deps_libds_tizen,
+ dependency('gmock', required: true),
+ dependency('wayland-client', required: true),
+]
+
+tc_allocator_tbm_files = [
+ 'tc_main.cpp',
+ 'tc_allocator_tbm.cpp',
+]
+
+executable('libds-tizen-allocator-tbm-tests',
+ tc_allocator_tbm_files,
+ dependencies: [
+ deps_test_common,
+ deps_libds_tizen_allocator_tbm,
+ dependency('libdrm', required: true),
+ ],
+ install_dir: libds_tizen_bindir,
+ install : true
+)
--- /dev/null
+#include "tc_main.h"
+#include <libds-tizen/allocator/tbm.h>
+#include <drm_fourcc.h>
+
+class AllocatorTbmTest : public ::testing::Test
+{
+ public:
+ void SetUp(void) override;
+ void TearDown(void) override;
+};
+
+void
+AllocatorTbmTest::SetUp(void)
+{
+}
+
+void
+AllocatorTbmTest::TearDown(void)
+{
+}
+
+TEST_F(AllocatorTbmTest, Create_P)
+{
+ struct ds_allocator *allocator;
+
+ allocator = ds_tbm_allocator_create();
+ EXPECT_TRUE(allocator != NULL);
+
+ ds_allocator_destroy(allocator);
+}
+
+TEST_F(AllocatorTbmTest, GetSurface_P)
+{
+ struct ds_allocator *allocator;
+ struct ds_buffer *buffer;
+ void *tbm_buffer;
+
+ allocator = ds_tbm_allocator_create();
+ EXPECT_TRUE(allocator != NULL);
+
+ buffer =
+ ds_allocator_create_buffer(allocator, 100, 100, DRM_FORMAT_XRGB8888);
+ EXPECT_TRUE(buffer != NULL);
+
+ tbm_buffer = ds_tbm_buffer_get_surface(buffer);
+ EXPECT_TRUE(tbm_buffer != NULL);
+
+ ds_allocator_destroy(allocator);
+}