aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pulse-manager.c
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2010-03-09 13:43:16 +1100
committerRobert Collins <robertc@robertcollins.net>2010-03-09 13:43:16 +1100
commit6c2b978f17d48fe212cccb15c23bb1e278ba600f (patch)
tree831860bd8bfb6778ac6c72cc1d105c66c0585435 /tests/test-pulse-manager.c
parenta89c6663a0cf1deec82d8492fb897fd8541c1194 (diff)
downloadayatana-indicator-sound-6c2b978f17d48fe212cccb15c23bb1e278ba600f.tar.gz
ayatana-indicator-sound-6c2b978f17d48fe212cccb15c23bb1e278ba600f.tar.bz2
ayatana-indicator-sound-6c2b978f17d48fe212cccb15c23bb1e278ba600f.zip
flesh out test_pa_context_exit
Diffstat (limited to 'tests/test-pulse-manager.c')
-rw-r--r--tests/test-pulse-manager.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/test-pulse-manager.c b/tests/test-pulse-manager.c
index f5dfb80..f4f7ffc 100644
--- a/tests/test-pulse-manager.c
+++ b/tests/test-pulse-manager.c
@@ -20,21 +20,28 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
/* we test static functions */
#include "../src/pulse-manager.c"
+#include "mockpulse.h"
-pa_context* context;
static void test_pa_context_exit()
{
+ pa_context* context = pa_context_new(NULL, "foo");
pa_context_set_state_callback(context, context_state_callback, NULL);
// => call context_state_callback(context, NULL);
- // pa_context_get_state needs to be mocked to return the right FAIL flag.
+ // pa_context_get_state is mocked to return the right FAIL flag.
+ set_pa_context_get_state_result(context, PA_CONTEXT_FAILED);
+ context_state_callback(context, NULL);
// 1. test to make sure relevant variables are tidied up
- // 2. then using the same pa_context_get_state we could ensure the manager is attempting to reconnect tp PA.
+ // XXX: Conor to do.
+ // 2. then using the same pa_context_get_state we could ensure the manager
+ // is attempting to reconnect to PA.
+ pa_context_unref(context);
}
static void test_sink_insert()
{
sink_info *value;
+ pa_context* context = pa_context_new(NULL, "foo");
value = g_new0(sink_info, 1);
value->index = 8;
value->name = "mock_sink";
@@ -46,6 +53,7 @@ static void test_sink_insert()
// update_sink_info is a static method in pulse-manager.c ?
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.
+ pa_context_unref(context);
}