Commit Graph

239 Commits

Author SHA1 Message Date
Matthias Clasen
4a035403d3 Fix the scrolledwindow test
These tests were written for the propagate-nat-size semantics,
so opt in to it.
2016-08-31 15:04:57 -04:00
Philip Withnall
76721e736e gtkicontheme: Don’t emit warning about fallback theme when in unit tests
In order to eliminate g_test_expect_message() (which doesn’t work with
G_LOG_USE_STRUCTURED), make the warning about the fallback theme not
existing be conditional on the icon theme search path containing a
system path. Any application code which modifies the search path does so
through appends and prepends, so this should not affect whether the
warning is emitted in production.

https://bugzilla.gnome.org/show_bug.cgi?id=769485
2016-08-06 17:13:25 -04:00
Matthias Clasen
1306f780ab tests: Avoid g_test_expect_message
Instead of using g_test_expect_message, just ignore the warning.
2016-08-06 17:13:25 -04:00
Matthias Clasen
80d329a3e7 Skip GtkShortcutLabel::accelerator in notify test
This property is not freely settable, since the string
gets parsed.
2016-08-02 23:59:34 -04:00
Matthias Clasen
5ab2b8f562 Make icontheme test work with structured logging
Since we've opted in to G_LOG_USE_STRUCTURED, this test
now needs to do its thing using a log writer function.
2016-08-02 23:23:43 -04:00
Matthias Clasen
d9c07c0a6a Skip GdkDrawingContext in default value tests
GdkDrawingContext objects can't be freely constructed.
2016-08-02 22:32:25 -04:00
Matthias Clasen
1ebfe1db56 Skip GdkDrawingContext in some tests
GdkDrawingContext is not freely constructible, so we need
to skip it in the notify and finalize tests.
2016-06-20 15:27:20 -04:00
Philip Chimento
76bacfde6e style cascade: Allow cascades with more ancestors
Previously a style cascade's parent could not have a parent itself. That
represented the two levels at which you could add a style provider: at
the screen level, with gtk_style_context_add_provider_for_screen(), and
at the style context level, with gtk_style_context_add_provider().

This commit changes no functionality, but this change will be necessary
for adding style providers in the future that apply to a subtree of the
widget tree. It relaxes the requirement that a style cascade's parent
must not have a parent, since in the future a style context may be
affected by any number of parent widgets' style contexts.

https://bugzilla.gnome.org/show_bug.cgi?id=751409
2016-06-19 19:47:05 -04:00
Tristan Van Berkom
d6187c9a02 scrolledwindow test: Check natural width for max content size
The maximum content size does not increase the minimum request
but only ensures that both minimum and natural requests do not
exceed the maximum setting.
2016-06-09 14:57:10 +09:00
Emmanuele Bassi
32885605c7 Fix build
Commit 023f406c96 has a typo that results
in this error:

../../../testsuite/gtk/notify.c: In function 'test_type':
../../../testsuite/gtk/notify.c:679:54: error: expected expression
before ')' token
    (g_str_equal (pspec->name, "max-content-width") ||)
                                                      ^
2016-06-08 14:20:02 +01:00
Matthias Clasen
023f406c96 test: Skip GtkScrolledWindow::max-content- properties
The allowed values for the max-content- properties depend
on the value of the min-content- properties, in a way that
our simple test is not prepared to deal with. Just skip
them for now.
2016-06-08 09:04:33 -04:00
Christian Dywan
b97c490b87 object test: Also test object type properties
Old patch found in bugzilla, it still applies and doesn't
cause the test to fail.

https://bugzilla.gnome.org/show_bug.cgi?id=556254
2016-06-05 22:15:00 -04:00
Georges Basile Stavracas Neto
3962b907bb testsuite: add tests for scrolledwindow
This patch adds a set of tests for scrolled window
sizing, covering both min- and max-content width and
height.

