Commit graph

110 commits

Author SHA1 Message Date
Markus Sauermann
479f359ac4 Add unit test: mouse movement after slider release 2023-06-05 13:51:28 +02:00
Markus Sauermann
a9bf3de08e Fix InputEvent being used twice
A single mouse click can cause multiple actions, which contradicts
the paradigm that a single Input Event should cause only a single
action.

The solution consists of two parts:
1. Physics Picking as the last step during viewport input event
handling, currently doesn't set the event as handled. This PR sets
the event as handled in the case of physics picking.
2. After an InputEvent is processed by a SubVieportContainer, it is
sent to its parent, even if it set as handled within the SubViewport.
This PR adds an additional test to check if the event is handled
before propagating the event to the parent Control.
2023-05-29 02:39:09 +02:00
Silc Renew
42aa5398d9 Fix Pathfollow direction
Co-authored-by: aaronfranke <arnfranke@yahoo.com>
2023-05-24 17:37:00 +09:00
Biggles Bristol
c920a4f051 [Fixed] for "off-by-1" bug when sampling "baked" curve data towards the end of the curve.
[Fixed] Failing test "[Curve] Custom curve with free tangents" by setting the curve's `bake_resolution` to 11.
[Fixed] test messages in "[Curve] Custom curve with free tangents" to match sample offset used in each test
[Added] New test "[Curve] Straight line offset test" in response to pull request feedback.
Update tests/scene/test_curve.h

Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com>
2023-05-20 11:28:09 +01:00
Alex Drozd
cdf9c33c35 add unit tests for Curve3D 2023-05-10 19:12:06 +02:00
RedworkDE
8e7afec479 Fix various errors when running the unit tests
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-05-09 18:40:56 +02:00
Paulb23
0b3fba45c6 Move convert_indent into CodeEdit 2023-05-07 13:08:37 +01:00
Silc Renew
fac8a918f9 Expose interpolation methods for 3D track in Animation class 2023-04-25 01:45:14 +09:00
Manuel Dun
fa7e6ddb83 Fix auto-indentation in typed arrays, comments, and after colon
Now the editor won't add indentation when pressing enter, is
declaring typed variables and there is a colon in the comment

example:
var a:=0#:[press enter]
no indentation
2023-04-20 18:48:21 -04:00
Rémi Verschelde
1e0f7a12f7
Merge pull request #73121 from Scony/add-initial-navi-tests
Add initial navigation tests
2023-03-16 10:46:34 -07:00
Paulb23
60161cbe7d Fix ctrl+backspace crash with multicarets on the same line 2023-02-19 12:04:14 +00:00
Pawel Lampe
e92adba19c Add initial navigation tests 2023-02-13 21:39:09 +01:00
Markus Sauermann
ce6c290528 Add Unit Tests for Viewport InputEvent handling 2023-02-09 14:53:04 +01:00
Markus Sauermann
1b2ba353dc Remove m_object parameter from unit test Macros
This serves no longer any purpose and can be removed.
2023-02-09 00:20:25 +01:00
Markus Sauermann
39d79ce217 Fix mouse-button-mask on button release in unit test
On mouse-button release, the mask is 0.
2023-02-08 01:17:40 +01:00
Rémi Verschelde
e52213e2fa
More codespell fixes, do more changes from previous ignore list 2023-02-01 12:11:36 +01:00
Markus Sauermann
7de1b1a40d [unittests] Send Mouse events via DisplayServer instead of push_input
Currently Unittests simplify mouse-events by just pushing them to Viewports.
For dealing with mouse-screen-coordinates (caused by the introduction of
multiple native Windows) it becomes necessary to extend the
DisplayServer functionality for unittests.

