void
test_wheel_axes (gconstpointer data)
{
    GtkWidget *button;
    gint widget_value;
    const gchar *widget_name;
    WheelAxisAssertFunction assert_function;

    widget_name = gcut_data_get_string(data, "widget-name");
    assert_function = gcut_data_get_pointer(data, "assert-function");

    enable_widget("wheel_emulation_box");

    button = get_widget(widget_name);
    cut_assert_true(GTK_IS_CHECK_BUTTON(button));

    cut_assert_equal_int(4, get_scroll_axes_property_of_xinput());
    widget_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
    assert_function(widget_value);

    gtk_test_widget_click(button, 1, 0);
    wait_action();
    cut_assert_equal_int(4, get_scroll_axes_property_of_xinput());
    widget_value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
    assert_function(widget_value);
}
Exemplo n.º 2
0
static int validate_getAlphabetIndexByCharacter_ERANGE(unsigned char ch, int expectedAlphabetIndex)
{
    int index = 0;
    assert_function(clock_alphabet_getIndexByCharacter(ch, &index), ERANGE);
    if(index != expectedAlphabetIndex) {
        OriginateErrorEx(EFAULT, "%d", "Unexpected index from clock_getAlphabetIndexByCharacter('%c', &index). "
                         "index = %d, expected = %d", ch, index, expectedAlphabetIndex);
    }

    return 0;
}
Exemplo n.º 3
0
void ProtoAssertHandler(bool condition, const char* conditionText, const char* fileName, int lineNumber)
{
    if (NULL != assert_function) assert_function(condition, conditionText, fileName, lineNumber, assert_data);
}  // end ProtoAssertHandler()