#include <gtk/gtk.h>
#include <unique/unique.h>

int
main(int argc, char *argv[])
{
    UniqueApp *unique;
    UniqueMessageData *data;
    char *filename1, *filename2;
    
    int i;

    gtk_init(&argc, &argv);

    unique = unique_app_new("test.unique", NULL);

    /* try different filename lengths in case there are lucky zeros on
       the heap */
    for (i = 1; i < 64; ++i)
    {
        filename1 = g_strnfill(i, 'a');

        data = unique_message_data_new();

        unique_message_data_set_filename(data, filename1);

        filename2 = unique_message_data_get_filename(data);

        if (!g_str_equal(filename1, filename2))
        {
            g_print("different filenames for length %d:\n", i);
            g_print("  filename1 = \"%s\"\n", filename1);
            g_print("  filename2 = \"%s\"\n", filename2);
        }

        unique_message_data_free(data);
        g_free(filename1);
        g_free(filename2);
    }

    return 0;
}


/* Local Variables: */
/* mode: c          */
/* compile-command: "gcc -g -O0 -Wall -o bug-605104 `pkg-config --cflags --libs gtk+-2.0 unique-1.0` bug-605104.c" */
/* End:             */
