Commit Graph

2200 Commits

Author SHA1 Message Date
Matthias Clasen
2f7fa10434 Merge branch 'textview-im-surrounding' into 'main'
textview: Provide more context to input methods

See merge request GNOME/gtk!4209
2021-12-03 20:26:54 +00:00
Matthias Clasen
d5c01098fd textview: Provide more context to input methods
When returning surrounding context to input methods,
include at least 2 words before and after the insertion
point.

Update the affected input method tests.
2021-12-03 14:44:05 -05:00
Georg Vienna
c517e945de textchildanchor: allow to specify replacement character 2021-12-03 16:02:48 +00:00
Benjamin Otte
07cfdd8ca0 label: Don't set ellipsized size as natural size
Natural size should never ellipsize.

Tests added.
2021-11-30 15:10:02 +01:00
Benjamin Otte
354fa6544a texture: Remove gdk_texture_download_float()
The download API is not well thought out yet, so postpone it until
there's an actual usecase for it.

Remove testcases, too.
2021-11-30 14:12:10 +01:00
Benjamin Otte
ce8faa2e90 testsuite: Make function arguments const 2021-11-30 14:12:10 +01:00
Benjamin Otte
27965d5fdc builder-tool: Don't simplify enums too much
Store the enum nick, not the enum value. That way the file remains
human-readable.

Updated reftests to new expected output.
2021-11-21 02:19:57 +01:00
Benjamin Otte
c025bc5098 paned: Compute the right handle size
Testcase included

Fixes #4469
2021-11-21 01:49:40 +01:00
Benjamin Otte
170bc0a8de window: properly compute desired size
Previously, the code did not expand the size properly when a default
size was already set.

Reftest included.
2021-11-21 01:31:06 +01:00
Benjamin Otte
a0ca936e8d sizerequestcache: Increase size
This is a quickfix to avoid infinite runtime in nested boxes with
wrapped labels.

Test included
2021-11-20 06:04:10 +01:00
Benjamin Otte
50e0893497 widget: force adjustment method is one size is FILL
If halign=fill, force adjustment to height-for-width.
If valign=fill, force adjustment to width-for-height.
Otherwise look at request mode.

This way we don't try to adapt the filled dimension and only adjust
the one that is not set to fill.
2021-11-20 06:04:10 +01:00
Benjamin Otte
7459d430eb widget: Don't forget margins when adjusting
This could lead to the wrong values being passed and computing invalid
sizes which would then lead to very unhappy code.

Test included.
2021-11-19 23:46:59 +01:00
Matthias Clasen
c86789427d Don't spam debug messages into TAP output
g_log_writer_standard_streams just puts all the logs
out onto stderr and stdout if we don't stop it. Pango
recently grew a bunch of g_debug calls, and those were
now showing up, making all the reftests fail.
2021-11-16 18:45:34 -05:00
Benjamin Otte
300a88922e build: Disable gcc warnings as warnings, too
We use -Werror in the build, so even if some warnings are just warnings,
they'd be errors.
2021-11-15 15:35:10 +01:00
Benjamin Otte
46f8600b6a css: Don't crash when color stop offsets descend
Testcase included.

Fixes #4424
2021-11-10 17:28:14 +01:00
Benjamin Otte
1e47b1c610 label: Handle width-chars > text width
This was broken in wrapping labels.

Testcase included.
2021-11-09 18:34:35 +01:00
Benjamin Otte
76c4673944 boxlayout: Fix broken min-size-for-opposite-size
Assume a vbox with 2 wrapping labels saying
  Hello World
  Hi Ho
being measured for their minimum width for 3 rows of text.
This should be layouted like
  Hello
  World
  Hi Ho
and measured accordingly.

However, previously this was layouted as
  Hello World
  Hi Ho
with 1.5 lines being assigned to both labels.
That will obviously not compute the above wrapping which clearly
results in a smaller min width.

A reftest testing exactly this was included.
2021-11-09 03:41:43 +01:00
Benjamin Otte
81169d18c3 label: max-width-chars should be ignored sometimes
When a widget is neither wrappable nor ellipsizable, we cannot modify
the label to fit into any size. So we cannot respect max-width-chars.
2021-11-09 03:41:43 +01:00
Benjamin Otte
cce6a603a6 label: max-width-chars has no effect on smaller text
Having a short text and a large max-width-chars should request the
natural width of the text, not the limit from max-width-chars.