This PR introduces DisplayServerMock based on DisplayServerHeadless,
which additionally supports basic Mouse-Input handling.
2023-01-29 21:29:39 +01:00
Rémi Verschelde
5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
Rémi Verschelde
65883cc73b
Merge pull request #71598 from bruvzg/gdscript_bidi_override
Implement BiDi override mode for GDScript source.
2023-01-19 19:33:18 +01:00
Rémi Verschelde
8b92316368
Merge pull request #71565 from RedworkDE/doc-arraymesh-add-surface
Fix LOD sort order; checks in add_surface; and document all parameters of `ArrayMesh::add_surface_from_arrays`
2023-01-19 19:32:37 +01:00
RedworkDE
be4eb3bbdd Fix LOD sort order; checks in add_surface; and document all parameters of ArrayMesh::add_surface_from_arrays
Also clarify some related documentation and expose the misssing `ArrayFormat::ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY`
2023-01-19 10:30:25 +01:00
bruvzg
5361ec9f43
Implement BiDi override mode for GDScript source. 2023-01-18 19:22:20 +02:00
kobewi
b427d3585c Allow unindent without selection 2023-01-18 17:05:15 +01:00
Rémi Verschelde
517b7fc468
Merge pull request #71308 from hcoura/test-curve-2d
Add unit tests for Curve2D
2023-01-16 09:25:15 +01:00
Paulb23
1aac10d73d Fixed adding extra quote when completing strings 2023-01-14 15:28:22 +00:00
Marius Hanl
d2f246806c Added more node tests
Testing the following functions:
- reparent
- duplicate
- replace_by (also with keeping groups)
2023-01-14 00:23:58 +01:00
Henrique Coura
d9ceddd86b Add unit tests for Curve2D 2023-01-13 13:54:45 -03:00
Rémi Verschelde
6a86dfad29
Fix typos with codespell
Also includes #71080.

Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
2023-01-09 08:39:07 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
Rémi Verschelde
798582acf0
Merge pull request #65609 from dalexeev/animated-sprite
`AnimatedSprite{2D,3D}` improvements
2023-01-05 15:00:31 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Danil Alexeev
0d25d8e7fc
AnimatedSprite{2D,3D} improvements
* Add support for individual frame duration to `SpriteFrames`.
* Various minor improvements.
2023-01-05 13:13:25 +03:00
Rémi Verschelde
5e78f0f782
Merge pull request #70840 from MewPurPur/get-point-count-instead-of-points
Rename `get_points_count()` to `get_point_count()` in Gradient
2023-01-03 15:46:18 +01:00
Marius Hanl
eec42f1aab Add initial tests for Node
- Test simple and complex cases for:
-> add, remove, move, get, find, count, is_inside_tree
-> name, nodepath
-> verify the scene tree
- Simple tests for the processing setup
2023-01-03 07:50:20 +01:00
VolTer
1af833be95 Rename get_points_count() to get_point_count() internally 2023-01-02 16:52:05 +02:00
jainl28patel
e4f4fb580e Add unit test for VisualShader 2022-12-26 16:52:07 +05:30
Paulb23
29f7bea241 Fix autocomplete with autobrace completion not adding closing pair 2022-12-19 14:20:52 +00:00
Hayden Leete
530b1f3f7a Fix autocomplete box placement 2022-12-17 12:33:29 +13:00
Hendrik Brucker
0b07da8ebc [Tests] Get rid of several error messages when running the test suite 2022-12-12 19:17:50 +01:00
Yaohua Xiong
91e9ad92f5 Refactor baking code for Curve2D
The main change is to caculate tangent directly from bezier curve, without going
through discretized polyline, avoiding pitfalls of discretization. A similar refacor
had been applied to Curve3D.

The test cases for Curve2D is updated, comparing floating point with is_equal_approxmiate()
instead of `==`, in order to avoid float precision problem.
2022-12-05 21:22:05 +08:00
Adam Scott
0c64304ba5 Fix error while selecting last empty line 2022-11-23 09:21:41 -05:00
Ninni Pipping
f0099b28b1 Fix polygon generation in BitMap 2022-11-17 10:31:14 +01:00
Rémi Verschelde
f814e15c7f
Merge pull request #67976 from alfredbaudisch/select-next-occurrence-better-test
Improve TextEdit::add_selection_for_next_occurrence test case
2022-11-06 16:10:58 +01:00
Hendrik Brucker
f906ff8f89 [Tests] Replace Math::is_equal_approx with == and doctest::Approx 2022-11-05 02:28:00 +01:00
Rémi Verschelde
18380817f2
Merge pull request #67274 from jbcolli2/Primitive_Tests
Unit Tests for all Primitive Meshes.
2022-11-02 22:37:06 +01:00
Rémi Verschelde
f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Rémi Verschelde
1bff95ad49
Merge pull request #66927 from jbcolli2/Path2d-Tests
Unit tests for Path2D class
2022-11-02 18:53:15 +01:00
Aaron Franke
83634119d4
Replace Quaternion Euler constructor with from_euler method 2022-11-01 09:28:12 -05:00
Rémi Verschelde
1211f9d9b6
Merge pull request #67800 from jbcolli2/ArrayMesh-UnitTests
Unit Tests for ArrayMesh class for Issue #43440
2022-10-31 11:58:28 +01:00
Rémi Verschelde
273410ba5a
Merge pull request #67139 from PucklaMotzer09/insert_caret_at_carets
Add Caret Insert Below and Above shortcuts to TextEdit
2022-10-31 10:32:07 +01:00