Ejemplo n.º 1
0
    void run()
    {
        {
            beast::asio::streambuf b(10);
            std::string const s = "1234567890";
            b << s;
            expect (to_str(b.data()) == s);
            b.prepare(5);
        }

        {
            beast::asio::streambuf b(10);
            b.prepare(10);
            b.commit(10);
            b.consume(10);
        }

        {
            beast::asio::streambuf b(5);
            boost::asio::buffer_copy(b.prepare(14),
                boost::asio::buffer(std::string("1234567890ABCD")));
            b.commit(4);
            expect(to_str(b.data()) == "1234");
            b.consume(4);
            b.commit(10);
            expect(to_str(b.data()) == "567890ABCD");
        }
        
        test_prepare();
        test_commit();
        test_consume();
    }
Ejemplo n.º 2
0
int
main(void)
{
    struct xkb_context *context = test_get_context(0);
    struct xkb_keymap *keymap;

    assert(context);

    /* Make sure these are allowed. */
    xkb_context_unref(NULL);
    xkb_keymap_unref(NULL);
    xkb_state_unref(NULL);

    keymap = test_compile_rules(context, "evdev", "pc104", "us,ru", NULL, "grp:menu_toggle");
    assert(keymap);

    test_update_key(keymap);
    test_serialisation(keymap);
    test_repeat(keymap);
    test_consume(keymap);
    test_range(keymap);
    test_get_utf8_utf32(keymap);
    test_ctrl_string_transformation(keymap);

    xkb_keymap_unref(keymap);
    keymap = test_compile_rules(context, "evdev", NULL, "ch", "fr", NULL);
    assert(keymap);

    test_caps_keysym_transformation(keymap);

    xkb_keymap_unref(keymap);
    xkb_context_unref(context);
}