This caused huge message dialogs.

Reftests added.
2021-11-09 03:41:43 +01:00
Benjamin Otte
577d520006 reftests: Add reftest for last 2 issues
Use a label that is long enough to require wrapping and force it into a
hardcoded width. Use a sentence where all the words have the same size
to not get unwanted wrapping behavior.

Also append a 2nd row to check that the first row gets the proper height
allocated.

Found by Marco Melorio.
2021-11-06 04:30:50 +01:00
Benjamin Otte
5c9ae28937 boxlayout: Compute opposite size properly
For size -1 in the opposite orientation, GtkBoxLayout used to measure
the children based on their min size in the box's orientation instead of
-1. That wasn't really intended, but was a side effect of how the sizing
code did (not) distribute extra size above the minimum size.

This is clearly not what we want.
What we want is measuring the orientation as is for size -1. Then we
want to just take the maximum of all children and use that.

A reftest is incldued that ensures a vbox wraps a label just like an
hbox does.
2021-11-05 20:30:49 +01:00
Benjamin Otte
8e27fc7f9b label: Redo measure() code
The old code couldn't properly do height-for-width because it only
computed the widest and smallest layout instead of looking at the actual
passed in for-size.

The label-sizing reftest has been adapted as the label code is now smart
enough to always display the whole text and no longer requests a too
small width-for-single-row when wrapping.
2021-11-05 20:29:42 +01:00
Benjamin Otte
53acff167b Revert "label: Never measure more than max-width-chars"
This reverts commit ba44e7a228.

The change was meant to revert to old GTK3 behavior but it actually
broke new GTK4 behavior that is in use where max-width-chars is used to
determine an ideal size, but where we don't want to limit the width to
that size.

So what happens is the reintroduction of GTK3-style lots of whitepsace
bugs, and we really don't want those.

We also don't want to break backwards compat if we can avoid it.

So let's revert this.

The reftest that was made for this purpose has been adapted.

Fixes #4399
2021-11-05 06:12:33 +01:00
Matthias Clasen
e017e4252b reftest: No blinking, please
Blinking cursors aren't helpful when we want to
compare renderings pixel-by-pixel. Turn them off.
2021-11-03 20:43:01 -04:00
Matthias Clasen
97365a8ffe reftest: Stop setting GDK_RENDERING
That environment variable isn't used anymore.
2021-11-03 20:40:22 -04:00
Matthias Clasen
df12a41cbb testsuite: Set GDK_DEBUG unconditionally
The default-settings key works in non-debug builds
too, nowadays.
2021-11-03 20:39:33 -04:00
Benjamin Otte
c97a758aa7 cssparser: Remove unused argument
The base_directory argument is never used. So don't have it.
2021-10-28 03:19:08 +02:00
Benjamin Otte
ac8c4245b2 css: Don't throw warnings on broken URL in image css
If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.

This was broken since 0886ade182

A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.

Fixes #4373
2021-10-26 23:52:38 +02:00
Benjamin Otte
2b2fd23815 Merge branch 'wip/otte/center-center-center' into 'master'
Add a bunch of reftests and fix their failures

Closes #4285

See merge request GNOME/gtk!4085
2021-10-22 16:35:41 +00:00
Benjamin Otte
2113a18a18 testsuite: Add lots of reftests for picture sizing
Have square images in the following sizes:
  * 20
  * 100
  * 150
  * 200
  * 300
and place them in a can-shrink Picture allocated at the sizes:
  * 200x100
  * 100x200
and set align to center/center.

That's 10 combinations and they should all do the right thing.
2021-10-22 17:51:41 +02:00
Benjamin Otte
438bf8596e reftests: Don't crash if no node
If we have no node, don't crash when trying to save the node file.

