{
plugin = objectCreate();
loop = g_main_loop_new(NULL, FALSE);
+ handle = modes_connect();
}
void TearDown() override
plugin = NULL;
g_main_loop_unref(loop);
loop = NULL;
+ modes_disconnect(handle);
+ handle = NULL;
}
static gboolean apply_mode_idler(gpointer data)
{
- result = modes_apply_mode((const char*)data);
+ result = modes_apply_mode(handle, (const char*)data);
g_main_loop_quit(loop);
return G_SOURCE_REMOVE;
static gboolean undo_mode_idler(gpointer data)
{
- result = modes_apply_mode((const char*)data);
+ result = modes_apply_mode(handle, (const char*)data);
EXPECT_EQ(MODES_ERROR_NONE, result);
sleep(5);
- result = modes_undo_mode((const char*)data);
+ result = modes_undo_mode(handle, (const char*)data);
g_main_loop_quit(loop);
return G_SOURCE_REMOVE;
}
+ static modes_h handle;
static int result;
static GMainLoop *loop;
Plugin *plugin;
int BtPluginTest::result = 0;
GMainLoop *BtPluginTest::loop = NULL;
+modes_h BtPluginTest::handle = NULL;
TEST_F(BtPluginTest, undoModebtOff)
{
void SetUp() override
{
loop = g_main_loop_new(NULL, FALSE);
+ handle = modes_connect();
}
void TearDown() override
{
g_main_loop_unref(loop);
loop = NULL;
+ modes_disconnect(handle);
+ handle = NULL;
}
static gboolean check_mode_idler(gpointer data)
{
- modes_undo_mode((const char*)data);
- result = modes_apply_mode((const char*)data);
+ modes_undo_mode(handle, (const char*)data);
+ result = modes_apply_mode(handle, (const char*)data);
EXPECT_EQ(MODES_ERROR_NONE, result);
sleep(2);
- result = modes_undo_mode((const char*)data);
+ result = modes_undo_mode(handle, (const char*)data);
g_main_loop_quit(loop);
return G_SOURCE_REMOVE;
}
+ static modes_h handle;
static int result;
static GMainLoop *loop;
};
int IntegrationTest::result = 0;
GMainLoop *IntegrationTest::loop = NULL;
+modes_h IntegrationTest::handle = NULL;
TEST_F(IntegrationTest, runMode_btAudioConnect)
{