virtual (client): Added implementation for setting available format.
[platform/core/uifw/libtdm.git] / haltests / src / tc_tdm_client.cpp
index 6be6821..1ee78c5 100644 (file)
@@ -1413,6 +1413,7 @@ protected:
        static tdm_client *client;
        static tdm_client_voutput *voutput;
        const int MODE_COUNT = 2;
+       const int FORMAT_COUNT = 2;
 
 private:
        static pid_t server_pid;
@@ -1540,6 +1541,7 @@ _tc_tdm_client_virutual_make_available_mode(tdm_client_output_mode *modes, int c
        }
 }
 
+
 TEST_F(TDMVirtualOutput, SetAvailableModes)
 {
        tdm_error ret;
@@ -1565,6 +1567,19 @@ TEST_F(TDMVirtualOutput, FailTestSetAvailableModes)
        ASSERT_EQ(ret, TDM_ERROR_INVALID_PARAMETER);
 }
 
+TEST_F(TDMVirtualOutput, SetAvailableFormats)
+{
+       const int nformats = 2;
+       tdm_error ret;
+       tbm_format formats[nformats];
+
+       formats[0] = TBM_FORMAT_ARGB8888;
+       formats[1] = TBM_FORMAT_XRGB8888;
+
+       ret = tdm_client_voutput_set_available_formats(this->voutput, formats, nformats);
+       ASSERT_EQ(ret, TDM_ERROR_NONE);
+}
+
 TEST_F(TDMVirtualOutput, SetPhysicalSize)
 {
        tdm_error ret;
@@ -1595,10 +1610,12 @@ TEST_F(TDMVirtualOutput, GetClientOutput)
 
 TEST_F(TDMVirtualOutput, Connect)
 {
+       const int nformats = 2;
        tdm_error ret;
        tdm_client_output *output;
        unsigned int mmWidth = 300, mmHeight = 150;
        tdm_client_output_mode modes[this->MODE_COUNT];
+       tbm_format formats[nformats];
        int count = this->MODE_COUNT;
 
        output = tdm_client_voutput_get_client_output(this->voutput, &ret);
@@ -1612,6 +1629,11 @@ TEST_F(TDMVirtualOutput, Connect)
        ret = tdm_client_voutput_set_available_modes(this->voutput, modes, count);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
 
+       formats[0] = TBM_FORMAT_ARGB8888;
+       formats[1] = TBM_FORMAT_XRGB8888;
+       ret = tdm_client_voutput_set_available_formats(this->voutput, formats, nformats);
+       ASSERT_EQ(ret, TDM_ERROR_NONE);
+
        ret = tdm_client_output_connect(output);
        ASSERT_EQ(ret, TDM_ERROR_NONE);