Instead, write an empty file.
2021-10-22 17:51:40 +02:00
Benjamin Otte
0898023e6b testsuite: Create GL renderers without surfaces 2021-10-20 21:49:32 +02:00
Benjamin Otte
192e554f3e testsuite: don't XFAIL label-sizing anymore
It's fixed now.
2021-10-19 01:10:59 +02:00
Benjamin Otte
00214cbb4a testsuite: Add test specifically for recent fix
label-sizing.ui tests this, too - but that test tests lots of other
things, and if this ever happens again, we want to debug it in a small
test.
2021-10-19 01:10:59 +02:00
Benjamin Otte
cad979b734 reftest: On failure, save the node files, too
Doesn't hurt to have them available, so it's easy to figure out if a
failure is due to the renderer or if we're generating wrong node files.
2021-10-19 01:01:36 +02:00
Benjamin Otte
a859471960 testsuite: Add workarounds for non-gl backends
read: Fix tests for broadway
2021-10-18 14:17:11 +02:00
Benjamin Otte
1e7fb52b21 Add memory formats used by libpng
Add unpremultiplied high-depth formats. They are used in the real world,
so let's support them.
2021-10-13 14:33:44 +02:00
Matthias Clasen
49a64da7ec Merge branch 'ngl-is-the-new-gl' into 'master'
Rename ngl to gl

Closes #4318

See merge request GNOME/gtk!4037
2021-10-11 06:43:41 +00:00
Benjamin Otte
e581c148d9 testsuite: Add run for GLES
This is supposed to test the most fallback GL stuff, so we might want to
set even more env vars here.

Also enable the run for the Fedora builder in CI.
2021-10-09 06:27:21 +02:00
Benjamin Otte
b4ab9f7b8c testsuite: Add a test targeting GL upload code
Previously, all the tests used the icon upload path using
glTexSubImage2D().

This test uses the custom texture path using glTexImage2D().
2021-10-09 04:44:30 +02:00
Benjamin Otte
30164d5b46 css: Render the background-clip area, not the background-origin
Testcase included

Fixes #4324
2021-10-07 19:59:44 +02:00
Matthias Clasen
144f727d5a Rename ngl to gl
We have only one gl renderer now, and it is
a bit odd for it not be called gl.
2021-10-07 13:05:53 -04:00
Benjamin Otte
2e555db9a4 testsuite: Fail more accurately
Don't run the full test and then return "something failed" - instead
just explode when you find the failure.
2021-10-06 22:50:07 +02:00
Matthias Clasen
f42c61f9d1 Merge branch 'wip/otte/for-master' into 'master'
testsuite: Actually run all memorytexture tests

See merge request GNOME/gtk!4016
2021-10-01 00:26:59 +00:00
Matthias Clasen
6f002678be gtk-builder-tool: Simplify more
Simplify enum properties as well.

Update affected tests.
2021-09-29 10:58:21 -04:00
Matthias Clasen
5bc3923bae builder-tool: Avoid <style> when converting
We can just set the css-classes property instead.

Update affected tests.
2021-09-28 17:48:50 -04:00
Matthias Clasen
c4069fdcee builder: Fix handling of <binding>
We were only applying <binding> elements when the
object is constructed, which can be triggered by
various things (e.g. a <style> element). Defer
this until we reach </object>, so we can be sure
that we pick up all the bindings.

Testcase included.

Fixes: #4147
2021-09-28 15:09:49 -04:00
Matthias Clasen
ec62402908 builder: Fix parsing of mixed declarations
The GtkBuilder parser constructs the object e.g.
when handling a <binding> element. There may be
more <property> elements after it, which we were
just not applying. Fix that by always applying
property when we see </object>. To do that, we
need to track the applied status per property.

Test included.

Fixes: #4208
2021-09-27 17:47:24 -04:00
Benjamin Otte
9395b28542 testsuite: Actually run all memorytexture tests
Whoops
2021-09-26 09:41:55 +02:00
Christian Hergert
b578c78eff texthistory: add barriers after final grouping
We don't want to allow new items to be grouped into a previous action
group after the end_user_action() is called. This ensures that we add a
barrier action in those conditions.

Fixes #4276
2021-09-23 13:25:35 -07:00
Martin Kühl
a9d7282f00 gtkcomposetable: Accept long replacement strings
This change removes the assertions limiting replacement strings in the compose table to be less than 20 characters.
The limit seems arbitrary, is not required, will break some users' setups, and problems with it result in applications not launching.

