virtual: default unload virtual module
[platform/core/uifw/libtdm.git] / haltests / src / tc_tdm_client.cpp
index 504aaee..282d8ab 100644 (file)
@@ -1419,8 +1419,15 @@ TEST_P(TDMClient, ClientVblankIsWaitingNullObject)
 TEST_P(TDMClient, ClientCreateVOutput)
 {
        tdm_error ret;
+       int virtual_conf = 0;
        const char name[TDM_NAME_LEN] = "Virtual Output";
 
+       virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+       if (virtual_conf == 0) {
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
+
        ASSERT_EQ(PrepareClient(), true);
 
        voutput = tdm_client_create_voutput(client, name, &ret);
@@ -1531,8 +1538,12 @@ void TDMVirtualOutput::TearDownTestCase(void)
 bool TDMVirtualOutput::PrepareVOutput(void)
 {
        tdm_error ret;
+       int virtual_conf = 0;
        const char name[TDM_NAME_LEN] = "Virtual Output";
 
+       virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+       if (virtual_conf == 0) return true;
+
        client = tdm_client_create(&ret);
        TDM_UT_RETURN_FALSE_IF_FAIL(ret == TDM_ERROR_NONE);
        TDM_UT_RETURN_FALSE_IF_FAIL(client != NULL);
@@ -1575,7 +1586,13 @@ TEST_F(TDMVirtualOutput, SetAvailableModes)
        tdm_error ret;
        tdm_client_output_mode modes[this->MODE_COUNT];
        int count = this->MODE_COUNT;
+       int virtual_conf;
 
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
        _tc_tdm_client_virutual_make_available_mode(modes, count);
 
        ret = tdm_client_voutput_set_available_modes(this->voutput, modes, count);
@@ -1587,6 +1604,13 @@ TEST_F(TDMVirtualOutput, FailTestSetAvailableModes)
        tdm_error ret;
        tdm_client_output_mode modes[this->MODE_COUNT];
        int count = this->MODE_COUNT;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_available_modes(NULL, modes, count);
        ASSERT_EQ(ret, TDM_ERROR_INVALID_PARAMETER);
@@ -1599,6 +1623,13 @@ TEST_F(TDMVirtualOutput, SetPhysicalSize)
 {
        tdm_error ret;
        unsigned int mmWidth = 1234, mmHeight = 1234;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_physical_size(this->voutput, mmWidth, mmHeight);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1608,6 +1639,13 @@ TEST_F(TDMVirtualOutput, FailTestSetPhysicalSize)
 {
        tdm_error ret;
        unsigned int invalid_mmWidth = 0, invalid_mmHeight = 0;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_physical_size(this->voutput, invalid_mmWidth, invalid_mmHeight);
        ASSERT_EQ(ret, TDM_ERROR_INVALID_PARAMETER);
@@ -1625,6 +1663,13 @@ TEST_F(TDMVirtualOutput, AddCommitHandler)
 {
        tdm_error ret;
        int flag_callback_called = 0;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_add_commit_handler(this->voutput,
                                                                                                _tc_tdm_client_voutput_commit_handler,
@@ -1640,6 +1685,13 @@ TEST_F(TDMVirtualOutput, AddCommitHandler)
 TEST_F(TDMVirtualOutput, CommitDone)
 {
        tdm_error ret;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_commit_done(this->voutput);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1649,6 +1701,13 @@ TEST_F(TDMVirtualOutput, GetClientOutput)
 {
        tdm_error ret;
        tdm_client_output *output;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        output = tdm_client_voutput_get_client_output(this->voutput, &ret);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1661,6 +1720,13 @@ TEST_F(TDMVirtualOutput, Connect)
        unsigned int mmWidth = 300, mmHeight = 150;
        tdm_client_output_mode modes[this->MODE_COUNT];
        int count = this->MODE_COUNT;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_physical_size(this->voutput, mmWidth, mmHeight);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1678,6 +1744,13 @@ TEST_F(TDMVirtualOutput, Connect)
 TEST_F(TDMVirtualOutput, Disconnect)
 {
        tdm_error ret;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
 //     TDM_UT_WAIT("check & press");
 
@@ -1694,6 +1767,13 @@ TEST_F(TDMVirtualOutput, SetMode)
        unsigned int mmWidth = 300, mmHeight = 150;
        tdm_client_output_mode modes[this->MODE_COUNT];
        int count = this->MODE_COUNT;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_physical_size(this->voutput, mmWidth, mmHeight);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1723,6 +1803,13 @@ TEST_F(TDMVirtualOutput, SetModeNullObject)
        unsigned int mmWidth = 300, mmHeight = 150;
        tdm_client_output_mode modes[this->MODE_COUNT];
        int count = this->MODE_COUNT;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_physical_size(this->voutput, mmWidth, mmHeight);
        ASSERT_EQ(ret, TDM_ERROR_NONE);
@@ -1750,6 +1837,13 @@ TEST_F(TDMVirtualOutput, SetModeInvalidIndex)
        unsigned int mmWidth = 300, mmHeight = 150;
        tdm_client_output_mode modes[this->MODE_COUNT];
        int count = this->MODE_COUNT;
+       int virtual_conf;
+
+       if (this->voutput == NULL) {
+               virtual_conf = tdm_config_get_int(TDM_CONFIG_KEY_GENERAL_VIRTUAL_OUTPUT, 0);
+               ASSERT_EQ(virtual_conf, 0);
+               return;
+       }
 
        ret = tdm_client_voutput_set_physical_size(this->voutput, mmWidth, mmHeight);
        ASSERT_EQ(ret, TDM_ERROR_NONE);