WIP
WIP WIP: keymap generation test passes meta: Update features and version WiP: cargo.lock WIP: don't crash WIP: no outlines parsing: New tests WIP: base level works WIP: remove old keyboard symbols correctly input WIP: lodaing files WIP: fallback works Valid fallback
This commit is contained in:
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
|
||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
#include "eek/eek.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
test_create (void)
|
||||
{
|
||||
EekBounds bounds = {0};
|
||||
struct squeek_view *view = squeek_view_new(bounds);
|
||||
struct squeek_button *button0, *button1;
|
||||
|
||||
struct squeek_row *row = squeek_view_create_row (view, 0);
|
||||
g_assert (row);
|
||||
button0 = squeek_row_create_button (row, 1, 0);
|
||||
g_assert (button0);
|
||||
button1 = squeek_row_create_button (row, 2, 0);
|
||||
g_assert (button1);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
g_test_add_func ("/eek-simple-test/create", test_create);
|
||||
return g_test_run ();
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
|
||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* For gdk_x11_display_get_xdisplay(). See main(). */
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "eek/eek.h"
|
||||
#include "eek/eek-xml-layout.h"
|
||||
|
||||
static void
|
||||
test_output_parse (void)
|
||||
{
|
||||
EekLayout *layout;
|
||||
LevelKeyboard *keyboard;
|
||||
GError *error;
|
||||
|
||||
error = NULL;
|
||||
layout = eek_xml_layout_new ("us", &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* We don't need the context service to parse an XML file, so we can pass
|
||||
NULL when creating a keyboard. */
|
||||
keyboard = eek_xml_layout_real_create_keyboard(layout, NULL);
|
||||
g_object_unref (layout);
|
||||
level_keyboard_free(keyboard);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/eek-xml-test/output-parse", test_output_parse);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
17
tests/layout.yaml
Normal file
17
tests/layout.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
bounds:
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
views:
|
||||
base:
|
||||
- "test"
|
||||
outlines:
|
||||
default:
|
||||
corner_radius: 1
|
||||
bounds: { x: 0, y: 0, width: 0, height: 0 }
|
||||
|
||||
buttons:
|
||||
test:
|
||||
label: "test"
|
||||
12
tests/layout2.yaml
Normal file
12
tests/layout2.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
# missing views
|
||||
bounds:
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
outlines:
|
||||
default:
|
||||
corner_radius: 1
|
||||
bounds: { x: 0, y: 0, width: 0, height: 0 }
|
||||
|
||||
16
tests/layout3.yaml
Normal file
16
tests/layout3.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
# extra field
|
||||
bounds:
|
||||
x: 0
|
||||
y: 0
|
||||
width: 0
|
||||
height: 0
|
||||
views:
|
||||
base:
|
||||
- "test"
|
||||
outlines:
|
||||
default:
|
||||
corner_radius: 1
|
||||
bounds: { x: 0, y: 0, width: 0, height: 0 }
|
||||
|
||||
bad_field: false
|
||||
@ -20,8 +20,6 @@ test_link_args = [
|
||||
]
|
||||
|
||||
tests = [
|
||||
'eek-simple-test',
|
||||
'eek-xml-test',
|
||||
'test-keymap-generation'
|
||||
]
|
||||
|
||||
|
||||
@ -25,22 +25,16 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "eek/eek.h"
|
||||
#include "eek/eek-xml-layout.h"
|
||||
#include "eek/eek-keyboard.h"
|
||||
|
||||
#include "src/layout.h"
|
||||
|
||||
static void
|
||||
test_check_xkb (void)
|
||||
{
|
||||
EekLayout *layout;
|
||||
LevelKeyboard *keyboard;
|
||||
GError *error;
|
||||
|
||||
error = NULL;
|
||||
layout = eek_xml_layout_new ("us", &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
keyboard = eek_xml_layout_real_create_keyboard(layout, NULL);
|
||||
gchar *keymap_str = eek_keyboard_get_keymap(keyboard);
|
||||
LevelKeyboard *keyboard = eek_xml_layout_real_create_keyboard("us", NULL);
|
||||
const gchar *keymap_str = squeek_layout_get_keymap(keyboard->layout);
|
||||
|
||||
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
if (!context) {
|
||||
@ -50,14 +44,11 @@ test_check_xkb (void)
|
||||
struct xkb_keymap *keymap = xkb_keymap_new_from_string(context, keymap_str,
|
||||
XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
|
||||
free(keymap_str);
|
||||
|
||||
xkb_context_unref(context);
|
||||
if (!keymap) {
|
||||
g_error("Bad keymap");
|
||||
}
|
||||
|
||||
g_object_unref (layout);
|
||||
level_keyboard_free(keyboard);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user