Fixes #4273
2021-09-21 17:03:20 +02:00
Benjamin Otte
1ef000b1ab reftests: Add tests that check default-size is computed correctly
Related: #4136
2021-09-21 02:52:30 +00:00
Matthias Clasen
41b810da7f Add gsk_transform_to_2d_components
This function decomposes a general 2D transform
into skew, scale, rotation and translation.

Tests included.
2021-09-18 02:06:51 -04:00
Matthias Clasen
5742483422 Add more transform tests
Test gsk_transform_to_2d.
2021-09-17 22:37:08 -04:00
Benjamin Otte
cf3830704b icontheme: Fix variable mixup leading to crashes
Note: Don't have 2 variables named "icon" and "gicon", you will screw
them up.

reftests included.

Fixes #4269
2021-09-17 17:41:13 +00:00
Matthias Clasen
63647cace0 testsuite: Run the clipboard test in isolation
We can't have other test pop up windows, and possibly
stealing focus and preventing us from getting data
offers. So, run the clipboard test in isolation.
2021-09-17 11:38:28 -04:00
Matthias Clasen
8c34dd58c0 gsk: Add a test for transform_bounds 2021-09-17 07:43:07 -04:00
Benjamin Otte
577bf104c0 testsuite: Add png and tiff methods
We encode the texture to a PNG or TIFF and then decode
it again, in various ways.
2021-09-17 00:25:22 +02:00
Matthias Clasen
5b82cf1145 rendernodeparser: Use gdk_texture_save_to_png_bytes
Avoid cairo, and use our own api for saving png data.

Update affected test output.
2021-09-17 00:25:22 +02:00
Matthias Clasen
95a0c93839 Add contentserializer tests for textures 2021-09-17 00:25:22 +02:00
Matthias Clasen
e30b4c61cb Add tests for the jpeg loader 2021-09-17 00:25:22 +02:00
Matthias Clasen
945c2531ac Add tests for the tiff loader 2021-09-17 00:25:22 +02:00
Matthias Clasen
d6ce65f81c Add tests for the png loader 2021-09-17 00:25:22 +02:00
Benjamin Otte
83ea623775 reftests: Use the default (aka NGL) renderer
All tests pass with the renderer now, so we can remove useof the
fallback.
2021-09-16 23:59:37 +02:00
Benjamin Otte
345faa7250 reftests: XFAIL border-half-pixel test
the GL renderer can't deal with non-integers
2021-09-16 23:59:37 +02:00
Benjamin Otte
08df891070 reftests: Use colors without rounding errors
Color values must be divisible by 15 to be convertible into U8 and U16
values with the same result. 0x80 is not one of these values, so switch
it to 0x99.
2021-09-16 23:59:37 +02:00
Benjamin Otte
62954a0338 ngl Fix bottom-right border render failure
The wrong index was used for offsetting the bottom border rect.

Test included.
2021-09-16 23:59:37 +02:00
Benjamin Otte
7cf5e5546b testsuite: Switch color from khaki to yellow
llvmpipe doesn't loike compositing semitransparent khaki onto solid
khaki without rounding errors.
2021-09-16 23:59:37 +02:00
Benjamin Otte
58f66ebd07 reftests: Make image-compare use textures
All image comparisons are done on textures now.
2021-09-16 23:59:37 +02:00
Benjamin Otte
47330598fb reftests: Use 0.6 instead of 0.5 for alpha
See previous commit about rounding
2021-09-16 23:59:37 +02:00
Benjamin Otte
90ed7b92b2 reftests: Use 0.6 alpha, not 0.5
0.5 leads to some GL renderers computing 0.5 * 0xFF as 0x7F and
others 0x80, while 0.6 * 0xFF (255 is divisible by 5) is always 0x99.
2021-09-16 23:59:37 +02:00
Benjamin Otte
625b5ce91a testsuite: Port compare_render() to use textures 2021-09-16 23:59:37 +02:00
Benjamin Otte
46bb160923 testuite: Add opacity-overdraw test
Tests that overdrawing of content inside an opacity node happens before
the opacity is applied.

