Commit Graph

58 Commits

Author SHA1 Message Date
paul chipchase
2d485a8fe3 Add a test to cover the FChunkedArray iterator bug that was fixed in CL 29283139
#rb Martin.Ridgers
#rnx

- This is a cutdown version of the test that was used to identify the bug from CL 29283139.
- Moved the existing tests for FChunkedArray from "System::Core" to "System::Core::Containers"

[CL 29590591 by paul chipchase in ue5-main branch]
2023-11-09 02:31:55 -05:00
sebastian arleryd
fc71366a4d Add unit test for TMap::TIterator::RemoveCurrent
* Add new low-level unit test file for TMap tests, currently with a single unit test called "System::Core::Containers::TMap::TIterator::RemoveCurrent". This test checks that TMap::TIterator::RemoveCurrent removes the pointed-at pair from the map but that subsequent increments of the iterator do not miss any element.
* Update the documentation comment of TMap::TIterator::RemoveCurrent to point out that the method can be called without interrupting subsequent increments.

#jira UE-183373
#rb Steve.Robb
[FYI] brooke.hubert

[CL 29323829 by sebastian arleryd in ue5-main branch]
2023-11-01 13:31:01 -04:00
nick edwards
4fa4fa8db9 Add IsValidIndex function to TPagedArray for parity with other containers.
#rb Alex.Gratton
#tests Automated tests via preflight passed.

[CL 28932714 by nick edwards in ue5-main branch]
2023-10-19 16:38:54 -04:00
nick edwards
9c37766203 TBitArray:
- Find and FindAndSetFirstZeroBit updated to use FindFromImpl internally, as they perform the same search logic.
- FindAndSetLastZeroBit updated to use FindLast internally, as it performs the same search logic.
- Unit tests added for TestFindLast, TestFindAndSetFirstZeroBit and TestFindAndSetLastZeroBit

#rb Steve.Robb

[CL 26343861 by nick edwards in ue5-main branch]
2023-06-30 10:29:48 -04:00
nick edwards
f80b285963 Rename TBitArray's new FromAfter function to FindFrom. This name is more explicit about the search range being inclusive of the start index.
#rb elias.lozadabenavent

[CL 26146770 by nick edwards in ue5-main branch]
2023-06-21 09:44:29 -04:00
nick edwards
3a48caf4a5 Add FindAfter function to TBitArray, to allow a user to provide a start index when searching for a value.
Added unit tests for TBitArray's Find and FindAfter functions.

#rb Steve.Robb

[CL 26121214 by nick edwards in ue5-main branch]
2023-06-20 09:46:44 -04:00
Andriy Tylychko
ffc69528a9 fixed ExecuteOnGameThread() to support mutable functors
#preflight none

[CL 25768486 by Andriy Tylychko in ue5-main branch]
2023-06-02 14:18:11 -04:00
Andriy Tylychko
3a7b829004 added ExecuteOnGameThread() as a wrapper for FTSTicker::GetCoreTicker()
#preflight 6479cce0f40c6565430e9a61
#rb David.Harvey, Ben.Zeigler

[CL 25762686 by Andriy Tylychko in ue5-main branch]
2023-06-02 11:30:41 -04:00
peter engstrom
b6e6d8fbe6 Loop as few times as possible when adding elements to TChunkedArray.
#preflight 64423985f126d87e45d3e0db
#rb johan.torp

[CL 25174977 by peter engstrom in ue5-main branch]
2023-04-24 22:59:17 -04:00
Andriy Tylychko
fcab86d569 disabling "MPSC correctness" test for concurrent queues as it seems to be broken. also uncommenting some testing code that was accidentally commented in the previous commit
#jira UE-183124
#preflight trivial

[CL 25143473 by Andriy Tylychko in ue5-main branch]
2023-04-21 06:17:33 -04:00
Andriy Tylychko
14b9755333 deprecated TDepletableMpmcQueue as it uses spin-waiting that can cause priority inversion and subsequently deadlock on some platforms. Switched all existing instances to TConsumeAllMpmcQueue
#preflight 643fd2bb73470c177c6fe54d
#rb devin.doucette, francis.hurteau

[CL 25129447 by Andriy Tylychko in ue5-main branch]
2023-04-20 12:17:09 -04:00
nick edwards
abee54aff4 Fix C++20 compile issue. != is automatically defined if == exists in C++20, resulting in new ambiguity in some RingBuffer test code.
could be 'bool FRingBufferTest::Counter::operator ==(const FRingBufferTest::Counter &) const' [rewritten expression '!(x == y)']
or 'built-in C++ operator!=(uint32, uint32)'

#preflight 641840ec5d3e25354ff1393d
#rb none
#jira none

[CL 24716675 by nick edwards in ue5-main branch]
2023-03-20 11:25:52 -04:00
chris constantinescu
b0e2605d0a Nightly Low Level tests must run only slow and performance tests
Additional small quality of life fixes
#rb Jerome.Delattre, Rob.Huyett
#preflight 64120656bd6894c435c1f7c4

[CL 24660566 by chris constantinescu in ue5-main branch]
2023-03-15 15:35:19 -04:00
Michael Galetzka
725fbf78cb Fixed compile errors in test
#jira none
#rb none
#preflight skip