https://bugzilla.gnome.org/show_bug.cgi?id=742281
2016-06-05 11:04:41 -03:00
Javier Jardón
101da71ee3 Use upstream gettext
https://bugzilla.gnome.org/show_bug.cgi?id=373745
2016-05-16 20:46:19 +01:00
Matthias Clasen
ef7ccab188 defaultvalue test: Skip GdkMonitor::geometry
We never return NULL for ::geometry and ::workarea. Just skip
these properties.
2016-05-02 12:42:13 -04:00
Matthias Clasen
db1a39a817 notify test: Skip GtkFontButton::font-name
This is not freely settable.
2016-04-25 23:09:19 -04:00
Paolo Borelli
c574ef0954 textiter: add unit test for forward_to_line_end
Surprisingly we had no unit test for this method
2016-04-22 08:54:25 +02:00
Matthias Clasen
4a9cf8527e Add some more accelerator / modifier tests 2016-04-17 01:54:43 -04:00
Matthias Clasen
6f2d5a6290 Move autotestkeywords to testsuite
All the 'make check' and installed tests are now in testsuite/,
and tests/ is just a collection manual test programs.
2016-03-28 17:56:13 -04:00
Matthias Clasen
d69100547c testsuite: Remove a test that isn't valid with csd
With csd, the allocation of the window will be larger than the
default size, since it includes borders and decorations. Just
remove this check.
2016-03-05 13:47:41 -05:00
Timm Bäder
8b70115d5e revealer-size: Fix animation setting
Turn animations off before testing, for all test functions containing
"no_animations".
2016-03-03 21:05:37 +01:00
Timm Bäder
1c544e4237 Add GtkRevealer sizing tests
https://bugzilla.gnome.org/show_bug.cgi?id=762996
2016-03-03 18:54:08 +01:00
Matthias Clasen
b1d691dbfd testsuite: Fix up icontheme test
This test was relying on GtkIconTheme using g_print for
debug spew. Adapt it to use g_logv instead.
2016-02-28 21:40:23 -05:00
Matthias Clasen
9dad9a4b59 testsuite: Strip newlines from g_warning and g_error
g_logv adds one for us already.
2016-02-28 12:23:12 -05:00
Matthias Clasen
8ff40b5d14 Plug a small memory leak 2016-02-26 15:52:19 -05:00
Benjamin Otte
d3e8cf87aa testsuite: Don't use deprecated APIs 2016-02-13 06:41:29 +01:00
Benjamin Otte
f9c2982ddc testsuite: No warnings on type conversions please
long is 32bit on win64, so it's int cast to pointer of different size, and gcc doesn't like that.
2016-02-11 03:44:47 +01:00
Matthias Clasen
4d40bd4474 Fix stylecontext tests
This was broken by f7ec9c98ef,
since type names are no longer used at all in CSS matching.
2016-02-06 09:59:48 +01:00
Matthias Clasen
586522d83c Use TAP output for installed tests 2016-01-30 11:04:22 -05:00
Matthias Clasen
e84f1ae3bb Update the list of required cursors
We're now using standard cursor names for DND, so check for these.
2016-01-08 18:11:07 -05:00
Matthias Clasen
12be432df7 Skip GdkX11DeviceManagerCore in default value tests
We already skip the XI2 implementation, and the core
one needs the same treatment.
2016-01-03 16:14:43 -05:00
Matthias Clasen
7a01741575 Skip GdkX11DeviceManagerCore in notify tests
We already skip the XI2 implementation, and the core
one needs to the same treatment.
2016-01-03 10:34:40 -05:00
Matthias Clasen
d83e9539c5 Fix stylecontext tests to work
Some of the tests don't work anymore because they test
features of saved style contexts that have changed, and some
now trigger deprecation warnings.
2016-01-03 01:25:07 -05:00
Matthias Clasen
6da57d61d5 Skip GdkX11DeviceManagerCore in finalize tets
We already skip the XI2 implementation, and the core
one needs to the same treatment.
2016-01-03 01:23:35 -05:00
Sébastien Wilmet
e2d1042b6b Don't use gtk_text_iter_begins_tag() (deprecated)
Use gtk_text_iter_starts_tag() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=759092
2015-12-08 19:56:57 +01:00
Matthias Clasen
64431a17e3 Add a test for required cursors
We use these cursors in GTK+, so check for their existence.
2015-12-05 19:09:17 -05:00
Matthias Clasen
f19cadeaf3 testsuite: Fix notify tests
GtkStatusIcon tests don't work well under xwayland either, so just
skip them unconditionally.
GtkEntry now fails because the update of the im-module is no longer
deferred to an idle, and (gtk-im-simple) is not a valid module
name, so skip this property.
2015-12-04 13:22:26 -05:00
Sébastien Wilmet
1a8f3e2462 textiter: fix bug in case insensitive backward search
'win.lines' contains the same content as the GtkTextBuffer, so to find
@match_start, forward_chars_with_skipping() is called with
skip_decomp=FALSE (the last parameter). So far so good.