This is broken in the GL renderer and causes the opacity.ui reftest to
fail.
2021-09-16 23:59:37 +02:00
Benjamin Otte
0dfab46c15 reftests: Use GdkTexture instead of cairo_surface_t
This also switches the rendering code from using gsk_render_node_draw()
to gsk_renderer_render_texture().

Some tests are broken with the GL renderer, so this patch forces the
Cairo renderer until they get fixed.
2021-09-16 23:59:37 +02:00
Benjamin Otte
3a8ec683d3 reftests: Make diff pixels always opaque
We had pixels that did not differ in alpha and we then set 0 alpha
difference hich made the pixel invisible. Oops.
2021-09-16 23:59:37 +02:00
Benjamin Otte
de53b0c7a3 testsuite: remove box-order test
The test used to test that GtkBox ordered it's children left-to-right in
CSS, no matter the text direction or pack-type.

But there is neither a pack-type anymore nor does GTK4 do that.

So that test has been broken for yers, it just didn't render anything
wrong.
2021-09-16 23:59:37 +02:00
Benjamin Otte
64acaf99fb testsuite: Fix race in texture-threads test
Threads are evil, yo.
2021-09-16 23:59:37 +02:00
Benjamin Otte
b6d3561f4a testsuite: Be more verbose in texture-threads test
The test randomly fails on CI, so try to be more helpful in debugging
them.
2021-09-16 23:59:37 +02:00
Matthias Clasen
4439ff0c12 testsuite: Stop running tests for the gl renderer
It does not exist anymore.
2021-09-14 16:12:55 -04:00
Matthias Clasen
ffab67ac70 testsuite: Call g_test_init in test binaries
Without it, we mess out on G_DEBUG=fatal-warnings,
so our ci does not alert us that we run a bunch of
tests which spit out warnings.
2021-09-14 16:12:55 -04:00
Matthias Clasen
2b4f798e34 testsuite: Fix a few memory leaks
These are keeping the asan build in ci from passing.
2021-09-14 08:29:45 -04:00
Benjamin Otte
6785461c26 gltexture: Make sure downloading textures works in a different thread
This happens in the real world when using the inspector to look at a
node recording of a GStreamer video while the video is still playing.

GStreamer will use the GL context in a different thread while we are
busy trying to download it.

A test is included.
2021-09-13 01:40:03 +02:00
Benjamin Otte
416763bf2d testsuite: Add tests for gdk_texture_download_float() 2021-09-12 05:54:37 +02:00
Benjamin Otte
9179ebb28e testsuite: Add memory test support for OpenGL up/downloads
Use a GL renderer to upload textures (and then optionally download them
via release() again). This way, we can test that the GL renderer
properly uploads textures to the right formats (not losing information
for HDR for example) and downloads them again.
2021-09-12 05:54:37 +02:00
Benjamin Otte
bcc17b3033 testsuite: Add tests uploading the memorytextures
Use a GL renderer and render_texture() them.
2021-09-12 05:54:37 +02:00
Benjamin Otte
00439f9e5c testsuite: Rework memorytexture test some more
Instead of predefined colors, generate them randomly.
2021-09-12 05:54:37 +02:00
Benjamin Otte
c9d748fc51 testsuite: Overhaul memorytexture test
Instead of hardcoding pixel values, allow construction of textures by
filling them with GdkRGBA values.
2021-09-12 05:54:37 +02:00
Benjamin Otte
9e11ea699c Merge branch 'hsl' into 'master'
gdk_rgba_parse: Support HSL colors

See merge request GNOME/gtk!3899
2021-09-11 12:57:25 +00:00
Matthias Clasen
155a4fac5c Add vectorized half-float conversion
We can't make the -4 versions inline, since
we use ifuncs for them, so make vectorized
versions.

Test included.
2021-09-10 22:17:31 -04:00
James Westman
0782c8a051
gdk_rgba_parse: Support HSL colors 2021-09-10 16:56:42 -05:00
Simon McVittie
16b9a30655 reftest-compare: Treat colour channels as undefined if alpha is zero
If the alpha channel is zero, it doesn't matter what the values of the
red, green and blue channels are: the pixel is still fully transparent.
On most architectures, fully transparent pixels end up all-zeroes
(fully transparent black), matching what's in the reference PNG file;
but on mips*el the blend-difference and blend-normal tests get all-ones
(fully transparent white) and a test failure.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4227
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-09-02 22:34:48 +01:00
Matthias Clasen
67495fcc77 Update settings tests
We have a new setting, so the test that is counting
settings needs an update.
2021-09-01 17:16:08 -04:00
Matthias Clasen
733fb527fa Revert "reftests: Enforce default settings"
This reverts commit 4e4f57e091.