[CL 24636677 by Michael Galetzka in ue5-main branch]
2023-03-14 11:29:24 -04:00
Matt Peters
40d8dc267e TRingBuffer: Add MoveAppendRange to reduce costs from callsites that need to MoveAppend many elements.
#rnx
#rb Steve.Robb
#preflight 64107c6a3c2db40029d99134
#PullRequest 10190
#10190

[CL 24635199 by Matt Peters in ue5-main branch]
2023-03-14 10:25:46 -04:00
devin doucette
672818b928 StringBuilder: Converted WriteToString from a type to a function
This was not possible on C++14 and is possible now due to guaranteed copy elision in C++17.
This will break backward compatibility when WriteToString was used as a type or in a context where it would be copied.

#preflight 640a0460af3fc3529234c216
#rb Matt.Peters

[CL 24583299 by devin doucette in ue5-main branch]
2023-03-09 17:06:55 -05:00
nick edwards
99e9cd0694 Fix DequeTest and PagedArrayTest to use TEST_CASE_NAMED for all tests which previously used it, as well as new tests that have been recently added.
#rb chris.constantinescu
#jira none
#preflight 6409f17cc41a0a2a770b7ef1

[CL 24575701 by nick edwards in ue5-main branch]
2023-03-09 10:02:44 -05:00
nick edwards
dbf7df1ef5 Add missing include to TokenTest.h
#rb trivial
#jira none
#preflight skip

[CL 24573397 by nick edwards in ue5-main branch]
2023-03-09 05:51:20 -05:00
nick edwards
20040f5353 Add serializers for TPagedArray
#rb elias.lozadabenavent, steve.robb
#preflight 6405d349c13b7130d2ca260b, 6408a106aa00423335ab51ec, 6408a727827cf9251b20e1c0

[CL 24562507 by nick edwards in ue5-main branch]
2023-03-08 12:38:22 -05:00
Andriy Tylychko
3e75268230 removed the old FTicker that was deprecated in 5.0
#preflight 6400ac55c63aaf1e136075c5
#rb francis.hurteau
#preflight 640782937348fee37b0ab4c2

[CL 24544720 by Andriy Tylychko in ue5-main branch]
2023-03-07 13:53:21 -05:00
elias lozadabenavent
93e5b49a63 Updated TPagedArray:
* Fixed TPagedArray::Emplace to properly construct the element in the first available page.
* Updated API to match TArray's:
** Added Emplace_GetRef
** Added Add_GetRef
** Emplace now returns the insertion index.
** Add now returns the insertion index.
** Added a Reset overload with a parameter capacity.
** Added an Empty overload with a parameter capacity.
** Updated code to use UE_NODISCARD

* Updated unit tests
** Added Reserve Emplace multiple pages
** Added Emplace variants
** Added Empty with target capacity
** Added Empty vs Reset with target capacity

#tests passed unit tests
#rb steve.robb
#preflight 64072ae5c13b7130d24177d2

[CL 24541998 by elias lozadabenavent in ue5-main branch]
2023-03-07 12:01:43 -05:00
nick edwards
d9d54f3cc6 [Backout] - CL24537645
[FYI] nick.edwards
Original CL Desc
-----------------------------------------------------------------
Cherrypicked CL 23921097: Consistency: TEST_CASE_NAMED for Deque and PagedArray tests

#preflight 63d8608b31334253e538e9e1
#rnx
[FYI] elias.lozadabenavent

#ushell-cherrypick of 23921097 by chris.constantinescu

[CL 24537934 by nick edwards in ue5-main branch]
2023-03-07 06:24:32 -05:00
Mikita Hauruk
61486b8a30 Translated tests which not needed in new macro implementation
Translated Core\Tests\Math\ColorTests.cpp
Translated Core\Tests\Containers\TokenTest.cpp
Translated Core\Tests\Hash\Blake3Test.cpp
Translated Core\Tests\HAL\PlatformStringTests.cpp
Translated 3 files from String directory

#jira UE-176646
#rb adam.miezianko, chris.constantinescu, oleg.krasnov, mikalai.sukhikh
#preflight 6401a0cda20ddf1bf498910b, 6401a0e75515f4f57baf5c6d

[CL 24519078 by Mikita Hauruk in ue5-main branch]
2023-03-06 03:11:25 -05:00
Mikita Hauruk
f8eb728e13 Translated tests which needed in new macro implementation
Translated Core\Tests\Containers\StringViewTest.cpp
Translated all files under Core\Tests\Templates
Translated Core\Tests\Compression\CompressedBufferTest.cpp
Translated two files under Core\Tests\Serialization
Translate all files under Core\Tests\Memory

#jira UE-176646
#rb adam.miezianko, chris.constantinescu, oleg.krasnov, mikalai.sukhikh
#preflight 63fc53a3dd78dd50f65f6c68, 63fc53b32b1a2765f9511939

[CL 24496245 by Mikita Hauruk in ue5-main branch]
2023-03-03 04:24:53 -05:00
chris constantinescu
fd65d87219 TDeque test - potential memory issue when AGGRESSIVE_MEMORY_SAVING=1
#rb Elias.Lozada-Benavente
#preflight skip

[CL 24447474 by chris constantinescu in ue5-main branch]
2023-02-28 14:09:33 -05:00