aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/test-pulse-manager.c23
2 files changed, 20 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7573ea5..5b61b5a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -94,7 +94,8 @@ test_pulse_manager_LDADD = \
libmockpulse.la \
$(PULSEAUDIO_LIBS) \
$(SOUNDSERVICE_LIBS) \
- $(GCONF_LIBS)
+ $(GCONF_LIBS) \
+ $(APPLET_LIBS)
#########################################
diff --git a/tests/test-pulse-manager.c b/tests/test-pulse-manager.c
index 2bc1c51..f5dfb80 100644
--- a/tests/test-pulse-manager.c
+++ b/tests/test-pulse-manager.c
@@ -37,12 +37,25 @@ static void test_sink_insert()
sink_info *value;
value = g_new0(sink_info, 1);
value->index = 8;
- value->name = "mock_sink";"
- value->description = "mock description"
- value->mute = FALSE
- value->volume = 30000; // almost full
+ value->name = "mock_sink";
+ value->description = "mock description";
+ value->mute = FALSE;
+ pa_cvolume volume; // nearly full volume:
+ pa_cvolume_set(&volume, 1, 30000);
+ value->volume = volume;
// update_sink_info is a static method in pulse-manager.c ?
- pa_context_get_sink_info_by_index(context, value->index, update_sink_info);
+ pa_context_get_sink_info_by_index(context, value->index, update_sink_info, NULL);
// the mockinkg lib should then return this mocked up sink_info to the method update_sink_info which tests could be wrote against to make sure everthing is populated correctly.
}
+
+gint main (gint argc, gchar * argv[])
+{
+ g_type_init();
+ g_test_init(&argc, &argv, NULL);
+
+ g_test_add_func("/indicator-sound/pulse-manager/sink-insert", test_sink_insert);
+ g_test_add_func("/indicator-sound/pulse-manager/pa-context-exit", test_pa_context_exit);
+
+ return g_test_run ();
+}