This should not be necessary, since we have GDK_DEBUG=default-settings.
2021-08-30 11:01:22 -04:00
Simon McVittie
1071818df8 compose: Update sequences from libX11 1.7.2
This adds support for sequences like <Compose>,G,u -> capital G with
breve. Previously, only a capital U was accepted for E, G, I and O
(but a lower-case u was accepted for A and U for some reason).

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 13:09:27 +01:00
Matthias Clasen
03ed585f6f tests: Rewrite PangoAttribute introspection
We can use the new binding helpers to make this
a little less bothersome. That way, it will need
tweaks less often (only when new fundamental types
are introduced).
2021-08-24 12:53:48 -04:00
Matthias Clasen
ba95ef63da Drop PANGO_VERSION_CHECK checks
We require Pango 1.49 now.
2021-08-22 15:26:23 -04:00
Matthias Clasen
8b2f28eee3 css: Add parser tests for line-height 2021-08-22 15:15:50 -04:00
Matthias Clasen
f95e9407a9 Fix up test output for new version
Annoying that this test has to be touched every time
we bump the version.
2021-08-22 14:48:12 -04:00
Matthias Clasen
fd885e42b0 Merge branch 'drop-gl' into 'master'
gsk: Drop the gl renderer

See merge request GNOME/gtk!3863
2021-08-22 17:04:25 +00:00
Matthias Clasen
ea31ae31c1 tests: Remove an outdated comment
It refers to a file that no longer exists.
2021-08-22 12:29:59 -04:00
Matthias Clasen
5feba67a3d Handle new pango attribute type
Update all the places where we switch over
PangoAttrType to handle PANGO_ATTR_TEXT_TRANSFORM,
and do nothing for now - text-transform support
will land in 4.6.
2021-08-22 11:04:28 -04:00
Matthias Clasen
f1f197e3b9 4.4.0 2021-08-20 15:10:25 -04:00
Matthias Clasen
cedb6183e9 Fix imcontext tests
We should force our internal im context for these
tests, so we don't depend on the environment.
2021-08-20 15:10:25 -04:00
Matthias Clasen
528ebfabf0 Handle the new line height pango attribute
Update all the places where we switch over PangoAttributeType
to handle (and ignore, for now) the new line height attribute.
2021-08-10 08:22:52 -04:00
Matthias Clasen
e5e7f5dd88 ci: Disable treeview-headers-hidden reftest
Somebody needs to figure out why it fails in ci so
frequently.
2021-08-05 12:41:04 -04:00
Matthias Clasen
f7dc0dda4e Merge branch 'big-keysyms' into 'master'
imcontext: Treat keysyms as 32bit values

Closes #4149

See merge request GNOME/gtk!3819
2021-08-03 01:05:16 +00:00
Matthias Clasen
6563b05d60 Add some GtkIMContext tests
For now, these check that the surrounding handling
in GtkText and GtkTextView is sane.

Fixes: #4151
2021-08-02 20:44:40 -04:00
Matthias Clasen
bbc36448fb imcontext: Treat keysyms as 32bit values
Our compose table format is still limited to 16bit
values for keysyms, but what we see in key events
can be 32bit values, and we treat them as such now.

Fixes: #4149
2021-08-02 19:16:18 -04:00
Matthias Clasen
f59d2ae89d Merge branch 'input-tweaks' into 'master'
imcontext: Tweak Compose sequence preedit

Closes #10, #4127, and #4124

See merge request GNOME/gtk!3799
2021-08-02 18:07:46 +00:00
Matthias Clasen
8a25f54e1f Add more label parsing tests
Test various combinations of underline and markup
parsing.
2021-08-01 23:19:00 -04:00
Matthias Clasen
e67b2cb54b composetable: Allow multiple dead keys
Remove the limitation on the number of dead keys
that we match, and allow the result be be multiple
characters.

