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;
}
}
-
TEST_F(TDMVirtualOutput, SetAvailableModes)
{
tdm_error ret;
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;
ASSERT_EQ(ret, TDM_ERROR_INVALID_PARAMETER);
}
+static void
+_tc_tdm_client_voutput_commit_handler(tdm_client_voutput *voutput, tbm_surface_h buffer, void *user_data)
+{
+ int *flag;
+ flag = (int *)user_data;
+ *flag = 1;
+}
+
+TEST_F(TDMVirtualOutput, AddCommitHandler)
+{
+ tdm_error ret;
+ int flag_callback_called = 0;
+
+ ret = tdm_client_voutput_add_commit_handler(this->voutput,
+ _tc_tdm_client_voutput_commit_handler,
+ &flag_callback_called);
+ ASSERT_EQ(ret, TDM_ERROR_NONE);
+// ASSERT_EQ(flag_callback_called, 1);
+
+ tdm_client_voutput_remove_commit_handler(this->voutput,
+ _tc_tdm_client_voutput_commit_handler,
+ &flag_callback_called);
+}
+
+TEST_F(TDMVirtualOutput, CommitDone)
+{
+ tdm_error ret;
+
+ ret = tdm_client_voutput_commit_done(this->voutput);
+ ASSERT_EQ(ret, TDM_ERROR_NONE);
+}
+
TEST_F(TDMVirtualOutput, GetClientOutput)
{
tdm_error ret;
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);
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);