summaryrefslogtreecommitdiffstats
path: root/main/tests
Commit message (Collapse)AuthorAgeFilesLines
* GDScript: enable type checks on release modeGeorge Marques2020-01-081-0/+24
| | | | | Also make builtin GDScript functions report return type as Variant in release so type is converted when needed.
* Update copyright statements to 2020Rémi Verschelde2020-01-0124-48/+48
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Merge pull request #30556 from kawa-yoiko/astar-directedRémi Verschelde2019-11-071-0/+259
|\ | | | | Improve support for directed graphs in A*; docs update included
| * Add stress test between A* and Floyd-WarshallShiqing2019-09-281-17/+142
| |
| * Reduce memory usage for edges in A* and add testsShiqing2019-09-281-0/+134
| |
* | Implement backward shift deletion for OAHashMapShiqing2019-09-211-0/+13
|/
* allow to reserve space in OAHashMap explicitly and also in AStar.Robin Hübner2019-08-271-0/+19
| | | | * also handle overflow occurring in _get_probe_length
* Remove redundant author doc commentsIAmActuallyCthulhu2019-08-123-11/+0
|
* Merge pull request #31290 from nekomatata/fix-test-regex-disabledRémi Verschelde2019-08-121-0/+5
|\ | | | | Fixed link errors when building in debug with RegEx module disabled
| * Fixed link errors when building in debug with option module_regex_enabled=noPouleyKetchoupp2019-08-111-0/+5
| |
* | Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directoriesMichael Alexsander Silva Dias2019-08-092-16/+4
|/
* Added count method to StringChaosus2019-07-231-0/+39
|
* Implemented local shader arraysChaosus2019-07-151-0/+7
|
* Some code changed with Clang-Tidyqarmin2019-06-263-6/+5
|
* Enforce Unicode encoding in MSVCAndrii Doroshenko (Xrayez)2019-06-191-6/+6
| | | | | | | | | | This can help to solve compilation issues on systems with Japanese locale with encodings like Shift_JIS and UTF-8-BOM. Also be more consistent using String::utf8() to represent cyrilic unicode characters in test_string.cpp Clarified some comments in test_string.cpp for some Unicode characters.
* Add RegEx substitution testcase and fix relevant docsRyan Stein2019-05-111-3/+15
| | | | (cherry picked from commit a31bbb4bd920e28cbb2c737a785e91da5e7a599f)
* Fix `as` operator generating opcode 38 errorsBojidar Marinov2019-04-101-5/+19
| | | | | | | Closes #27489 Fixup of 466a76ac2c7c6634ed1d78fde4ac011e2e70b710 Additionally, update `GDScriptCompiler` test to use Ref and to include `as` expressions.
* Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-1/+2
| | | | | | It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
* Merge pull request #26760 from Xrayez/26744-fix-string-to-lowerRémi Verschelde2019-04-081-0/+14
|\ | | | | Reorder reverse caps characters table for string lower case conversion
| * Reorder reverse caps characters table for string lower case conversionAndrii Doroshenko (Xrayez)2019-04-051-0/+14
| | | | | | | | | | | | | | | | | | The binary search algorithm used to lookup character codes in the table relies that the data must be ordered. This fixes `to_lower()` string method to convert upper case to lower case properly, so that the algorithm doesn't terminate prematurely. Co-authored-by: AndreevAndrei (avandrei) <avandrei@MacBookAAV.local>
* | Fix -Wimplicit-fallthrough warnings from GCC 8Rémi Verschelde2019-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional. Can be replaced by `[[fallthrough]]` if/when we switch to C++17. The warning is now enabled by default for GCC on `extra` warnings level (part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet, but we could enable it manually once we switch to C++11. There's no equivalent feature in MSVC for now. Fixes #26135.
* | Fix duplicated lines in GDScript bytecodeBojidar Marinov2019-03-141-1/+1
|/ | | | Fixes #26789
* Fix -Wsuggest-attribute=format warnings.marxin2019-02-271-1/+1
|
* Don't crash when parse_utf8 receives a NULL pointerHein-Pieter van Braam2019-02-221-0/+8
| | | | | This can happen when chaining calls to various string methods when the string is empty.
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-202-8/+8
| | | | Fixes #25316.
* GDScript: Remove unused `switch`, `case` and `do` CF keywordsRémi Verschelde2019-02-201-3/+0
| | | | | | | | | | | | They had been reserved for future implementation, but we now have the `match` CF keyword which does the same and more. According to @reduz `do` was even added by mistake when copying from the shader language parser, it was never intended to add support for `do`... `while` loops, as the syntax would be awkward in GDScript, and the added sugar is not worth it. Fixes #25787.
* Merge pull request #25481 from hpvb/fix-ubsan-asan-reportsRémi Verschelde2019-02-121-2/+2
|\ | | | | Fix many asan and ubsan reported issues
| * Fix many asan and ubsan reported issuesHein-Pieter van Braam2019-01-301-2/+2
| | | | | | | | | | | | | | | | | | This allows most demos to run without any ubsan or asan errors. There are still some things in thirdpart/ and some things in AudioServer that needs a look but this fixes a lot of issues. This should help debug less obvious issues, hopefully. This fixes #25217 and fixes #25218
* | Be explicit about usage of GDScript testsRémi Verschelde2019-02-104-122/+5
| | | | | | | | | | | | | | Also drop empty "image" test, and print proper error when passing wrong test name. Fixes #25638.
* | [Core] Rename Matrix3 file to BasisAaron Franke2019-02-091-1/+1
|/ | | The code already referred to "Basis", it's just the file name that was different for some reason.
* Fix some errors found by static analysisRémi Verschelde2019-01-161-17/+6
| | | | | Fixes items 10, 16 and 19 from PVS-Studio blog post in #24014.
* Repair String lstrip and rstrip.Ibrahn Sahir2019-01-071-0/+76
| | | | | | | | | | | Background: lstrip and rstrip were broken by changes to String in: 0e29f7974b59e4440cf02e1388fb9d8ab2b5c5fd which removed it's access to Vector::find(CharType). Moved Vector's find up into CowData so it can be shared by Vector and String. Added String::find_char using CowData::find. Implemented rstrip and lstrip using find_char. Added a few tests for String rstrip and lstrip.
* String[size()] should return a default constructed CharTypeHein-Pieter van Braam2019-01-041-0/+28
| | | | | | | | | | | | As per the C++ standard 21.3.4.1 for std::string: Returns: If pos < size(), returns data()[pos]. Otherwise, if pos == size(), the const version returns charT(). Otherwise, the behavior is undefined. Since the behavior is undefined Godot now does the same thing for const and non-const versions of operator[]. This fixes #21242 and fixes #22221.
* Update copyright statements to 2019Rémi Verschelde2019-01-0126-52/+52
| | | | Happy new year to the wonderful Godot community!
* Fix maybe-uninitialized warnings from GCC 4.8.xRémi Verschelde2018-12-171-1/+1
| | | | | | | | | | | | | | | | | Fixes the following warnings in `p=server target=release_debug` builds on Travis CI: ``` ./core/os/memory.h: In function 'MainLoop* TestOAHashMap::test()': ./core/os/memory.h:108:111: warning: 'dummy' may be used uninitialized in this function [-Wmaybe-uninitialized] #define memnew_placement(m_placement, m_class) _post_initialize(new (m_placement, sizeof(m_class), "") m_class) ^ main/tests/test_oa_hash_map.cpp:98:7: note: 'dummy' was declared here int dummy; ^ scene/resources/bit_mask.cpp:447:3: warning: 'next_i' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/resources/bit_mask.cpp:448:4: warning: 'next_j' may be used uninitialized in this function [-Wmaybe-uninitialized] ```
* Tests: Drop old test_io referencing data which isn't includedRémi Verschelde2018-12-053-185/+0
| | | | | | | | This should eventually be rewritten to properly test IO features, but this would be part of a bigger work on adding a proper testing framework for Godot features. Fixes #2454.
* Fix many errors found by PVS-StudioAaron Franke2018-11-281-1/+1
| | | Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15.
* Merge pull request #22548 from fire/visualscript_whitespaceRémi Verschelde2018-10-161-41/+132
|\ | | | | Visualscript search fixes
| * Make visualscript search better.K. S. Ernest (iFire) Lee2018-10-111-41/+132
| | | | | | | | | | | | | | | | | | * There were spaces unequally inside the function definitions. * camelcase_to_underscore() should also work for numbers inside of the camel case. * Removed the builtin concept * Capitalize descriptions from methods too. * Match the visual script functions by removing the empty arguments "( )" * Add some test cases
* | Add testcase whether OAHashMap loses keysFlorian Jung2018-10-111-0/+29
|/ | | | This demonstrates issue #22928.
* Fix GCC 8 warnings about potentially unitialized variablesRémi Verschelde2018-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following GCC 8 warnings: ``` core/image.cpp:730:44: warning: 'mip1_weight' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip2' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip1' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:58:19: warning: 'vmax' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:85:19: warning: 'vmin' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/editor_themes.cpp:306:53: warning: 'preset_contrast' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:459:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:443:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] main/tests/test_oa_hash_map.cpp:57:29: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg.cpp:764:40: warning: 'max_angle' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg_shape.cpp:1945:3: warning: 'face_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1593:8: warning: 'cone_aperture' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1592:6: warning: 'cone_dir_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/animation/animation_blend_space_2d.cpp:471:8: warning: 'mind' may be used uninitialized in this function [-Wmaybe-uninitialized] core/os/memory.cpp:94: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:95: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:98: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ```
* Fix warnings on virtual methods [-Woverloaded-virtual] ↵Rémi Verschelde2018-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | [-Wdelete-non-virtual-dtor] Fixes the following Clang 7 warnings: ``` editor/editor_help.h:123:7: warning: 'EditorHelpIndex::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/editor_help.h:95:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/editor_help.h:96:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/plugins/curve_editor_plugin.h:141:15: warning: 'CurvePreviewGenerator::generate' hides overloaded virtual function [-Woverloaded-virtual] editor/plugins/script_editor_plugin.h:70:7: warning: 'ScriptEditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/quick_open.h:69:7: warning: 'EditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual] main/tests/test_io.cpp:53:15: warning: 'TestIO::TestMainLoop::input_event' hides overloaded virtual function [-Woverloaded-virtual] servers/audio/effects/audio_effect_record.h:69:15: warning: 'AudioEffectRecordInstance::process_silence' hides overloaded virtual function [-Woverloaded-virtual] core/os/memory.h:119:2: warning: destructor called on non-final 'ContextGL_X11' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'EditorScriptCodeCompletionCache' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'Engine' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'PhysicalBone::JointData' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerScene' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerViewport' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] ```
* Fix build after ##21492Rémi Verschelde2018-10-022-5/+6
|
* Merge pull request #21492 from Maykeye/astarRémi Verschelde2018-10-023-0/+164
|\ | | | | Changed A* exit condition, added 2 tests for it
| * Changed A* exit condition, added 2 tests for itMaykeye2018-08-283-0/+164
| | | | | | | | | | | | | | | | | | | | A* now exits when next node from open set with least cost happens to be end_point, not when node with least cost has end_point as a neigbour. Added two tests for astar: * ABC tests case where start and end node are neigbours * ABCX tests case with intermediate nodes
* | Fix various Clang 7 warnings about unused stuffRémi Verschelde2018-10-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Namely: [-Wunneeded-internal-declaration] [-Wunused-comparison] [-Wunused-const-variable] [-Wunused-function] [-Wunused-private-fields] Fixes the following Clang 7 warnings: ``` editor/plugins/script_editor_plugin.cpp:1417:20: warning: function '_find_node_with_script' is not needed and will not be emitted [-Wunneeded-internal-declaration] editor/scene_tree_dock.cpp:1859:14: warning: function '_find_last_visible' is not needed and will not be emitted [-Wunneeded-internal-declaration] modules/gdscript/gdscript_parser.cpp:7838:19: warning: equality comparison result unused [-Wunused-comparison] scene/resources/mesh.cpp:549:35: warning: unused variable '_array_types' [-Wunused-const-variable] scene/resources/mesh.cpp:563:18: warning: unused variable '_format_translate' [-Wunused-const-variable] drivers/gles3/rasterizer_scene_gles3.cpp:54:28: warning: unused function 'store_transform2d' [-Wunused-function] core/io/file_access_network.h:50:6: warning: private field 'ml' is not used [-Wunused-private-field] core/io/file_access_zip.h:93:14: warning: private field 'archive' is not used [-Wunused-private-field] core/io/resource_format_binary.h:122:6: warning: private field 'bin_meta_idx' is not used [-Wunused-private-field] core/message_queue.h:47:9: warning: private field 'mutex' is not used [-Wunused-private-field] main/tests/test_gui.cpp:63:11: warning: private field 'control' is not used [-Wunused-private-field] modules/gdscript/gdscript_parser.h:558:7: warning: private field 'completion_static' is not used [-Wunused-private-field] platform/x11/os_x11.h:148:11: warning: private field 'ip_unix' is not used [-Wunused-private-field] platform/x11/os_x11.h:180:7: warning: private field 'net_wm_icon' is not used [-Wunused-private-field] platform/x11/os_x11.h:189:6: warning: private field 'audio_driver_index' is not used [-Wunused-private-field] platform/x11/os_x11.h:190:15: warning: private field 'capture_idle' is not used [-Wunused-private-field] servers/physics/body_pair_sw.h:79:6: warning: private field 'cc' is not used [-Wunused-private-field] servers/visual/visual_server_raster.h:62:7: warning: private field 'draw_extra_frame' is not used [-Wunused-private-field] ```
* | SCons: Build thirdparty code in own env, disable warningsRémi Verschelde2018-09-281-4/+0
| | | | | | | | | | Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
* | Fix warnings about unhandled enum value in switch [-Wswitch]Rémi Verschelde2018-09-272-0/+6
| | | | | | | | | | | | | | | | | | | | | | Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
* | Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-1/+1
|\ \ | | | | | | Misc. typos
| * | Misc. typosluz.paz2018-09-121-1/+1
| |/ | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`