GCredentials *credentials,
gpointer user_data)
{
- GDBusDaemon *daemon = user_data;
gboolean authorized = TRUE;
if (credentials != NULL)
GError *error = NULL;
if (g_getenv ("G_TEST_DBUS_DAEMON") != NULL)
- argv[0] = g_getenv ("G_TEST_DBUS_DAEMON");
+ argv[0] = (gchar *)g_getenv ("G_TEST_DBUS_DAEMON");
/* Write config file and set its path in argv */
file = write_config_file (self);
error = NULL;
/* Seek by read */
- g_assert_cmpstr (g_seekable_tell (G_SEEKABLE (in)), ==, 0);
+ g_assert_cmpint (g_seekable_tell (G_SEEKABLE (in)), ==, 0);
byte = g_buffered_input_stream_read_byte (G_BUFFERED_INPUT_STREAM (in), NULL, &error);
g_assert_no_error (error);
g_assert_cmpint (byte, ==, 'a');
_g_utf8_strwidth (const gchar *p)
{
glong len = 0;
- const gchar *start = p;
g_return_val_if_fail (p != NULL, 0);
while (*p)
static void
test_dynamic_iface (void)
{
- GTypeModule *module;
TestDynamicIfaceClass *dynamic_iface;
- module = test_module_new (module_register);
+ test_module_new (module_register);
/* Not loaded until we call ref for the first time */
dynamic_iface = g_type_default_interface_peek (TEST_TYPE_DYNAMIC_IFACE);
static void
test_dynamic_type (void)
{
- GTypeModule *module;
DynamicObjectClass *class;
- module = test_module_new (module_register);
+ test_module_new (module_register);
/* Not loaded until we call ref for the first time */
class = g_type_class_peek (DYNAMIC_OBJECT_TYPE);
iface = TEST_IFACE6_GET_CLASS (object);
g_assert (iface && iface->val == 0x60006 && iface->base_val == 0x660066);
+ g_type_class_unref (object_class);
+
return 0;
}
/* basic sanity checks */
if (!block_size || !n_blocks || block_size >= area_size)
{
- g_printerr ("Invalid arguments: block-size=%llu memory-size=%llu\n", block_size, area_size);
+ g_printerr ("Invalid arguments: block-size=%" G_GUINT64_FORMAT " memory-size=%" G_GUINT64_FORMAT "\n", block_size, area_size);
usage();
return 1;
}
- g_printerr ("Will allocate and touch %llu blocks of %llu bytes (= %llu bytes) %llu times with color increment: 0x%08llx\n",
- n_blocks, block_size, n_blocks * block_size, repeats, g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
+ g_printerr ("Will allocate and touch %" G_GUINT64_FORMAT " blocks of %" G_GUINT64_FORMAT " bytes (= %" G_GUINT64_FORMAT " bytes) %" G_GUINT64_FORMAT " times with color increment: 0x%08" G_GUINT64_MODIFIER "x\n",
+ n_blocks, block_size, n_blocks * block_size, repeats,
+ (guint64)g_slice_get_config (G_SLICE_CONFIG_COLOR_INCREMENT));
touch_mem (block_size, n_blocks, repeats);
for (i = 0; i < n_chunks; i++)
{
gint64 *vals = g_slice_get_config_state (G_SLICE_CONFIG_CONTENTION_COUNTER, i, &n);
- g_print (" %9llu | %9llu | %9llu\n", vals[0], vals[2], vals[1]);
+ g_print (" %9" G_GINT64_FORMAT " | %9" G_GINT64_FORMAT " | %9" G_GINT64_FORMAT "\n", vals[0], vals[2], vals[1]);
g_free (vals);
}
}
#include <glib.h>
-#define DEBUG_MSG(x)
-/* #define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n"); */
+/* #define DEBUG 1 */
+
+#ifdef DEBUG
+# define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");
+#else
+# define DEBUG_MSG(x)
+#endif
#define WAIT 5 /* seconds */
#define MAX_THREADS 10
static void
test_thread_pools_entry_func (gpointer data, gpointer user_data)
{
+#ifdef DEBUG
guint id = 0;
id = GPOINTER_TO_UINT (data);
+#endif
DEBUG_MSG (("[pool] ---> [%3.3d] entered thread.", id));
static void
test_thread_idle_time_entry_func (gpointer data, gpointer user_data)
{
+#ifdef DEBUG
guint thread_id;
thread_id = GPOINTER_TO_UINT (data);
+#endif
DEBUG_MSG (("[idle] ---> entered thread:%2.2d", thread_id));
static gboolean
test_thread_idle_timeout (gpointer data)
{
- guint interval;
gint i;
- interval = GPOINTER_TO_UINT (data);
-
for (i = 0; i < 2; i++) {
g_thread_pool_push (idle_pool, GUINT_TO_POINTER (100 + i), NULL);
DEBUG_MSG (("[idle] ===> pushed new thread with id:%d, number "