On the other hand, the content 'lines' (the needle split in lines) is
casefolded and normalized for a case insensitive search. So,
forward_chars_with_skipping(..., skip_decomp=TRUE) must be called only
for the portion of text containing the needle.

Since 'start_tmp' contains the location at the start of the match, we
can simply begin at that location to find the end of the match.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=758698
2015-11-30 19:46:16 +01:00
Benjamin Otte
d75989a52b cssstyle: Don't store custom css properties
This makes custom CSS properties no longer configurable. But it avoids
crashes when loading custom themes, so that's a good thing.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1281234
2015-11-20 21:22:15 +01:00
Matthias Clasen
9202bc244e Fix make check
For some reason, GtkFileChooserNative is causing the defaultvalue
test to fail. I couldn't track this down quickly, so skip the
type for now.
2015-11-20 00:13:20 -05:00
Matthias Clasen
8f3ffe4d08 Work around g_test_dbus annoyance
Without iterating a mainloop for a bit, g_test_dbus_down() will
give us an error.
2015-11-20 00:13:20 -05:00
Benjamin Otte
0a4e88b79b cssprovider: Have a section on import error
When loading a nonexisting CSS file using
gtk_css_provider_load_from_file() or gtk_css_provider_load_from_path()
we would emit the error using a NULL scanner. Don't do that, because
we'll have a NULL section in that case and error handlers don't like
that.

Testcase attached.

https://bugzilla.redhat.com/show_bug.cgi?id=1277959
2015-11-16 17:39:15 +01:00
Matthias Clasen
fe65c3ac4c Add one more selector to CSS parsing tests
Add an E + F selector to the selector parsing tests.
It is a CSS selector that we support.
2015-11-14 19:04:42 -05:00
Matthias Clasen
2d054fa6ae Always pass the right state in style context getters
Otherwise, we are causing warnings that break make check.
2015-11-14 19:03:57 -05:00
Matthias Clasen
dedab98bbb testsuite: Skip GtkFileChooserNative for notification tests
Like all the other GtkFileChooser implementations, this one
emits some unneeded notifications.
2015-11-14 19:03:10 -05:00
Sébastien Wilmet
1685da6f69 textbuffer: nicer get_iter functions, without return values
Avoid crashes when passing an invalid location to a
gtk_text_buffer_get_iter_at_*() function.

A first attempt added boolean return values to know if @iter has been set to
the exact location, but it breaks Python and JS bindings because the out
parameter is already a return value in those languages.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=735341
2015-11-12 17:50:39 +01:00
Matthias Clasen
fde91c3bec Revert "textbuffer: nicer get_iter functions"
This reverts commit a9a1c00cc9.

Unfortunately, adding the boolean return broke both the python
and javascript bindings, since they now return a tuple consisting
of the boolean and the out argument.
2015-11-12 09:58:28 -05:00
Benjamin Otte
61db7da2ef testsuite: Remove a bunch of broken tests
These tests have either been commented out for way too long or use APIs
that we don't want to support.
2015-11-04 05:06:23 +01:00
Benjamin Otte
a58d8bdcbc cssprovider: Have a section when parsing style properties
Signal handlers expect a section to be present, so provide them with
one.

New testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=757240
2015-10-28 19:37:27 +01:00
Matthias Clasen
5ee39befb8 Fix make check
Don't try setting GtkShortcutsShortcut::accelerator to a
random value, it only accepts strings that it can parse.
2015-10-27 13:27:43 -04:00