}
+typedef TPLTestBase DEFAULT_tpl_display_get_backend_type;
+
+TEST_F(DEFAULT_tpl_display_get_backend_type, success) {
+ tpl_backend_type_t result;
+
+ result = tpl_display_get_backend_type(backend->display_handle);
+ ASSERT_NE(TPL_BACKEND_UNKNOWN, result);
+}
+
+TEST_F(DEFAULT_tpl_display_get_backend_type, failure) {
+ tpl_backend_type_t result;
+
+ result = tpl_display_get_backend_type(NULL);
+ ASSERT_EQ(TPL_BACKEND_UNKNOWN, result);
+}
+
+
typedef TPLTestBase DEFAULT_tpl_display_get_native_window_info;
-TEST_F(DEFAULT_tpl_display_get_native_window_info, success)
+// Test with alpha size = 8
+TEST_F(DEFAULT_tpl_display_get_native_window_info, success_1)
{
tpl_result_t result;
int width, height;
ASSERT_EQ(TPL_ERROR_NONE, result);
}
+// Test with alpha size = 0
+TEST_F(DEFAULT_tpl_display_get_native_window_info, success_2)
+{
+ tpl_result_t result;
+ int width, height;
+ tbm_format format;
+
+ result = tpl_display_get_native_window_info(backend->tpl_display,
+ backend->surface_handle,
+ &width, &height, &format,
+ config.depth, 0);
+
+ EXPECT_EQ(config.width, width);
+ EXPECT_EQ(config.height, height);
+ EXPECT_EQ(TBM_FORMAT_XRGB8888, format);
+
+ ASSERT_EQ(TPL_ERROR_NONE, result);
+}
+
/* TODO: Make test - DEFAULT_tpl_display_get_native_window_info, failure */
+
+typedef TPLTestBase DEFAULT_tpl_display_get_native_pixmap_info;
+
+/* TODO: Make test - DEFAULT_tpl_display_get_native_pixmap_info, success */
+
+TEST_F(DEFAULT_tpl_display_get_native_pixmap_info, failure) {
+ tpl_result_t result;
+ int width, height;
+ tbm_format format;
+
+ result = tpl_display_get_native_pixmap_info(backend->tpl_display, NULL,
+ &width, &height, &format);
+
+ ASSERT_EQ(TPL_ERROR_INVALID_OPERATION, result);
+}
+
+
typedef TPLTestBase
EXTRA_tpl_display_query_supported_buffer_count_from_native_window;
return;
}
+ // TODO: Add check on min and max
+
ASSERT_EQ(TPL_ERROR_NONE, result);
}
+
+typedef TPLTestBase DEFAULT_tpl_display_get_buffer_from_native_pixmap;
+
+/* TODO: Make test - DEFAULT_tpl_display_get_native_pixmap_info, success */
+
+TEST_F(DEFAULT_tpl_display_get_buffer_from_native_pixmap, success) {
+ tbm_surface_h tbm_surface;
+
+ tbm_surface = tpl_display_get_buffer_from_native_pixmap(backend->tpl_display,
+ backend->surface_handle);
+
+ EXPECT_NE((void *)NULL, tbm_surface);
+}
+
+TEST_F(DEFAULT_tpl_display_get_buffer_from_native_pixmap, failure) {
+ tbm_surface_h tbm_surface;
+
+ EXPECT_DEATH((tbm_surface = tpl_display_get_buffer_from_native_pixmap(backend->tpl_display, NULL)),
+ ".*Assertion `pixmap' failed\..*");
+}
+
+
+typedef TPLTestBase DEFAULT_tpl_display_query_supported_present_modes_from_native_window;
+
+TEST_F(DEFAULT_tpl_display_query_supported_present_modes_from_native_window, success) {
+ tpl_result_t result;
+
+ result = tpl_display_query_supported_present_modes_from_native_window(
+ backend->tpl_display, backend->surface_handle, NULL);
+
+ // SUCCEED() if backend does not support operation
+ if (result == TPL_ERROR_INVALID_OPERATION) {
+ SUCCEED() << "Backend does not support this operation";
+ return;
+ }
+
+ EXPECT_EQ(TPL_ERROR_NONE, result);
+}