protected:
tdm_display *dpy = NULL;
tbm_bufmgr tbm_bufmgr = NULL;
- int master_fd = -42, tbm_fd = -42, layer_count = 0;
+ int master_fd = -42, tbm_fd = -42, layer_count = 0, output_count = 0;
tdm_layer ** tdm_layer_array = NULL;
bool has_layers = false;
void SetUp(void)
ASSERT_FALSE(dpy == NULL);
master_fd = tbm_drm_helper_get_master_fd();
tbm_fd = tbm_drm_helper_get_fd();
- int output_count = 0;
- if (tdm_display_get_output_count(dpy, &output_count) == TDM_ERROR_NONE) {
- for (int i = 0; i < output_count; i++) {
- tdm_output * output = tdm_display_get_output(dpy, i, &error);
- if (TDM_ERROR_NONE != error || NULL == output)
- continue;
- tdm_output_conn_status status = TDM_OUTPUT_CONN_STATUS_DISCONNECTED;
- if (TDM_ERROR_NONE != tdm_output_get_conn_status(output, &status))
- continue;
- if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
- continue;
- int temp_layer_count = 0;
- if (TDM_ERROR_NONE != tdm_output_get_layer_count(output, &temp_layer_count))
- continue;
- if (0 == temp_layer_count)
- continue;
- tdm_layer_array = (tdm_layer **) realloc(tdm_layer_array,
- (layer_count + temp_layer_count)*sizeof(tdm_layer *));
- ASSERT_FALSE(NULL == tdm_layer_array);
- for (int k = layer_count; k < (layer_count + temp_layer_count); k++) {
- tdm_layer_array[k] = tdm_output_get_layer(output, k, &error);
- ASSERT_TRUE(TDM_ERROR_NONE == error);
- ASSERT_FALSE(NULL == tdm_layer_array[k]);
- }
- layer_count+=temp_layer_count;
+ ASSERT_TRUE(tdm_display_get_output_count(dpy, &output_count) == TDM_ERROR_NONE);
+ for (int i = 0; i < output_count; i++) {
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (TDM_ERROR_NONE != error || NULL == output)
+ continue;
+ tdm_output_conn_status status = TDM_OUTPUT_CONN_STATUS_DISCONNECTED;
+ if (TDM_ERROR_NONE != tdm_output_get_conn_status(output, &status))
+ continue;
+ if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
+ continue;
+ int temp_layer_count = 0;
+ if (TDM_ERROR_NONE != tdm_output_get_layer_count(output, &temp_layer_count))
+ continue;
+ if (0 == temp_layer_count)
+ continue;
+ tdm_layer_array = (tdm_layer **) realloc(tdm_layer_array,
+ (layer_count + temp_layer_count)*sizeof(tdm_layer *));
+ ASSERT_FALSE(NULL == tdm_layer_array);
+ for (int k = layer_count; k < (layer_count + temp_layer_count); k++) {
+ tdm_layer_array[k] = tdm_output_get_layer(output, k, &error);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_FALSE(NULL == tdm_layer_array[k]);
}
+ layer_count+=temp_layer_count;
}
#ifdef FAIL_ON_UNSUPPORTED
ASSERT_NE(capabilities, -42);
}
}
+
+TEST_F(TDMLayer, LayerGetCapabilitiesFailNullAll)
+{
+ SKIP_FLAG(has_layers);
+ ASSERT_EXIT({if (tdm_layer_get_capabilities(NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMLayer, LayerGetCapabilitiesFailOnlyLayer)
+{
+ SKIP_FLAG(has_layers);
+ ASSERT_EXIT({for (int i = 0; i < layer_count; i++) {
+ if (tdm_layer_get_capabilities(tdm_layer_array[i], NULL) == TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMLayer, OutputGetPrimaryIndexSuccessful)
+{
+ SKIP_FLAG(has_layers);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int index = -42;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_primary_index(output, &index));
+ ASSERT_NE(index, -42);
+ }
+}
+
+TEST_F(TDMLayer, OutputGetPrimaryIndexFailNullAll)
+{
+ SKIP_FLAG(has_layers);
+ ASSERT_EXIT({if (tdm_output_get_primary_index(NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMLayer, OutputGetPrimaryIndexFailOnlyOutput)
+{
+ SKIP_FLAG(has_layers);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (tdm_output_get_primary_index(output, NULL) == TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
TEST_F(TDMOutput, OutputSetDPMSSuccessful)
{
SKIP_FLAG(has_output);
+ bool checked = false;
for (int i = 0; i < output_count; i++) {
tdm_error error = TDM_ERROR_NONE;
tdm_output_conn_status status;
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_conn_status(output, &status));
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
+ checked = true;
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_ON));
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_STANDBY));
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_SUSPEND));
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_OFF));
}
+ if (false == checked) {
+ FAIL() << "All outputs are disconnected. Testcase skipped" << std::endl;
+ }
}
TEST_F(TDMOutput, OutputAddChangeHandlerSuccessful)
{
SKIP_FLAG(has_output);
+ bool checked = false;
for (int i = 0; i < output_count; i++) {
tdm_error error = TDM_ERROR_NONE;
tdm_output * output = tdm_display_get_output(dpy, i, &error);
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_conn_status(output, &status));
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
+ checked = true;
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_add_change_handler(output,
tdm_output_change_handler_test_func,
(void *) -101));
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_OFF));
ASSERT_GT(handle_call, 0);
}
+ if (false == checked) {
+ FAIL() << "All outputs are disconnected. Testcase skipped" << std::endl;
+ }
}
TEST_F(TDMOutput, OutputAddChangeHandlerSuccessfulFewFuncs)
{
SKIP_FLAG(has_output);
+ bool checked = false;
for (int i = 0; i < output_count; i++) {
tdm_error error = TDM_ERROR_NONE;
tdm_output * output = tdm_display_get_output(dpy, i, &error);
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_conn_status(output, &status));
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
+ checked = true;
for (int k = 0; k < 20; k++) {
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_add_change_handler(output,
tdm_output_change_handler_test_func,
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_OFF));
ASSERT_GT(handle_call, 20);
}
+ if (false == checked) {
+ FAIL() << "All outputs are disconnected. Testcase skipped" << std::endl;
+ }
}
TEST_F(TDMOutput, OutputRemoveChangeHandlerSuccessful)
{
SKIP_FLAG(has_output);
+ bool checked = false;
for (int i = 0; i < output_count; i++) {
tdm_error error = TDM_ERROR_NONE;
tdm_output * output = tdm_display_get_output(dpy, i, &error);
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_conn_status(output, &status));
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
+ checked = true;
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_add_change_handler(output,
tdm_output_change_handler_test_func,
(void *) -101));
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_OFF));
ASSERT_EQ(handle_call, 0);
}
+ if (false == checked) {
+ FAIL() << "All outputs are disconnected. Testcase skipped" << std::endl;
+ }
}
TEST_F(TDMOutput, OutputRemoveChangeHandlerSuccessfulFewFuncs)
{
SKIP_FLAG(has_output);
+ bool checked = false;
for (int i = 0; i < output_count; i++) {
tdm_error error = TDM_ERROR_NONE;
tdm_output * output = tdm_display_get_output(dpy, i, &error);
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_conn_status(output, &status));
if (status == TDM_OUTPUT_CONN_STATUS_DISCONNECTED)
continue;
+ checked = true;
for (int k = 0; k < 20; k++) {
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_add_change_handler(output,
tdm_output_change_handler_test_func,
ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_set_dpms(output, TDM_OUTPUT_DPMS_OFF));
ASSERT_EQ(handle_call, 0);
}
+ if (false == checked) {
+ FAIL() << "All outputs are disconnected. Testcase skipped" << std::endl;
+ }
}
TEST_F(TDMOutput, OutputRemoveChangeHandlerFailAllNull)
ASSERT_NE(count, -42);
}
}
+
+TEST_F(TDMOutput, OutputGetLayerCountFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_layer_count(NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetLayerCountFailOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_layer_count(output, NULL)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailablePropertiesSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int count = -42;
+ const tdm_prop *tdm_prop_array = (const tdm_prop *) 0xBEAF;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_available_properties(output,
+ &tdm_prop_array,
+ &count));
+ ASSERT_NE(count, -42);
+ ASSERT_NE(tdm_prop_array, 0xBEAF);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetAvailablePropertiesFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_available_properties(NULL, NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailablePropertiesFailOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_available_properties(output, NULL, NULL)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailablePropertiesFailNullCount)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ const tdm_prop *tdm_prop_array = NULL;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_available_properties(output,
+ &tdm_prop_array,
+ NULL)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailablePropertiesFailNullProperty)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int count = -42;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_available_properties(output,
+ NULL,
+ &count)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailableModesSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int count = -42;
+ const tdm_output_mode *modes_array = (const tdm_output_mode *) 0xBEAF;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_available_modes(output,
+ &modes_array,
+ &count));
+ ASSERT_NE(count, -42);
+ ASSERT_NE(modes_array, 0xBEAF);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetAvailableModesFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_available_modes(NULL, NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailableModesFailOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_available_modes(output, NULL, NULL)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailableModesFailNullCount)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ const tdm_output_mode *modes_array = NULL;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_available_modes(output,
+ &modes_array,
+ NULL)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailableModesFailNullModes)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int count = -42;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (TDM_ERROR_NONE == tdm_output_get_available_modes(output,
+ NULL,
+ &count)) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailableSizeSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int min_w = -42, min_h = -42, max_w = -42, max_h = -42, preferred_align = -42;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_available_size(output, &min_w, &min_h,
+ &max_w, &max_h, &preferred_align));
+ ASSERT_NE(min_w, -42);
+ ASSERT_NE(min_h, -42);
+ ASSERT_NE(max_w, -42);
+ ASSERT_NE(max_h, -42);
+ ASSERT_NE(preferred_align, -42);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetAvailableSizeFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_available_size(NULL, NULL, NULL,
+ NULL, NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetAvailableSizeSuccessfulOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (tdm_output_get_available_size(output, NULL, NULL,
+ NULL, NULL, NULL) != TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetCursorAvailableSizeSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ int min_w = -42, min_h = -42, max_w = -42, max_h = -42, preferred_align = -42;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_cursor_available_size(output, &min_w, &min_h,
+ &max_w, &max_h, &preferred_align));
+ ASSERT_NE(min_w, -42);
+ ASSERT_NE(min_h, -42);
+ ASSERT_NE(max_w, -42);
+ ASSERT_NE(max_h, -42);
+ ASSERT_NE(preferred_align, -42);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetCursorAvailableSizeFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_cursor_available_size(NULL, NULL, NULL,
+ NULL, NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetCursorAvailableSizeSuccessfulOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (tdm_output_get_cursor_available_size(output, NULL, NULL,
+ NULL, NULL, NULL) != TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetPhysicalSizeSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ unsigned int mmWidth = UINT_MAX, mmHeight = UINT_MAX;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_physical_size(output, &mmWidth, &mmHeight));
+ ASSERT_NE(mmWidth, UINT_MAX);
+ ASSERT_NE(mmHeight, UINT_MAX);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetPhysicalSizeFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_physical_size(NULL, NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetPhysicalSuccessfulOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (tdm_output_get_physical_size(output, NULL, NULL) != TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetSubpixelSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ unsigned int subpixel = UINT_MAX;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_subpixel(output, &subpixel));
+ ASSERT_NE(subpixel, UINT_MAX);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetSubpixelFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_subpixel(NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetSubpixelFailOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (tdm_output_get_subpixel(output, NULL) == TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetPipeSuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ unsigned int pipe = UINT_MAX;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ ASSERT_TRUE(TDM_ERROR_NONE == tdm_output_get_pipe(output, &pipe));
+ ASSERT_NE(pipe, UINT_MAX);
+ }
+}
+
+TEST_F(TDMOutput, OutputGetPipeFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({if (tdm_output_get_pipe(NULL, NULL) == TDM_ERROR_NONE) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputGetPipeFailOnlyOutput)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ if (NULL == output) exit(1);
+ if (TDM_ERROR_NONE != error) exit(1);
+ if (tdm_output_get_pipe(output, NULL) == TDM_ERROR_NONE) exit(1);
+ }
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}
+
+TEST_F(TDMOutput, OutputSetPropertySuccessful)
+{
+ SKIP_FLAG(has_output);
+ for (int i = 0; i < output_count; i++) {
+ tdm_error error = TDM_ERROR_NONE;
+ tdm_value value = {.u32 = 0};
+ tdm_output * output = tdm_display_get_output(dpy, i, &error);
+ ASSERT_FALSE(NULL == output);
+ ASSERT_TRUE(TDM_ERROR_NONE == error);
+ error = tdm_output_set_property(output, UINT_MAX, value);
+ ASSERT_TRUE(error == TDM_ERROR_NOT_IMPLEMENTED || error == TDM_ERROR_OPERATION_FAILED);
+ }
+}
+
+TEST_F(TDMOutput, OutputSetPropertyFailNullAll)
+{
+ SKIP_FLAG(has_output);
+ ASSERT_EXIT({tdm_error error = TDM_ERROR_NONE;
+ tdm_value value = {.u32 = 0};
+ error = tdm_output_set_property(NULL, 0, value);
+ if (error == TDM_ERROR_NONE || error == TDM_ERROR_NOT_IMPLEMENTED ||
+ error == TDM_ERROR_OPERATION_FAILED) exit(1);
+ exit(0);}, ::testing::ExitedWithCode(0), "");
+}