Back to index

libindicate  12.10.0
Functions | Variables
test-thousand-indicators-server.c File Reference
#include <glib.h>
#include "libindicate/listener.h"

Go to the source code of this file.

Functions

static void indicator_added (IndicateListener *listener, IndicateListenerServer *server, IndicateListenerIndicator *indicator, gchar *type, gpointer data)
static gboolean failed_cb (gpointer data)
int main (int argc, char *argv)

Variables

static gboolean passed = TRUE
static GMainLoop * mainloop = NULL
static guint indicator_count = 0

Function Documentation

static gboolean failed_cb ( gpointer  data) [static]

Definition at line 20 of file test-thousand-indicators-server.c.

{
       g_debug("Failed to get a server in 5 seconds.");
       passed = FALSE;
       g_main_loop_quit(mainloop);
       return FALSE;
}

Here is the caller graph for this function:

static void indicator_added ( IndicateListener *  listener,
IndicateListenerServer *  server,
IndicateListenerIndicator *  indicator,
gchar *  type,
gpointer  data 
) [static]

Definition at line 10 of file test-thousand-indicators-server.c.

{
       g_debug("Indicator Added:          %s %d %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), type);
       indicator_count++;
       if (indicator_count == 1000) {
              g_main_loop_quit(mainloop);
       }
}

Here is the caller graph for this function:

int main ( int  argc,
char *  argv 
)

Definition at line 29 of file test-thousand-indicators-server.c.

{
       g_type_init();

       IndicateListener * listener = indicate_listener_ref_default();

       g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), NULL);

       g_timeout_add_seconds(5, failed_cb, NULL);

       mainloop = g_main_loop_new(NULL, FALSE);
       g_main_loop_run(mainloop);

       return !passed;
}

Here is the call graph for this function:


Variable Documentation

guint indicator_count = 0 [static]

Definition at line 7 of file test-thousand-indicators-server.c.

GMainLoop* mainloop = NULL [static]

Definition at line 6 of file test-thousand-indicators-server.c.

gboolean passed = TRUE [static]

Definition at line 5 of file test-thousand-indicators-server.c.