mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
test: manager: Use more appropriate g_assert_*()
calls
This commit is contained in:
parent
44f2002f86
commit
9c91a33604
1 changed files with 11 additions and 10 deletions
|
@ -20,7 +20,7 @@ call_add_cb (CallsManager *manager, CallsCall *call)
|
||||||
static void
|
static void
|
||||||
call_remove_cb (CallsManager *manager, CallsCall *call)
|
call_remove_cb (CallsManager *manager, CallsCall *call)
|
||||||
{
|
{
|
||||||
g_assert (call == test_call);
|
g_assert_true (call == test_call);
|
||||||
test_call = NULL;
|
test_call = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ test_calls_manager_without_provider ()
|
||||||
guint no_origins;
|
guint no_origins;
|
||||||
GListModel *origins;
|
GListModel *origins;
|
||||||
g_autoptr (CallsManager) manager = calls_manager_new ();
|
g_autoptr (CallsManager) manager = calls_manager_new ();
|
||||||
g_assert (CALLS_IS_MANAGER (manager));
|
g_assert_true (CALLS_IS_MANAGER (manager));
|
||||||
|
|
||||||
g_assert (calls_manager_get_state (manager) == CALLS_MANAGER_STATE_NO_PROVIDER);
|
g_assert_cmpuint (calls_manager_get_state (manager), ==, CALLS_MANAGER_STATE_NO_PROVIDER);
|
||||||
|
|
||||||
origins = calls_manager_get_origins (manager);
|
origins = calls_manager_get_origins (manager);
|
||||||
no_origins = g_list_model_get_n_items (origins);
|
no_origins = g_list_model_get_n_items (origins);
|
||||||
|
@ -52,9 +52,9 @@ test_calls_manager_dummy_provider ()
|
||||||
GListModel *origins_tel;
|
GListModel *origins_tel;
|
||||||
guint position;
|
guint position;
|
||||||
g_autoptr (CallsOrigin) origin = NULL;
|
g_autoptr (CallsOrigin) origin = NULL;
|
||||||
g_assert (CALLS_IS_MANAGER (manager));
|
g_assert_true (CALLS_IS_MANAGER (manager));
|
||||||
|
|
||||||
g_assert (calls_manager_get_state (manager) == CALLS_MANAGER_STATE_NO_PROVIDER);
|
g_assert_cmpuint (calls_manager_get_state (manager), ==, CALLS_MANAGER_STATE_NO_PROVIDER);
|
||||||
|
|
||||||
origins = calls_manager_get_origins (manager);
|
origins = calls_manager_get_origins (manager);
|
||||||
g_assert_true (origins);
|
g_assert_true (origins);
|
||||||
|
@ -62,7 +62,7 @@ test_calls_manager_dummy_provider ()
|
||||||
|
|
||||||
calls_manager_add_provider (manager, "dummy");
|
calls_manager_add_provider (manager, "dummy");
|
||||||
g_assert_true (calls_manager_has_provider (manager, "dummy"));
|
g_assert_true (calls_manager_has_provider (manager, "dummy"));
|
||||||
g_assert_true (calls_manager_get_state (manager) == CALLS_MANAGER_STATE_READY);
|
g_assert_cmpuint (calls_manager_get_state (manager), ==, CALLS_MANAGER_STATE_READY);
|
||||||
|
|
||||||
g_assert_cmpuint (g_list_model_get_n_items (origins), >, 0);
|
g_assert_cmpuint (g_list_model_get_n_items (origins), >, 0);
|
||||||
g_assert_null (calls_manager_get_calls (manager));
|
g_assert_null (calls_manager_get_calls (manager));
|
||||||
|
@ -93,18 +93,19 @@ test_calls_manager_dummy_provider ()
|
||||||
g_assert_null (test_call);
|
g_assert_null (test_call);
|
||||||
g_assert_cmpuint (g_list_model_get_n_items (origins), ==, 0);
|
g_assert_cmpuint (g_list_model_get_n_items (origins), ==, 0);
|
||||||
|
|
||||||
g_assert (calls_manager_get_state (manager) == CALLS_MANAGER_STATE_NO_PROVIDER);
|
g_assert_cmpuint (calls_manager_get_state (manager), ==, CALLS_MANAGER_STATE_NO_PROVIDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_calls_manager_mm_provider ()
|
test_calls_manager_mm_provider ()
|
||||||
{
|
{
|
||||||
g_autoptr (CallsManager) manager = calls_manager_new ();
|
g_autoptr (CallsManager) manager = calls_manager_new ();
|
||||||
g_assert (CALLS_IS_MANAGER (manager));
|
g_assert_true (CALLS_IS_MANAGER (manager));
|
||||||
|
|
||||||
|
g_assert_cmpuint (calls_manager_get_state (manager), ==, CALLS_MANAGER_STATE_NO_PROVIDER);
|
||||||
|
|
||||||
g_assert (calls_manager_get_state (manager) == CALLS_MANAGER_STATE_NO_PROVIDER);
|
|
||||||
calls_manager_add_provider (manager, "mm");
|
calls_manager_add_provider (manager, "mm");
|
||||||
g_assert (calls_manager_get_state (manager) > CALLS_MANAGER_STATE_NO_PROVIDER);
|
g_assert_cmpuint (calls_manager_get_state (manager), >, CALLS_MANAGER_STATE_NO_PROVIDER);
|
||||||
g_assert_null (calls_manager_get_calls (manager));
|
g_assert_null (calls_manager_get_calls (manager));
|
||||||
|
|
||||||
calls_manager_remove_provider (manager, "mm");
|
calls_manager_remove_provider (manager, "mm");
|
||||||
|
|
Loading…
Reference in a new issue