Regenerate the builtin sequences, since this changes
what dead key sequences we can reproduce algorithmically.

Update tests to match.

Fixes: #10
2021-07-29 20:37:30 -04:00
Matthias Clasen
539391ce6c composetable: Change an API
Make gtk_check_algorithmically take a GString
for the result. This is in preparation for allowing
multi-character results here, in the future.

Update all callers.
2021-07-29 17:29:25 -04:00
Matthias Clasen
67b568f464 testsuite: Set TEST_RESULT_DIR for tools tests 2021-07-28 22:42:46 -04:00
Matthias Clasen
910f23ea19 Merge branch 'wip/otte/widgetfactory-dnd' into 'master'
Improve DND

See merge request GNOME/gtk!3785
2021-07-27 04:12:58 +00:00
Benjamin Otte
d760332f00 testsuite: Add contentformat tests 2021-07-27 04:28:04 +02:00
Matthias Clasen
5c4aba4b9c Merge branch 'wip/compose-parser' into 'master'
Clean up the GtkComposeTable api

See merge request GNOME/gtk!3746
2021-07-26 11:51:14 +00:00
Matthias Clasen
4e4f57e091 reftests: Enforce default settings
Set all settings to their default values, so we
are less dependent on the environment to be set
up just right. In particular, this fixes animations
being disabled when we happen to run in a vm.
2021-07-19 13:26:32 -04:00
Benjamin Otte
a76f515569 cssimagecrossfade: Don't abort() when failing to parse image
The code wasn't checking if parsing an image failed and just returning
success.

Testcase from bug is attached.

Fixes #4101
2021-07-16 17:50:09 +02:00
Matthias Clasen
a663b8c313 Merge branch 'fix-negative-scales' into 'master'
ngl: Handle negative scales

Closes #4096

See merge request GNOME/gtk!3755
2021-07-16 11:59:47 +00:00
Matthias Clasen
8390363abe testsuite: Avoid negative scales with gl renderer
The fix in 1c90bb522e was only for the ngl renderer,
so don't use the test with the gl renderer, until it is
fixed as well.
2021-07-16 07:11:20 -04:00
Matthias Clasen
6ff85d287a Merge branch 'wip/chergert/fix-texthistory-insert' into 'master'
texthistory: fix calculation of n_chars

See merge request GNOME/gtk!3756
2021-07-16 11:04:21 +00:00
Christian Hergert
5d02a8f5db texthistory: fix calculation of n_chars
This should be the number of characters, not the end position. This fixes
an issue where we wouldn't coalesce insert actions together.
2021-07-15 21:26:30 -07:00
Benjamin Otte
834d3749c6 testsuite: Add test for crasher
Test for the crasher in !4096
2021-07-15 23:43:28 +02:00
Matthias Clasen
87e2a02e0c composetable: Rewrite Compose files if necessary
Apply heuristics to avoid breaking users existing configurations
with the change to not always add the default sequences.

If we find a cache that was generated before 4.4, and the Compose
file does not have an include, and doesn't contain so many sequences
that it is probably a copy of the system one, we take steps to keep
things working, and thell the user about it.
2021-07-15 09:30:09 -04:00
Matthias Clasen
264d592012 composetable: Keep the number of sequences
And print it out in tests.

Update all tests for this.
2021-07-15 09:30:01 -04:00
Matthias Clasen
0ad5094119 Remove some leftover debug code 2021-07-15 09:30:01 -04:00
Matthias Clasen
54dffa07f3 composetable: Drop GtkComposeTableCompact
All tables use the compact format now, and we generate
caches in that format too. Bump the cache version to 3
for this.

Replace the python script for generating the builtin table
by a small C program using the same code to generate the data
for the builtin table. This drops the restriction on only
generating a single character in the builtin sequences.
2021-07-13 22:03:23 -04:00
Matthias Clasen
485dc052ca composetable: Allow removing sequences
Interpret an empty string as value in the Compose
file to mean: Remove this sequence.

Tests included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
45d39c2802 composetable: Switch to using a hash table
This lets us naturally replace matching sequences
while parsing. That means that the semantics are now
"last one wins" if the parser sees multiple entries
for the same sequence.

