aboutsummaryrefslogtreecommitdiff
path: root/tests/mockpulse.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/mockpulse.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/mockpulse.c')
-rw-r--r--tests/mockpulse.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/tests/mockpulse.c b/tests/mockpulse.c
index a931e1d..eec2c03 100644
--- a/tests/mockpulse.c
+++ b/tests/mockpulse.c
@@ -17,13 +17,51 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include <pulse/glib-mainloop.h>
+#include <pulse/context.h>
+
+struct pa_context {
+ int refcount;
+ pa_context_notify_cb_t cb;
+ void *cbdata;
+ pa_context_state_t state;
+};
-pa_glib_mainloop*
+pa_glib_mainloop *
pa_glib_mainloop_new(GMainContext *c)
{
- printf("This is reached\n", c);
return NULL;
}
+pa_context *
+pa_context_new(pa_mainloop_api *loop, char const *name) {
+ struct pa_context * result = g_new(pa_context, 1);
+ result->refcount = 1;
+ return result;
+}
+void
+pa_context_unref(pa_context * context) {
+ context->refcount--;
+ if (!context->refcount)
+ g_free(context);
+}
+
+void
+pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata)
+{
+ c->cb = cb;
+ c->cbdata = userdata;
+}
+
+void set_pa_context_get_state_result(pa_context *c, pa_context_state_t state)
+{
+ c->state = state;
+}
+
+pa_context_state_t
+pa_context_get_state(pa_context *c)
+{
+ return c->state;
+}