static void test_io_channel_command_fifo(bool async)

{

#define TEST_FIFO "tests/test-io-channel-command.fifo"

    QIOChannel *src, *dst;

    QIOChannelTest *test;

    char *srcfifo = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);

    char *dstfifo = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);

    const char *srcargv[] = {

        "/bin/socat", "-", srcfifo, NULL,

    };

    const char *dstargv[] = {

        "/bin/socat", dstfifo, "-", NULL,

    };



    unlink(TEST_FIFO);

    if (access("/bin/socat", X_OK) < 0) {

        return; /* Pretend success if socat is not present */

    }

    if (mkfifo(TEST_FIFO, 0600) < 0) {

        abort();

    }

    src = QIO_CHANNEL(qio_channel_command_new_spawn(srcargv,

                                                    O_WRONLY,

                                                    &error_abort));

    dst = QIO_CHANNEL(qio_channel_command_new_spawn(dstargv,

                                                    O_RDONLY,

                                                    &error_abort));



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, async, src, dst);

    qio_channel_test_validate(test);



    object_unref(OBJECT(src));

    object_unref(OBJECT(dst));



    g_free(srcfifo);

    g_free(dstfifo);

    unlink(TEST_FIFO);

}

static void test_io_channel_command_fifo(bool async)

{

#define TEST_FIFO "tests/test-io-channel-command.fifo"

    QIOChannel *src, *dst;

    QIOChannelTest *test;

    char *srcfifo = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);

    char *dstfifo = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);

    const char *srcargv[] = {

        "/bin/socat", "-", srcfifo, NULL,

    };

    const char *dstargv[] = {

        "/bin/socat", dstfifo, "-", NULL,

    };



    unlink(TEST_FIFO);

    if (access("/bin/socat", X_OK) < 0) {

        return; 

    }

    if (mkfifo(TEST_FIFO, 0600) < 0) {

        abort();

    }

    src = QIO_CHANNEL(qio_channel_command_new_spawn(srcargv,

                                                    O_WRONLY,

                                                    &error_abort));

    dst = QIO_CHANNEL(qio_channel_command_new_spawn(dstargv,

                                                    O_RDONLY,

                                                    &error_abort));



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, async, src, dst);

    qio_channel_test_validate(test);



    object_unref(OBJECT(src));

    object_unref(OBJECT(dst));



    g_free(srcfifo);

    g_free(dstfifo);

    unlink(TEST_FIFO);

}

    char *srcfifo = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);     char *dstfifo = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);     g_free(srcfifo);     g_free(dstfifo);
static void FUNC_0(bool VAR_0)

{

#define TEST_FIFO "tests/test-io-channel-command.fifo"

    QIOChannel *src, *dst;

    QIOChannelTest *test;

    char *VAR_1 = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);

    char *VAR_2 = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);

    const char *VAR_3[] = {

        "/bin/socat", "-", VAR_1, NULL,

    };

    const char *VAR_4[] = {

        "/bin/socat", VAR_2, "-", NULL,

    };



    unlink(TEST_FIFO);

    if (access("/bin/socat", X_OK) < 0) {

        return; 

    }

    if (mkfifo(TEST_FIFO, 0600) < 0) {

        abort();

    }

    src = QIO_CHANNEL(qio_channel_command_new_spawn(VAR_3,

                                                    O_WRONLY,

                                                    &error_abort));

    dst = QIO_CHANNEL(qio_channel_command_new_spawn(VAR_4,

                                                    O_RDONLY,

                                                    &error_abort));



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, VAR_0, src, dst);

    qio_channel_test_validate(test);



    object_unref(OBJECT(src));

    object_unref(OBJECT(dst));



    g_free(VAR_1);

    g_free(VAR_2);

    unlink(TEST_FIFO);

}

static void FUNC_0(bool VAR_0)
{ #define TEST_FIFO "tests/test-io-channel-command.fifo"
QIOChannel *src, *dst; QIOChannelTest *test; char *VAR_1 = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO); char *VAR_2 = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO); const char *VAR_3[] = { "/bin/socat", "-", VAR_1, NULL,
}; const char *VAR_4[] = { "/bin/socat", VAR_2, "-", NULL,
}; unlink(TEST_FIFO); if (access("/bin/socat", X_OK) < 0) { return; } if (mkfifo(TEST_FIFO, 0600) < 0) { abort(); } src = QIO_CHANNEL(qio_channel_command_new_spawn(VAR_3,
O_WRONLY,
&error_abort)); dst = QIO_CHANNEL(qio_channel_command_new_spawn(VAR_4,
O_RDONLY,
&error_abort)); test = qio_channel_test_new(); qio_channel_test_run_threads(test, VAR_0, src, dst); qio_channel_test_validate(test); object_unref(OBJECT(src)); object_unref(OBJECT(dst)); g_free(VAR_1); g_free(VAR_2); unlink(TEST_FIFO); }