Add a testcase that checks the new replacement semantics.
2021-07-13 22:02:33 -04:00
Matthias Clasen
3b4b1c6878 composetable: Reinterpret %L
When we see include "%L" in a Compose file, use the
builtin sequences. We no longer filter out duplicates
wrt. to the builtin sequences.
2021-07-13 22:02:33 -04:00
Matthias Clasen
ff4f07d76f composetable: Handle substitutions in includes
Hande the %H, %L, %S substitutions that are described
in Compose(7).

Test included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
fb6c8cd466 composetable: Handle includes
This adds the mechanics for parsing include lines in
Compose files. We do detect and prevent cycles.

Tests included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
d25557a5ef Clean up the GtkComposeTable api
Keep the list of composetables private to GtkIMContextSimple,
and just have an api that creates new GtkComposeTables, either
from a file or from data.

Update tests to use the new api.
2021-07-13 22:02:33 -04:00
Matthias Clasen
fab82a7c25 tests: Add some fp16 tests 2021-07-13 09:03:49 -04:00
Marco Trevisan (Treviño)
d5f2b69d0c build: Get typelib dir dynamically using gobject-introspection dependency
We hardcoded the typelib directory for only an arch (and a distro),
while we can just get it from gobject-introspection pkg config if tests
are enabled.
2021-07-08 04:59:10 +02:00
Matthias Clasen
e415f25c8f Add another text history test
Add a tests that checks we group undo actions as expected
when the user is typing.
2021-07-01 18:08:05 -04:00
Matthias Clasen
47bb556327 testsuite: Avoid a compiler warning
This was showing up in ci on macos.
2021-06-17 09:37:45 -04:00
Matthias Clasen
89f57d4ff6 Add a mnemonic testcase
Add a testcase that tests the label mnemonic handling
that was fixed in the previous commit.
2021-06-15 13:32:31 -04:00
Matthias Clasen
007cdf8787 Add tests for empty list models
Test that all our models return NULL for out-of-range
get_item calls, as expected.
2021-06-11 15:38:20 -04:00
Matthias Clasen
98d2320c93 gtk-builder-tool: Replace can-focus with focusable
The focusable property has the meaning that can-focus had
in GTK 3.

Update tests, and mention this in the migration guide.

Fixes: #3638
2021-06-05 17:56:35 -04:00
Matthias Clasen
9993e91add Add GtkFileFilter tests 2021-06-04 21:10:01 -04:00
Matthias Clasen
47400e4bd8 Add a helper to make case-insensitive globs
This will be used in GtkFileFilter in the future.

Tests included.
2021-06-04 21:10:01 -04:00
Matthias Clasen
31407d0a4c Move fnmatch testcases to the testsuite
We have a well-working way to test internal
apis now, lets use it for these tests.
2021-06-03 23:58:50 -04:00
Matthias Clasen
578db92973 Cosmetics: Eradicate gint
Remove a handful of errant uses of gint.
2021-06-03 17:41:28 -04:00
Matthias Clasen
0268c9d642 Add tests for text buffer history
Check that things can be undone.
2021-05-26 14:36:16 -04:00
Matthias Clasen
b2b044ce95 Move text history tests
We can test internal apis in our testsuite now,
so move the text history tests there, to have them
run in ci.
2021-05-26 07:34:28 -04:00
Matthias Clasen
04bac8ef2a testsuite: Run some installed tests exclusively
My suspicion is that the clipboard (and some other)
installed test interferes with others, because the
clipboard is a shared resource.
2021-05-17 07:16:42 -04:00
Matthias Clasen
809299f9e4 Add some more transform tests
Test that gsk_transform_to_affine works.
2021-05-13 19:37:16 -04:00
Emmanuele Bassi
6189e343f3 build: Do not use C arguments with C++
Otherwise the C++ compiler will start to complain.

The C++ keyword test does not need additional warnings.
2021-05-11 12:24:34 +01:00
Matthias Clasen
a3f5283018 Add some calendar tests
Check that the getters and setters work as documented.

This tests the fix in 1f8985e476.
2021-05-07 07:52:11 -04:00