2019-12-26 14:45:42 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-10-01 18:20:53 -04:00
2020-10-09 22:42:26 -04:00
# include "Algo/ForEach.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "CoreMinimal.h"
# include "Misc/Guid.h"
# include "Serialization/MemoryWriter.h"
# include "Serialization/MemoryReader.h"
# include "Misc/AutomationTest.h"
# include "Templates/SubclassOf.h"
# include "Backends/JsonStructDeserializerBackend.h"
# include "Backends/JsonStructSerializerBackend.h"
Copying //UE4/Dev-Enterprise to //UE4/Dev-Main (Source: //UE4/Dev-Enterprise @ 4341740)
#lockdown Nick.Penwarden
#rb none
============================
MAJOR FEATURES & CHANGES
============================
Change 4280523 by Patrick.Boutot
Add option in AjaCustomTimeStep to wait until the frame to be ready. Previously, the frame was there but not yet processed so it was possible that it was not ready by the time we wanted to read it. It won't work with interlaced because the 2 fields are processed at the same time. In interlaced, will get a 30fps behaviour when we actually want a 60fps.
Fix bug that didn't set and reset bIsOwned properly when it was first initialized as not owned.
Change 4280526 by Patrick.Boutot
Add accessor to get the leaf media source or output.
Change 4280624 by Patrick.Boutot
Add timecode acessor to media samples
Change 4280626 by Patrick.Boutot
Rework the timing for AJA Media Player. Previously, we took the timing of the frame. That was a bad idea because if 2 incomings video frames were coming a the same time, you would only show one. Making the buffering system useless.
That affects the Custom Time Step since it was waiting for the interrupt signal and in some behavior we would like the frame to be ready to be used by UE. Same the timecode in the MediaSample because we may not used it to stamps the frame.
Change 4283022 by Patrick.Boutot
[EditorScriptingUtilitites] Check folder names invalid characters separatly from the object's name.
#jira UE-59886, UE-62333
Change 4283112 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Rename TimemanagemenetEditor module names.
Change 4283426 by JeanLuc.Corenthin
Fix crash with FBX file
#jira UE-62501
Change 4284940 by Patrick.Boutot
A widget that let you select a single permutation from a list. It groups the values into categories and removes duplicates inside that category.
Change 4285471 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Change 4286925 by Patrick.Boutot
[AJA] Add support to read LTC from the reference In.
Add more detail on video format and the device.
MediaSource use the Permutations Selection widget to select his mode and device.
Remove debugging option to trigger an AJA custom time step and timecode provider.
Remove the UYVY pixel option from AJA. It's better do to the conversion on the AJA card that on the GPU.
Change the tooltip and category for some AjaMediaSource properties.
Change 4287026 by Julien.StJean
Modifed the file STimeCodeProviderTab.cpp to fix the position of a SComboButton that wasn't properly place.
Change 4287663 by Jon.Nabozny
Add timecode messages into nDisplay, and sync those between Master and Slave
Change 4287884 by Jon.Nabozny
Create a TimecodeProvider for SystemTime and introduce a notion for DefaultTimecodeProvider in Engine.
Change 4288050 by Jon.Nabozny
Rework the TimeSynchronization implementation for usability and functionality.
Change 4288283 by Jon.Nabozny
Fixed swapped MetaClass and DisplayName options on UEngine::DefaultTimecodeProviderClassName;
Change 4288352 by Jon.Nabozny
Set TimecodeProviderClassName and DefaultTimecodeProviderClassName in BaseEngine.ini
Change 4288378 by Jon.Nabozny
Fixup some issues in TimecodeSynchronizer where code was reset improperly due to multiple unshelves / resolves.
Change 4288394 by Jon.Nabozny
Add TimeSync functionality into LiveLink. Also add test cases for this. This should allow us to easily synchronize multiple LiveLink sources together, as well as synchronize those to anything else using the sync system (Relies on CL-4235417)
Change 4288899 by Patrick.Boutot
Fix initialization order of FMediaIOCorePlayerBase variables
Change 4289157 by Patrick.Boutot
Allow the user to change the source of a capture without stopping the current capture.
[AJA] AjaMediaCapture, add support for UpdateSceneViewport & UpdateRenderTarget
@made by julien.stjean
Change 4291328 by Jon.Nabozny
Report the Skeleton Guid with TimeSyncData and track sync state in LiveLinkTimeSynchronizationSource.
This prevents a crash that can happen if a source is quickly cleared and reset before the next tick of Time Synchronization.
Change 4296294 by Jon.Nabozny
Fixup errors when TimecodeProviderClassName is empty. It's valid to leave this empty.
Change 4297122 by Patrick.Boutot
Media Profile with timecode provider & custom time step
Change 4301855 by Austin.Crismore
Fix for movment scaling and virtual joystick controls. Movement scaling in for truck and dolly is locked to the world xy plane, and virtual joysticks use their own method for movement scaling now.
#jira UE-61762, UE-62187
Change 4301856 by Austin.Crismore
Virtual sequence level controller now listens to on object spawned, so that it can intercept the camera actor and disable attatching to HMD to prevent camera movement that isn't from the level sequence
#jira UE-61766
Change 4301860 by Austin.Crismore
Fix for touch scrubbing. Added default values back in. Added logic to only allow scrubbing when touch focus was off.
#jira UE-61865
Change 4302294 by Jamie.Dale
Added functions to get your the localized spoken and subtitle text from a dialogue wave
Change 4304393 by Jamie.Dale
Added support for BlueprintAssignable properties in Python
Change 4305852 by Jamie.Dale
Removed hard-dependency between EditorScriptingUtilities and PythonScriptPlugin
Backed-out changelist 4259264 and query Python availability based on whether anything is available to handle the command
#jira UE-62318
Change 4308550 by Jamie.Dale
Fixed crash when passing a null world to Python actor iterators
Change 4311867 by Homam.Bahnassi
Revit master material with exposed parameters matching the API when possible.
Change 4314428 by Francis.Hurteau
Made the usage of the bBuildDeveloperTools switch independent of the bCompileAgainstEngine switch.
Changed bBuildDeveloperTools TargetRule in UnrealBuildTool to a nullable to keep the old behavior in case where bBuildDeveloperTools wasn't explicitly set in TargetRules
Change 4315134 by Jamie.Dale
Defer editable text focus selection until mouse-up to allow the user to make an initial selection
#jira UE-58086
Change 4318615 by Johan.Duparc
EditorFactories: consistent return values after asset import.
Change 4322459 by Jamie.Dale
Made SequencerScripting an Editor plugin as it depends on PythonScriptPlugin which is an Editor plugin
This was causing issues at runtime when SequencerScripting was enabled, as it failed to load PythonScriptPlugin (which hadn't been built).
Change 4323341 by Francis.Hurteau
Implement proper message bus protocol version negociation with static nodes
Change 4323733 by Francis.Hurteau
Fix VR Pausing Sequence Scrubbing just setting playback speed to 0.0
Change 4324319 by Jamie.Dale
Exposed transactions to Blueprints
Change 4325847 by Alistair.White
Copying //Tasks/UE4/Private-PixelStreaming@4325566 to Dev-Enterprise-Minimal (//UE4/Dev-Enterprise-Minimal)
This adds the new experimental PixelStreaming plugin to allow streaming of an Unreal client's audio & video stream to a browser through the WebRTC protocol to support new uses for enterprise customers.
Change 4326282 by Simon.Tourangeau
nDisplay native present handler
Change 4326581 by Jamie.Dale
Replacing FDateTime with int64 Ticks value to workaround UE-63485
Change 4326599 by Homam.Bahnassi
Moving texture coords outside UVEdit function to allow using different UV channels.
Change 4333250 by Francis.Hurteau
Small TFuture changes:
* cleans up TFuture::Then with usage of TUniqueFunction
* added TFuture::Reset to invalidate it and remove continuation from a future shared state
Change 4333359 by Homam.Bahnassi
Support scaling and rotating UVs around arbitrary pivot
Change 4333566 by Johan.Duparc
Expose ProxyLOD functionalities to Scripting
#jira UEENT-1788
Change 4333988 by Jamie.Dale
Allow UHT to parse FText default parameter values
INVTEXT, NSLOCTEXT, LOCTABLE, and FText::GetEmpty() are supported. LOCTEXT isn't as it relies on an external macro that is known to C++ but not to UHT (NSLOCTEXT can easily be used instead).
Change 4335020 by Francis.Hurteau
Uncomment MessageBus::Send deprecation notice for 4.21
Update MessageBus Send usage to new API
Change 4335195 by JeanMichel.Dignard
Add a SetLodFromStaticMesh script utility function
#jira UEENT-1789
Change 4335231 by Anousack.Kitisa
Added functions to generate planar, cylindrical, box UV mapping.
#jira UEENT-1598
Change 4335373 by Jamie.Dale
Cleaned up some places creating empty literal texts
Change 4335458 by Jamie.Dale
Allow UHT to parse FText() as an alias of FText::GetEmpty() when processing default values
Change 4335875 by Max.Chen
Sequencer: Clear RF_Transient on pasted tracks/sections
#jira UE-63537
Change 4336497 by Johan.Duparc
ProxyLOD: Fix progress bar issue
- removed duplicated code
- removed duplicated LongTask object
#jira UEENT-1788
Change 4336723 by Jamie.Dale
Ensure that Python generated types create their CDO at the correct point
#jira UE-62895
Change 4340594 by Ben.Marsh
Fix manifest being invalidated when building two enterprise targets in a row. Fixes CIS error.
#jira UE-63644
[CL 4342443 by JeanMichel Dignard in Main branch]
2018-09-04 16:35:02 -04:00
# include "Backends/CborStructDeserializerBackend.h"
# include "Backends/CborStructSerializerBackend.h"
2014-10-01 18:20:53 -04:00
# include "StructDeserializer.h"
# include "StructSerializer.h"
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# include "Tests/StructSerializerTestTypes.h"
2014-10-01 18:20:53 -04:00
2019-06-07 11:22:52 -04:00
# include "UObject/MetaData.h"
2016-02-01 14:57:29 -05:00
# if WITH_DEV_AUTOMATION_TESTS
2014-10-01 18:20:53 -04:00
/* Internal helpers
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
namespace StructSerializerTest
{
2020-10-09 22:42:26 -04:00
template < typename KeyType , typename ValueType >
void CopyKeys ( TMap < KeyType , ValueType > & OutMap , const TMap < KeyType , ValueType > & SourceMap )
{
OutMap . Empty ( SourceMap . Num ( ) ) ;
Algo : : ForEach ( SourceMap , [ & OutMap ] ( const TPair < KeyType , ValueType > & Other )
{
OutMap . Add ( Other . Key ) ;
} ) ;
}
template < >
void CopyKeys ( TMap < FString , FVector > & OutMap , const TMap < FString , FVector > & SourceMap )
{
OutMap . Empty ( SourceMap . Num ( ) ) ;
Algo : : ForEach ( SourceMap , [ & OutMap ] ( const TPair < FString , FVector > & Other )
{
OutMap . Add ( Other . Key , FVector ( 76.7f ) ) ;
} ) ;
}
template < >
void CopyKeys ( TMap < FString , FStructSerializerBuiltinTestStruct > & OutMap , const TMap < FString , FStructSerializerBuiltinTestStruct > & SourceMap )
{
OutMap . Empty ( SourceMap . Num ( ) ) ;
Algo : : ForEach ( SourceMap , [ & OutMap ] ( const TPair < FString , FStructSerializerBuiltinTestStruct > & Other )
{
OutMap . Add ( Other . Key , { NoInit } ) ;
} ) ;
}
void ValidateNumerics ( FAutomationTestBase & Test , const FStructSerializerNumericTestStruct & Struct1 , const FStructSerializerNumericTestStruct & Struct2 )
{
Test . TestEqual < int8 > ( TEXT ( " Numerics.Int8 value must be the same before and after de-/serialization " ) , Struct1 . Int8 , Struct2 . Int8 ) ;
Test . TestEqual < int16 > ( TEXT ( " Numerics.Int16 value must be the same before and after de-/serialization " ) , Struct1 . Int16 , Struct2 . Int16 ) ;
Test . TestEqual < int32 > ( TEXT ( " Numerics.Int32 value must be the same before and after de-/serialization " ) , Struct1 . Int32 , Struct2 . Int32 ) ;
Test . TestEqual < int64 > ( TEXT ( " Numerics.Int64 value must be the same before and after de-/serialization " ) , Struct1 . Int64 , Struct2 . Int64 ) ;
Test . TestEqual < uint8 > ( TEXT ( " Numerics.UInt8 value must be the same before and after de-/serialization " ) , Struct1 . UInt8 , Struct2 . UInt8 ) ;
Test . TestEqual < uint16 > ( TEXT ( " Numerics.UInt16 value must be the same before and after de-/serialization " ) , Struct1 . UInt16 , Struct2 . UInt16 ) ;
Test . TestEqual < uint32 > ( TEXT ( " Numerics.UInt32 value must be the same before and after de-/serialization " ) , Struct1 . UInt32 , Struct2 . UInt32 ) ;
Test . TestEqual < uint64 > ( TEXT ( " Numerics.UInt64 value must be the same before and after de-/serialization " ) , Struct1 . UInt64 , Struct2 . UInt64 ) ;
Test . TestEqual < float > ( TEXT ( " Numerics.Float value must be the same before and after de-/serialization " ) , Struct1 . Float , Struct2 . Float ) ;
Test . TestEqual < double > ( TEXT ( " Numerics.Double value must be the same before and after de-/serialization " ) , Struct1 . Double , Struct2 . Double ) ;
}
void ValidateBooleans ( FAutomationTestBase & Test , const FStructSerializerBooleanTestStruct & Struct1 , const FStructSerializerBooleanTestStruct & Struct2 )
{
Test . TestEqual < bool > ( TEXT ( " Booleans.BoolFalse must be the same before and after de-/serialization " ) , Struct1 . BoolFalse , Struct2 . BoolFalse ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.BoolTrue must be the same before and after de-/serialization " ) , Struct1 . BoolTrue , Struct2 . BoolTrue ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield0 must be the same before and after de-/serialization " ) , Struct1 . Bitfield0 , Struct2 . Bitfield0 ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield1 must be the same before and after de-/serialization " ) , Struct1 . Bitfield1 , Struct2 . Bitfield1 ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield2Set must be the same before and after de-/serialization " ) , Struct1 . Bitfield2Set , Struct2 . Bitfield2Set ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield3 must be the same before and after de-/serialization " ) , Struct1 . Bitfield3 , Struct2 . Bitfield3 ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield4Set must be the same before and after de-/serialization " ) , Struct1 . Bitfield4Set , Struct2 . Bitfield4Set ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield5Set must be the same before and after de-/serialization " ) , Struct1 . Bitfield5Set , Struct2 . Bitfield5Set ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield6 must be the same before and after de-/serialization " ) , Struct1 . Bitfield6 , Struct2 . Bitfield6 ) ;
Test . TestEqual < bool > ( TEXT ( " Booleans.Bitfield7 must be the same before and after de-/serialization " ) , Struct1 . Bitfield7Set , Struct2 . Bitfield7Set ) ;
}
void ValidateObjects ( FAutomationTestBase & Test , const FStructSerializerObjectTestStruct & Struct1 , const FStructSerializerObjectTestStruct & Struct2 )
{
2021-02-03 12:08:22 -04:00
Test . TestEqual < class UClass * > ( TEXT ( " Objects.RawClass must be the same before and after de-/serialization " ) , Struct1 . RawClass , Struct2 . RawClass ) ;
Test . TestEqual < class UClass * > ( TEXT ( " Objects.WrappedClass must be the same before and after de-/serialization " ) , Struct1 . WrappedClass , Struct2 . WrappedClass ) ;
2020-10-09 22:42:26 -04:00
Test . TestEqual < TSubclassOf < class UMetaData > > ( TEXT ( " Objects.SubClass must be the same before and after de-/serialization " ) , Struct1 . SubClass , Struct2 . SubClass ) ;
Test . TestEqual < TSoftClassPtr < class UMetaData > > ( TEXT ( " Objects.SoftClass must be the same before and after de-/serialization " ) , Struct1 . SoftClass , Struct2 . SoftClass ) ;
2021-02-03 12:08:22 -04:00
Test . TestEqual < UObject * > ( TEXT ( " Objects.RawObject must be the same before and after de-/serialization " ) , Struct1 . RawObject , Struct2 . RawObject ) ;
Test . TestEqual < UObject * > ( TEXT ( " Objects.WrappedObject must be the same before and after de-/serialization " ) , Struct1 . WrappedObject , Struct2 . WrappedObject ) ;
2020-10-09 22:42:26 -04:00
Test . TestEqual < TWeakObjectPtr < class UMetaData > > ( TEXT ( " Objects.WeakObject must be the same before and after de-/serialization " ) , Struct1 . WeakObject , Struct2 . WeakObject ) ;
Test . TestEqual < TSoftObjectPtr < class UMetaData > > ( TEXT ( " Objects.SoftObject must be the same before and after de-/serialization " ) , Struct1 . SoftObject , Struct2 . SoftObject ) ;
Test . TestEqual < FSoftClassPath > ( TEXT ( " Objects.ClassPath must be the same before and after de-/serialization " ) , Struct1 . ClassPath , Struct2 . ClassPath ) ;
Test . TestEqual < FSoftObjectPath > ( TEXT ( " Objects.ObjectPath must be the same before and after de-/serialization " ) , Struct1 . ObjectPath , Struct2 . ObjectPath ) ;
}
void ValidateBuiltIns ( FAutomationTestBase & Test , const FStructSerializerBuiltinTestStruct & Struct1 , const FStructSerializerBuiltinTestStruct & Struct2 )
{
Test . TestEqual < FGuid > ( TEXT ( " Builtins.Guid must be the same before and after de-/serialization " ) , Struct1 . Guid , Struct2 . Guid ) ;
Test . TestEqual < FName > ( TEXT ( " Builtins.Name must be the same before and after de-/serialization " ) , Struct1 . Name , Struct2 . Name ) ;
Test . TestEqual < FString > ( TEXT ( " Builtins.String must be the same before and after de-/serialization " ) , Struct1 . String , Struct2 . String ) ;
Test . TestEqual < FString > ( TEXT ( " Builtins.Text must be the same before and after de-/serialization " ) , Struct1 . Text . ToString ( ) , Struct2 . Text . ToString ( ) ) ;
Test . TestEqual < FVector > ( TEXT ( " Builtins.Vector must be the same before and after de-/serialization " ) , Struct1 . Vector , Struct2 . Vector ) ;
Test . TestEqual < FVector4 > ( TEXT ( " Builtins.Vector4 must be the same before and after de-/serialization " ) , Struct1 . Vector4 , Struct2 . Vector4 ) ;
Test . TestEqual < FRotator > ( TEXT ( " Builtins.Rotator must be the same before and after de-/serialization " ) , Struct1 . Rotator , Struct2 . Rotator ) ;
Test . TestEqual < FQuat > ( TEXT ( " Builtins.Quat must be the same before and after de-/serialization " ) , Struct1 . Quat , Struct2 . Quat ) ;
Test . TestEqual < FColor > ( TEXT ( " Builtins.Color must be the same before and after de-/serialization " ) , Struct1 . Color , Struct2 . Color ) ;
}
void ValidateArrays ( FAutomationTestBase & Test , const FStructSerializerArrayTestStruct & Struct1 , const FStructSerializerArrayTestStruct & Struct2 )
{
Test . TestEqual < TArray < int32 > > ( TEXT ( " Arrays.Int32Array must be the same before and after de-/serialization " ) , Struct1 . Int32Array , Struct2 . Int32Array ) ;
Test . TestEqual < TArray < uint8 > > ( TEXT ( " Arrays.ByteArray must be the same before and after de-/serialization " ) , Struct1 . ByteArray , Struct2 . ByteArray ) ;
Test . TestEqual < int32 > ( TEXT ( " Arrays.StaticSingleElement[0] must be the same before and after de-/serialization " ) , Struct1 . StaticSingleElement [ 0 ] , Struct2 . StaticSingleElement [ 0 ] ) ;
Test . TestEqual < int32 > ( TEXT ( " Arrays.StaticInt32Array[0] must be the same before and after de-/serialization " ) , Struct1 . StaticInt32Array [ 0 ] , Struct2 . StaticInt32Array [ 0 ] ) ;
Test . TestEqual < int32 > ( TEXT ( " Arrays.StaticInt32Array[1] must be the same before and after de-/serialization " ) , Struct1 . StaticInt32Array [ 1 ] , Struct2 . StaticInt32Array [ 1 ] ) ;
Test . TestEqual < int32 > ( TEXT ( " Arrays.StaticInt32Array[2] must be the same before and after de-/serialization " ) , Struct1 . StaticInt32Array [ 2 ] , Struct2 . StaticInt32Array [ 2 ] ) ;
Test . TestEqual < float > ( TEXT ( " Arrays.StaticFloatArray[0] must be the same before and after de-/serialization " ) , Struct1 . StaticFloatArray [ 0 ] , Struct2 . StaticFloatArray [ 0 ] ) ;
Test . TestEqual < float > ( TEXT ( " Arrays.StaticFloatArray[1] must be the same before and after de-/serialization " ) , Struct1 . StaticFloatArray [ 1 ] , Struct2 . StaticFloatArray [ 1 ] ) ;
Test . TestEqual < float > ( TEXT ( " Arrays.StaticFloatArray[2] must be the same before and after de-/serialization " ) , Struct1 . StaticFloatArray [ 2 ] , Struct2 . StaticFloatArray [ 2 ] ) ;
Test . TestEqual < TArray < FVector > > ( TEXT ( " Arrays.VectorArray must be the same before and after de-/serialization " ) , Struct1 . VectorArray , Struct2 . VectorArray ) ;
}
void ValidateMaps ( FAutomationTestBase & Test , const FStructSerializerMapTestStruct & Struct1 , const FStructSerializerMapTestStruct & Struct2 )
{
Test . TestTrue ( TEXT ( " Maps.IntToStr must be the same before and after de-/serialization " ) , Struct1 . IntToStr . OrderIndependentCompareEqual ( Struct2 . IntToStr ) ) ;
Test . TestTrue ( TEXT ( " Maps.StrToStr must be the same before and after de-/serialization " ) , Struct1 . StrToStr . OrderIndependentCompareEqual ( Struct2 . StrToStr ) ) ;
Test . TestTrue ( TEXT ( " Maps.StrToVec must be the same before and after de-/serialization " ) , Struct1 . StrToVec . OrderIndependentCompareEqual ( Struct2 . StrToVec ) ) ;
}
void ValidateSets ( FAutomationTestBase & Test , const FStructSerializerSetTestStruct & Struct1 , const FStructSerializerSetTestStruct & Struct2 )
{
Test . TestTrue ( TEXT ( " Sets.IntSet must be the same before and after de-/serialization " ) , Struct1 . IntSet . Num ( ) = = Struct2 . IntSet . Num ( ) & & Struct1 . IntSet . Difference ( Struct2 . IntSet ) . Num ( ) = = 0 ) ;
Test . TestTrue ( TEXT ( " Sets.StrSet must be the same before and after de-/serialization " ) , Struct1 . StrSet . Num ( ) = = Struct2 . StrSet . Num ( ) & & Struct1 . StrSet . Difference ( Struct2 . StrSet ) . Num ( ) = = 0 ) ;
Test . TestTrue ( TEXT ( " Sets.NameSet must be the same before and after de-/serialization " ) , Struct1 . NameSet . Num ( ) = = Struct2 . NameSet . Num ( ) & & Struct1 . NameSet . Difference ( Struct2 . NameSet ) . Num ( ) = = 0 ) ;
Test . TestTrue ( TEXT ( " Sets.StructSet must be the same before and after de-/serialization " ) , Struct1 . StructSet . Num ( ) = = Struct2 . StructSet . Num ( ) & & Struct1 . StructSet . Difference ( Struct2 . StructSet ) . Num ( ) = = 0 ) ;
}
template < typename TSerializerBackend , typename TDeserializerBackend >
void TestElementSerialization ( FAutomationTestBase & Test )
{
// serialization
FStructSerializerTestStruct OriginalStruct ;
UClass * MetaDataClass = LoadClass < UMetaData > ( nullptr , TEXT ( " /Script/CoreUObject.MetaData " ) ) ;
UMetaData * MetaDataObject = NewObject < UMetaData > ( ) ;
// setup object tests
2021-02-03 12:08:22 -04:00
OriginalStruct . Objects . RawClass = MetaDataClass ;
OriginalStruct . Objects . WrappedClass = MetaDataClass ;
2020-10-09 22:42:26 -04:00
OriginalStruct . Objects . SubClass = MetaDataClass ;
OriginalStruct . Objects . SoftClass = MetaDataClass ;
2021-02-03 12:08:22 -04:00
OriginalStruct . Objects . RawObject = MetaDataObject ;
OriginalStruct . Objects . WrappedObject = MetaDataObject ;
2020-10-09 22:42:26 -04:00
OriginalStruct . Objects . WeakObject = MetaDataObject ;
OriginalStruct . Objects . SoftObject = MetaDataObject ;
OriginalStruct . Objects . ClassPath = MetaDataClass ;
OriginalStruct . Objects . ObjectPath = MetaDataObject ;
{
FStructSerializerPolicies Policies ;
Policies . MapSerialization = EStructSerializerMapPolicies : : Array ;
FStructDeserializerPolicies DeserializerPolicies ;
DeserializerPolicies . MissingFields = EStructDeserializerErrorPolicies : : Warning ;
DeserializerPolicies . MapPolicies = EStructDeserializerMapPolicies : : Array ;
//Numerics
{
FStructSerializerTestStruct TestStruct = OriginalStruct ;
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Numerics ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateNumerics ( Test , TestStruct . Numerics , TestStruct2 . Numerics ) ;
}
//Booleans
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerTestStruct TestStruct = OriginalStruct ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Booleans ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateBooleans ( Test , TestStruct . Booleans , TestStruct2 . Booleans ) ;
}
//Objects
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerTestStruct TestStruct = OriginalStruct ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Objects ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateObjects ( Test , TestStruct . Objects , TestStruct2 . Objects ) ;
}
//Built ins
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerTestStruct TestStruct = OriginalStruct ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Builtins ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateBuiltIns ( Test , TestStruct . Builtins , TestStruct2 . Builtins ) ;
}
//Arrays
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerTestStruct TestStruct = OriginalStruct ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Arrays ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
TestStruct2 . Arrays . Int32Array . SetNumUninitialized ( TestStruct . Arrays . Int32Array . Num ( ) ) ;
TestStruct2 . Arrays . ByteArray . SetNumUninitialized ( TestStruct . Arrays . ByteArray . Num ( ) ) ;
TestStruct2 . Arrays . VectorArray . SetNumUninitialized ( TestStruct . Arrays . VectorArray . Num ( ) ) ;
TestStruct2 . Arrays . StructArray . SetNumZeroed ( TestStruct . Arrays . StructArray . Num ( ) ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateArrays ( Test , TestStruct . Arrays , TestStruct2 . Arrays ) ;
}
//Maps
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerTestStruct TestStruct = OriginalStruct ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Maps ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
CopyKeys ( TestStruct2 . Maps . IntToStr , TestStruct . Maps . IntToStr ) ;
CopyKeys ( TestStruct2 . Maps . StrToStr , TestStruct . Maps . StrToStr ) ;
CopyKeys ( TestStruct2 . Maps . StrToStruct , TestStruct . Maps . StrToStruct ) ;
CopyKeys ( TestStruct2 . Maps . StrToVec , TestStruct . Maps . StrToVec ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateMaps ( Test , TestStruct . Maps , TestStruct2 . Maps ) ;
}
//Sets
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerTestStruct TestStruct = OriginalStruct ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerTestStruct , Sets ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerTestStruct : : StaticStruct ( ) , Member ) ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , INDEX_NONE , SerializerBackend , Policies ) ;
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
TestStruct2 . Sets . IntSet = { - 1 , - 2 , - 3 } ;
TestStruct2 . Sets . NameSet = { TEXT ( " Pre1 " ) , TEXT ( " Pre2 " ) , TEXT ( " Pre3 " ) } ;
TestStruct2 . Sets . StrSet = { TEXT ( " Pre4 " ) , TEXT ( " Pre5 " ) , TEXT ( " Pre6 " ) , TEXT ( " Pre7 " ) } ;
TestStruct2 . Sets . StructSet = { FStructSerializerBuiltinTestStruct ( NoInit ) } ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerTestStruct : : StaticStruct ( ) , INDEX_NONE , DeserializerBackend , DeserializerPolicies ) ) ;
ValidateSets ( Test , TestStruct . Sets , TestStruct2 . Sets ) ;
}
//TArray<uint8> element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerArrayTestStruct TestStruct = OriginalStruct . Arrays ;
FStructSerializerArrayTestStruct TestStruct2 ( NoInit ) ;
TestStruct2 . ByteArray . SetNumUninitialized ( TestStruct . ByteArray . Num ( ) ) ;
TestStruct2 . ByteArray [ 0 ] = 89 ;
TestStruct2 . ByteArray [ 1 ] = 91 ;
TestStruct2 . ByteArray [ 2 ] = 93 ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerArrayTestStruct , ByteArray ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerArrayTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 1 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerArrayTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
Test . TestNotEqual < uint8 > ( TEXT ( " Arrays.ByteArray[0] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . ByteArray [ 0 ] , TestStruct2 . ByteArray [ 0 ] ) ;
Test . TestEqual < uint8 > ( TEXT ( " Arrays.ByteArray[1] must be the same before and after de-/serialization of element 1 " ) , TestStruct . ByteArray [ TestIndex ] , TestStruct2 . ByteArray [ TestIndex ] ) ;
Test . TestNotEqual < uint8 > ( TEXT ( " Arrays.ByteArray[2] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . ByteArray [ 2 ] , TestStruct2 . ByteArray [ 2 ] ) ;
}
//TArray<Struct> element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerArrayTestStruct TestStruct = OriginalStruct . Arrays ;
FStructSerializerArrayTestStruct TestStruct2 ( NoInit ) ;
TestStruct2 . StructArray . SetNumZeroed ( TestStruct . StructArray . Num ( ) ) ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerArrayTestStruct , StructArray ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerArrayTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 1 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerArrayTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
Test . TestFalse ( TEXT ( " Arrays.StructArray[0] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . StructArray [ 0 ] = = TestStruct2 . StructArray [ 0 ] ) ;
ValidateBuiltIns ( Test , TestStruct . StructArray [ TestIndex ] , TestStruct2 . StructArray [ TestIndex ] ) ;
}
//static single element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerArrayTestStruct TestStruct = OriginalStruct . Arrays ;
FStructSerializerArrayTestStruct TestStruct2 ( NoInit ) ;
TestStruct2 . StaticSingleElement [ 0 ] = 998 ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerArrayTestStruct , StaticSingleElement ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerArrayTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 0 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerArrayTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
Test . TestEqual < int32 > ( TEXT ( " Arrays.StaticSingleElement[0] must be the same before and after de-/serialization " ) , TestStruct . StaticSingleElement [ TestIndex ] , TestStruct2 . StaticSingleElement [ TestIndex ] ) ;
}
//static float array element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerArrayTestStruct TestStruct = OriginalStruct . Arrays ;
FStructSerializerArrayTestStruct TestStruct2 ( NoInit ) ;
FMemory : : Memset ( & TestStruct2 . StaticFloatArray , 99 , sizeof ( TestStruct2 . StaticFloatArray ) ) ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerArrayTestStruct , StaticFloatArray ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerArrayTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 1 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerArrayTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
Test . TestNotEqual < int32 > ( TEXT ( " Arrays.StaticFloatArray[0] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . StaticFloatArray [ 0 ] , TestStruct2 . StaticFloatArray [ 0 ] ) ;
Test . TestEqual < int32 > ( TEXT ( " Arrays.StaticFloatArray[1] must be the same before and after de-/serialization " ) , TestStruct . StaticFloatArray [ TestIndex ] , TestStruct2 . StaticFloatArray [ TestIndex ] ) ;
Test . TestNotEqual < int32 > ( TEXT ( " Arrays.StaticFloatArray[2] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . StaticFloatArray [ 2 ] , TestStruct2 . StaticFloatArray [ 2 ] ) ;
}
//TMap<int32, FString> element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerMapTestStruct TestStruct = OriginalStruct . Maps ;
FStructSerializerMapTestStruct TestStruct2 ( NoInit ) ;
CopyKeys ( TestStruct2 . IntToStr , TestStruct . IntToStr ) ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerMapTestStruct , IntToStr ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerMapTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 1 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerMapTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
TArray < int32 > Keys ;
Keys . Reserve ( TestStruct . IntToStr . Num ( ) ) ;
TestStruct . IntToStr . GenerateKeyArray ( Keys ) ;
Test . TestNotEqual < FString > ( TEXT ( " Maps.IntToStr[0] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . IntToStr [ Keys [ 0 ] ] , TestStruct2 . IntToStr [ Keys [ 0 ] ] ) ;
Test . TestEqual < FString > ( TEXT ( " Maps.IntToStr[1] must be the same before and after de-/serialization of element 1 " ) , TestStruct . IntToStr [ Keys [ TestIndex ] ] , TestStruct2 . IntToStr [ Keys [ TestIndex ] ] ) ;
Test . TestNotEqual < FString > ( TEXT ( " Maps.IntToStr[2] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . IntToStr [ Keys [ 2 ] ] , TestStruct2 . IntToStr [ Keys [ 2 ] ] ) ;
}
//TMap<FString, FVector> element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerMapTestStruct TestStruct = OriginalStruct . Maps ;
FStructSerializerMapTestStruct TestStruct2 ( NoInit ) ;
CopyKeys ( TestStruct2 . StrToVec , TestStruct . StrToVec ) ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerMapTestStruct , StrToVec ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerMapTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 1 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerMapTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
TArray < FString > Keys ;
Keys . Reserve ( TestStruct . IntToStr . Num ( ) ) ;
TestStruct . StrToVec . GenerateKeyArray ( Keys ) ;
Test . TestNotEqual < FVector > ( TEXT ( " Maps.StrToVec[0] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . StrToVec [ Keys [ 0 ] ] , TestStruct2 . StrToVec [ Keys [ 0 ] ] ) ;
Test . TestEqual < FVector > ( TEXT ( " Maps.StrToVec[1] must be the same before and after de-/serialization of element 1 " ) , TestStruct . StrToVec [ Keys [ TestIndex ] ] , TestStruct2 . StrToVec [ Keys [ TestIndex ] ] ) ;
Test . TestNotEqual < FVector > ( TEXT ( " Maps.StrToVec[2] must not be the same before and after de-/serialization of element 1 " ) , TestStruct . StrToVec [ Keys [ 2 ] ] , TestStruct2 . StrToVec [ Keys [ 2 ] ] ) ;
}
//TSet<FName> element
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
TSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
TDeserializerBackend DeserializerBackend ( Reader ) ;
FStructSerializerSetTestStruct TestStruct = OriginalStruct . Sets ;
FStructSerializerSetTestStruct TestStruct2 ( NoInit ) ;
TestStruct2 . NameSet = { TEXT ( " Pre1 " ) , TEXT ( " Pre2 " ) , TEXT ( " Pre3 " ) } ;
const FName Member = GET_MEMBER_NAME_CHECKED ( FStructSerializerSetTestStruct , NameSet ) ;
FProperty * Property = FindFProperty < FProperty > ( FStructSerializerSetTestStruct : : StaticStruct ( ) , Member ) ;
constexpr int32 TestIndex = 1 ;
FStructSerializer : : SerializeElement ( & TestStruct , Property , TestIndex , SerializerBackend , Policies ) ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : DeserializeElement ( & TestStruct2 , * FStructSerializerSetTestStruct : : StaticStruct ( ) , TestIndex , DeserializerBackend , DeserializerPolicies ) ) ;
TArray < FName > SetArray1 = TestStruct . NameSet . Array ( ) ;
TArray < FName > SetArray2 = TestStruct2 . NameSet . Array ( ) ;
Test . TestNotEqual < FName > ( TEXT ( " Sets.NameSet[0] must not be the same before and after de-/serialization of element 1 " ) , SetArray1 [ 0 ] , SetArray2 [ 0 ] ) ;
Test . TestEqual < FName > ( TEXT ( " Sets.NameSet[1] must be the same before and after de-/serialization of element 1 " ) , SetArray1 [ TestIndex ] , SetArray2 [ TestIndex ] ) ;
Test . TestNotEqual < FName > ( TEXT ( " Sets.NameSet[2] must not be the same before and after de-/serialization of element 1 " ) , SetArray1 [ 2 ] , SetArray2 [ 2 ] ) ;
}
}
}
2014-10-01 18:20:53 -04:00
void TestSerialization ( FAutomationTestBase & Test , IStructSerializerBackend & SerializerBackend , IStructDeserializerBackend & DeserializerBackend )
{
// serialization
FStructSerializerTestStruct TestStruct ;
2019-06-07 11:22:52 -04:00
UClass * MetaDataClass = LoadClass < UMetaData > ( nullptr , TEXT ( " /Script/CoreUObject.MetaData " ) ) ;
UMetaData * MetaDataObject = NewObject < UMetaData > ( ) ;
// setup object tests
2021-02-03 12:08:22 -04:00
TestStruct . Objects . RawClass = MetaDataClass ;
TestStruct . Objects . WrappedClass = MetaDataClass ;
2019-06-07 11:22:52 -04:00
TestStruct . Objects . SubClass = MetaDataClass ;
TestStruct . Objects . SoftClass = MetaDataClass ;
2021-02-03 12:08:22 -04:00
TestStruct . Objects . RawObject = MetaDataObject ;
TestStruct . Objects . WrappedObject = MetaDataObject ;
2019-06-07 11:22:52 -04:00
TestStruct . Objects . WeakObject = MetaDataObject ;
TestStruct . Objects . SoftObject = MetaDataObject ;
TestStruct . Objects . ClassPath = MetaDataClass ;
TestStruct . Objects . ObjectPath = MetaDataObject ;
2014-10-01 18:20:53 -04:00
{
FStructSerializer : : Serialize ( TestStruct , SerializerBackend ) ;
}
// deserialization
FStructSerializerTestStruct TestStruct2 ( NoInit ) ;
{
FStructDeserializerPolicies Policies ;
Policies . MissingFields = EStructDeserializerErrorPolicies : : Warning ;
Test . TestTrue ( TEXT ( " Deserialization must succeed " ) , FStructDeserializer : : Deserialize ( TestStruct2 , DeserializerBackend , Policies ) ) ;
}
2015-09-09 14:24:58 -04:00
// test numerics
2020-10-09 22:42:26 -04:00
ValidateNumerics ( Test , TestStruct . Numerics , TestStruct2 . Numerics ) ;
2014-10-01 18:20:53 -04:00
2015-09-09 14:24:58 -04:00
// test booleans
2020-10-09 22:42:26 -04:00
ValidateBooleans ( Test , TestStruct . Booleans , TestStruct2 . Booleans ) ;
2015-09-09 14:24:58 -04:00
// test objects
2020-10-09 22:42:26 -04:00
ValidateObjects ( Test , TestStruct . Objects , TestStruct2 . Objects ) ;
2014-10-01 18:20:53 -04:00
2015-09-09 14:24:58 -04:00
// test built-ins
2020-10-09 22:42:26 -04:00
ValidateBuiltIns ( Test , TestStruct . Builtins , TestStruct2 . Builtins ) ;
2019-06-07 11:22:52 -04:00
2015-09-09 14:24:58 -04:00
// test arrays
2020-10-09 22:42:26 -04:00
ValidateArrays ( Test , TestStruct . Arrays , TestStruct2 . Arrays ) ;
2015-09-09 14:24:58 -04:00
// test maps
2020-10-09 22:42:26 -04:00
ValidateMaps ( Test , TestStruct . Maps , TestStruct2 . Maps ) ;
2019-06-07 11:22:52 -04:00
// test sets
2020-10-09 22:42:26 -04:00
ValidateSets ( Test , TestStruct . Sets , TestStruct2 . Sets ) ;
2014-10-01 18:20:53 -04:00
}
}
/* Tests
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Copying //UE4/Dev-Enterprise to //UE4/Dev-Main (Source: //UE4/Dev-Enterprise @ 4341740)
#lockdown Nick.Penwarden
#rb none
============================
MAJOR FEATURES & CHANGES
============================
Change 4280523 by Patrick.Boutot
Add option in AjaCustomTimeStep to wait until the frame to be ready. Previously, the frame was there but not yet processed so it was possible that it was not ready by the time we wanted to read it. It won't work with interlaced because the 2 fields are processed at the same time. In interlaced, will get a 30fps behaviour when we actually want a 60fps.
Fix bug that didn't set and reset bIsOwned properly when it was first initialized as not owned.
Change 4280526 by Patrick.Boutot
Add accessor to get the leaf media source or output.
Change 4280624 by Patrick.Boutot
Add timecode acessor to media samples
Change 4280626 by Patrick.Boutot
Rework the timing for AJA Media Player. Previously, we took the timing of the frame. That was a bad idea because if 2 incomings video frames were coming a the same time, you would only show one. Making the buffering system useless.
That affects the Custom Time Step since it was waiting for the interrupt signal and in some behavior we would like the frame to be ready to be used by UE. Same the timecode in the MediaSample because we may not used it to stamps the frame.
Change 4283022 by Patrick.Boutot
[EditorScriptingUtilitites] Check folder names invalid characters separatly from the object's name.
#jira UE-59886, UE-62333
Change 4283112 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Rename TimemanagemenetEditor module names.
Change 4283426 by JeanLuc.Corenthin
Fix crash with FBX file
#jira UE-62501
Change 4284940 by Patrick.Boutot
A widget that let you select a single permutation from a list. It groups the values into categories and removes duplicates inside that category.
Change 4285471 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Change 4286925 by Patrick.Boutot
[AJA] Add support to read LTC from the reference In.
Add more detail on video format and the device.
MediaSource use the Permutations Selection widget to select his mode and device.
Remove debugging option to trigger an AJA custom time step and timecode provider.
Remove the UYVY pixel option from AJA. It's better do to the conversion on the AJA card that on the GPU.
Change the tooltip and category for some AjaMediaSource properties.
Change 4287026 by Julien.StJean
Modifed the file STimeCodeProviderTab.cpp to fix the position of a SComboButton that wasn't properly place.
Change 4287663 by Jon.Nabozny
Add timecode messages into nDisplay, and sync those between Master and Slave
Change 4287884 by Jon.Nabozny
Create a TimecodeProvider for SystemTime and introduce a notion for DefaultTimecodeProvider in Engine.
Change 4288050 by Jon.Nabozny
Rework the TimeSynchronization implementation for usability and functionality.
Change 4288283 by Jon.Nabozny
Fixed swapped MetaClass and DisplayName options on UEngine::DefaultTimecodeProviderClassName;
Change 4288352 by Jon.Nabozny
Set TimecodeProviderClassName and DefaultTimecodeProviderClassName in BaseEngine.ini
Change 4288378 by Jon.Nabozny
Fixup some issues in TimecodeSynchronizer where code was reset improperly due to multiple unshelves / resolves.
Change 4288394 by Jon.Nabozny
Add TimeSync functionality into LiveLink. Also add test cases for this. This should allow us to easily synchronize multiple LiveLink sources together, as well as synchronize those to anything else using the sync system (Relies on CL-4235417)
Change 4288899 by Patrick.Boutot
Fix initialization order of FMediaIOCorePlayerBase variables
Change 4289157 by Patrick.Boutot
Allow the user to change the source of a capture without stopping the current capture.
[AJA] AjaMediaCapture, add support for UpdateSceneViewport & UpdateRenderTarget
@made by julien.stjean
Change 4291328 by Jon.Nabozny
Report the Skeleton Guid with TimeSyncData and track sync state in LiveLinkTimeSynchronizationSource.
This prevents a crash that can happen if a source is quickly cleared and reset before the next tick of Time Synchronization.
Change 4296294 by Jon.Nabozny
Fixup errors when TimecodeProviderClassName is empty. It's valid to leave this empty.
Change 4297122 by Patrick.Boutot
Media Profile with timecode provider & custom time step
Change 4301855 by Austin.Crismore
Fix for movment scaling and virtual joystick controls. Movement scaling in for truck and dolly is locked to the world xy plane, and virtual joysticks use their own method for movement scaling now.
#jira UE-61762, UE-62187
Change 4301856 by Austin.Crismore
Virtual sequence level controller now listens to on object spawned, so that it can intercept the camera actor and disable attatching to HMD to prevent camera movement that isn't from the level sequence
#jira UE-61766
Change 4301860 by Austin.Crismore
Fix for touch scrubbing. Added default values back in. Added logic to only allow scrubbing when touch focus was off.
#jira UE-61865
Change 4302294 by Jamie.Dale
Added functions to get your the localized spoken and subtitle text from a dialogue wave
Change 4304393 by Jamie.Dale
Added support for BlueprintAssignable properties in Python
Change 4305852 by Jamie.Dale
Removed hard-dependency between EditorScriptingUtilities and PythonScriptPlugin
Backed-out changelist 4259264 and query Python availability based on whether anything is available to handle the command
#jira UE-62318
Change 4308550 by Jamie.Dale
Fixed crash when passing a null world to Python actor iterators
Change 4311867 by Homam.Bahnassi
Revit master material with exposed parameters matching the API when possible.
Change 4314428 by Francis.Hurteau
Made the usage of the bBuildDeveloperTools switch independent of the bCompileAgainstEngine switch.
Changed bBuildDeveloperTools TargetRule in UnrealBuildTool to a nullable to keep the old behavior in case where bBuildDeveloperTools wasn't explicitly set in TargetRules
Change 4315134 by Jamie.Dale
Defer editable text focus selection until mouse-up to allow the user to make an initial selection
#jira UE-58086
Change 4318615 by Johan.Duparc
EditorFactories: consistent return values after asset import.
Change 4322459 by Jamie.Dale
Made SequencerScripting an Editor plugin as it depends on PythonScriptPlugin which is an Editor plugin
This was causing issues at runtime when SequencerScripting was enabled, as it failed to load PythonScriptPlugin (which hadn't been built).
Change 4323341 by Francis.Hurteau
Implement proper message bus protocol version negociation with static nodes
Change 4323733 by Francis.Hurteau
Fix VR Pausing Sequence Scrubbing just setting playback speed to 0.0
Change 4324319 by Jamie.Dale
Exposed transactions to Blueprints
Change 4325847 by Alistair.White
Copying //Tasks/UE4/Private-PixelStreaming@4325566 to Dev-Enterprise-Minimal (//UE4/Dev-Enterprise-Minimal)
This adds the new experimental PixelStreaming plugin to allow streaming of an Unreal client's audio & video stream to a browser through the WebRTC protocol to support new uses for enterprise customers.
Change 4326282 by Simon.Tourangeau
nDisplay native present handler
Change 4326581 by Jamie.Dale
Replacing FDateTime with int64 Ticks value to workaround UE-63485
Change 4326599 by Homam.Bahnassi
Moving texture coords outside UVEdit function to allow using different UV channels.
Change 4333250 by Francis.Hurteau
Small TFuture changes:
* cleans up TFuture::Then with usage of TUniqueFunction
* added TFuture::Reset to invalidate it and remove continuation from a future shared state
Change 4333359 by Homam.Bahnassi
Support scaling and rotating UVs around arbitrary pivot
Change 4333566 by Johan.Duparc
Expose ProxyLOD functionalities to Scripting
#jira UEENT-1788
Change 4333988 by Jamie.Dale
Allow UHT to parse FText default parameter values
INVTEXT, NSLOCTEXT, LOCTABLE, and FText::GetEmpty() are supported. LOCTEXT isn't as it relies on an external macro that is known to C++ but not to UHT (NSLOCTEXT can easily be used instead).
Change 4335020 by Francis.Hurteau
Uncomment MessageBus::Send deprecation notice for 4.21
Update MessageBus Send usage to new API
Change 4335195 by JeanMichel.Dignard
Add a SetLodFromStaticMesh script utility function
#jira UEENT-1789
Change 4335231 by Anousack.Kitisa
Added functions to generate planar, cylindrical, box UV mapping.
#jira UEENT-1598
Change 4335373 by Jamie.Dale
Cleaned up some places creating empty literal texts
Change 4335458 by Jamie.Dale
Allow UHT to parse FText() as an alias of FText::GetEmpty() when processing default values
Change 4335875 by Max.Chen
Sequencer: Clear RF_Transient on pasted tracks/sections
#jira UE-63537
Change 4336497 by Johan.Duparc
ProxyLOD: Fix progress bar issue
- removed duplicated code
- removed duplicated LongTask object
#jira UEENT-1788
Change 4336723 by Jamie.Dale
Ensure that Python generated types create their CDO at the correct point
#jira UE-62895
Change 4340594 by Ben.Marsh
Fix manifest being invalidated when building two enterprise targets in a row. Fixes CIS error.
#jira UE-63644
[CL 4342443 by JeanMichel Dignard in Main branch]
2018-09-04 16:35:02 -04:00
IMPLEMENT_SIMPLE_AUTOMATION_TEST ( FStructSerializerTest , " System.Core.Serialization.StructSerializer " , EAutomationTestFlags : : EditorContext | EAutomationTestFlags : : EngineFilter )
2014-10-01 18:20:53 -04:00
Copying //UE4/Dev-Enterprise to //UE4/Dev-Main (Source: //UE4/Dev-Enterprise @ 4341740)
#lockdown Nick.Penwarden
#rb none
============================
MAJOR FEATURES & CHANGES
============================
Change 4280523 by Patrick.Boutot
Add option in AjaCustomTimeStep to wait until the frame to be ready. Previously, the frame was there but not yet processed so it was possible that it was not ready by the time we wanted to read it. It won't work with interlaced because the 2 fields are processed at the same time. In interlaced, will get a 30fps behaviour when we actually want a 60fps.
Fix bug that didn't set and reset bIsOwned properly when it was first initialized as not owned.
Change 4280526 by Patrick.Boutot
Add accessor to get the leaf media source or output.
Change 4280624 by Patrick.Boutot
Add timecode acessor to media samples
Change 4280626 by Patrick.Boutot
Rework the timing for AJA Media Player. Previously, we took the timing of the frame. That was a bad idea because if 2 incomings video frames were coming a the same time, you would only show one. Making the buffering system useless.
That affects the Custom Time Step since it was waiting for the interrupt signal and in some behavior we would like the frame to be ready to be used by UE. Same the timecode in the MediaSample because we may not used it to stamps the frame.
Change 4283022 by Patrick.Boutot
[EditorScriptingUtilitites] Check folder names invalid characters separatly from the object's name.
#jira UE-59886, UE-62333
Change 4283112 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Rename TimemanagemenetEditor module names.
Change 4283426 by JeanLuc.Corenthin
Fix crash with FBX file
#jira UE-62501
Change 4284940 by Patrick.Boutot
A widget that let you select a single permutation from a list. It groups the values into categories and removes duplicates inside that category.
Change 4285471 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Change 4286925 by Patrick.Boutot
[AJA] Add support to read LTC from the reference In.
Add more detail on video format and the device.
MediaSource use the Permutations Selection widget to select his mode and device.
Remove debugging option to trigger an AJA custom time step and timecode provider.
Remove the UYVY pixel option from AJA. It's better do to the conversion on the AJA card that on the GPU.
Change the tooltip and category for some AjaMediaSource properties.
Change 4287026 by Julien.StJean
Modifed the file STimeCodeProviderTab.cpp to fix the position of a SComboButton that wasn't properly place.
Change 4287663 by Jon.Nabozny
Add timecode messages into nDisplay, and sync those between Master and Slave
Change 4287884 by Jon.Nabozny
Create a TimecodeProvider for SystemTime and introduce a notion for DefaultTimecodeProvider in Engine.
Change 4288050 by Jon.Nabozny
Rework the TimeSynchronization implementation for usability and functionality.
Change 4288283 by Jon.Nabozny
Fixed swapped MetaClass and DisplayName options on UEngine::DefaultTimecodeProviderClassName;
Change 4288352 by Jon.Nabozny
Set TimecodeProviderClassName and DefaultTimecodeProviderClassName in BaseEngine.ini
Change 4288378 by Jon.Nabozny
Fixup some issues in TimecodeSynchronizer where code was reset improperly due to multiple unshelves / resolves.
Change 4288394 by Jon.Nabozny
Add TimeSync functionality into LiveLink. Also add test cases for this. This should allow us to easily synchronize multiple LiveLink sources together, as well as synchronize those to anything else using the sync system (Relies on CL-4235417)
Change 4288899 by Patrick.Boutot
Fix initialization order of FMediaIOCorePlayerBase variables
Change 4289157 by Patrick.Boutot
Allow the user to change the source of a capture without stopping the current capture.
[AJA] AjaMediaCapture, add support for UpdateSceneViewport & UpdateRenderTarget
@made by julien.stjean
Change 4291328 by Jon.Nabozny
Report the Skeleton Guid with TimeSyncData and track sync state in LiveLinkTimeSynchronizationSource.
This prevents a crash that can happen if a source is quickly cleared and reset before the next tick of Time Synchronization.
Change 4296294 by Jon.Nabozny
Fixup errors when TimecodeProviderClassName is empty. It's valid to leave this empty.
Change 4297122 by Patrick.Boutot
Media Profile with timecode provider & custom time step
Change 4301855 by Austin.Crismore
Fix for movment scaling and virtual joystick controls. Movement scaling in for truck and dolly is locked to the world xy plane, and virtual joysticks use their own method for movement scaling now.
#jira UE-61762, UE-62187
Change 4301856 by Austin.Crismore
Virtual sequence level controller now listens to on object spawned, so that it can intercept the camera actor and disable attatching to HMD to prevent camera movement that isn't from the level sequence
#jira UE-61766
Change 4301860 by Austin.Crismore
Fix for touch scrubbing. Added default values back in. Added logic to only allow scrubbing when touch focus was off.
#jira UE-61865
Change 4302294 by Jamie.Dale
Added functions to get your the localized spoken and subtitle text from a dialogue wave
Change 4304393 by Jamie.Dale
Added support for BlueprintAssignable properties in Python
Change 4305852 by Jamie.Dale
Removed hard-dependency between EditorScriptingUtilities and PythonScriptPlugin
Backed-out changelist 4259264 and query Python availability based on whether anything is available to handle the command
#jira UE-62318
Change 4308550 by Jamie.Dale
Fixed crash when passing a null world to Python actor iterators
Change 4311867 by Homam.Bahnassi
Revit master material with exposed parameters matching the API when possible.
Change 4314428 by Francis.Hurteau
Made the usage of the bBuildDeveloperTools switch independent of the bCompileAgainstEngine switch.
Changed bBuildDeveloperTools TargetRule in UnrealBuildTool to a nullable to keep the old behavior in case where bBuildDeveloperTools wasn't explicitly set in TargetRules
Change 4315134 by Jamie.Dale
Defer editable text focus selection until mouse-up to allow the user to make an initial selection
#jira UE-58086
Change 4318615 by Johan.Duparc
EditorFactories: consistent return values after asset import.
Change 4322459 by Jamie.Dale
Made SequencerScripting an Editor plugin as it depends on PythonScriptPlugin which is an Editor plugin
This was causing issues at runtime when SequencerScripting was enabled, as it failed to load PythonScriptPlugin (which hadn't been built).
Change 4323341 by Francis.Hurteau
Implement proper message bus protocol version negociation with static nodes
Change 4323733 by Francis.Hurteau
Fix VR Pausing Sequence Scrubbing just setting playback speed to 0.0
Change 4324319 by Jamie.Dale
Exposed transactions to Blueprints
Change 4325847 by Alistair.White
Copying //Tasks/UE4/Private-PixelStreaming@4325566 to Dev-Enterprise-Minimal (//UE4/Dev-Enterprise-Minimal)
This adds the new experimental PixelStreaming plugin to allow streaming of an Unreal client's audio & video stream to a browser through the WebRTC protocol to support new uses for enterprise customers.
Change 4326282 by Simon.Tourangeau
nDisplay native present handler
Change 4326581 by Jamie.Dale
Replacing FDateTime with int64 Ticks value to workaround UE-63485
Change 4326599 by Homam.Bahnassi
Moving texture coords outside UVEdit function to allow using different UV channels.
Change 4333250 by Francis.Hurteau
Small TFuture changes:
* cleans up TFuture::Then with usage of TUniqueFunction
* added TFuture::Reset to invalidate it and remove continuation from a future shared state
Change 4333359 by Homam.Bahnassi
Support scaling and rotating UVs around arbitrary pivot
Change 4333566 by Johan.Duparc
Expose ProxyLOD functionalities to Scripting
#jira UEENT-1788
Change 4333988 by Jamie.Dale
Allow UHT to parse FText default parameter values
INVTEXT, NSLOCTEXT, LOCTABLE, and FText::GetEmpty() are supported. LOCTEXT isn't as it relies on an external macro that is known to C++ but not to UHT (NSLOCTEXT can easily be used instead).
Change 4335020 by Francis.Hurteau
Uncomment MessageBus::Send deprecation notice for 4.21
Update MessageBus Send usage to new API
Change 4335195 by JeanMichel.Dignard
Add a SetLodFromStaticMesh script utility function
#jira UEENT-1789
Change 4335231 by Anousack.Kitisa
Added functions to generate planar, cylindrical, box UV mapping.
#jira UEENT-1598
Change 4335373 by Jamie.Dale
Cleaned up some places creating empty literal texts
Change 4335458 by Jamie.Dale
Allow UHT to parse FText() as an alias of FText::GetEmpty() when processing default values
Change 4335875 by Max.Chen
Sequencer: Clear RF_Transient on pasted tracks/sections
#jira UE-63537
Change 4336497 by Johan.Duparc
ProxyLOD: Fix progress bar issue
- removed duplicated code
- removed duplicated LongTask object
#jira UEENT-1788
Change 4336723 by Jamie.Dale
Ensure that Python generated types create their CDO at the correct point
#jira UE-62895
Change 4340594 by Ben.Marsh
Fix manifest being invalidated when building two enterprise targets in a row. Fixes CIS error.
#jira UE-63644
[CL 4342443 by JeanMichel Dignard in Main branch]
2018-09-04 16:35:02 -04:00
bool FStructSerializerTest : : RunTest ( const FString & Parameters )
2014-10-01 18:20:53 -04:00
{
2019-01-10 17:26:53 -05:00
const EStructSerializerBackendFlags TestFlags = EStructSerializerBackendFlags : : Default ;
2014-10-01 18:20:53 -04:00
// json
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
2019-01-10 17:26:53 -05:00
FJsonStructSerializerBackend SerializerBackend ( Writer , TestFlags ) ;
2014-10-01 18:20:53 -04:00
FJsonStructDeserializerBackend DeserializerBackend ( Reader ) ;
StructSerializerTest : : TestSerialization ( * this , SerializerBackend , DeserializerBackend ) ;
2014-10-28 20:59:30 -04:00
// uncomment this to look at the serialized data
2019-06-07 11:22:52 -04:00
//GLog->Logf(TEXT("%s"), (TCHAR*)Buffer.GetData());
2014-10-01 18:20:53 -04:00
}
Copying //UE4/Dev-Enterprise to //UE4/Dev-Main (Source: //UE4/Dev-Enterprise @ 4341740)
#lockdown Nick.Penwarden
#rb none
============================
MAJOR FEATURES & CHANGES
============================
Change 4280523 by Patrick.Boutot
Add option in AjaCustomTimeStep to wait until the frame to be ready. Previously, the frame was there but not yet processed so it was possible that it was not ready by the time we wanted to read it. It won't work with interlaced because the 2 fields are processed at the same time. In interlaced, will get a 30fps behaviour when we actually want a 60fps.
Fix bug that didn't set and reset bIsOwned properly when it was first initialized as not owned.
Change 4280526 by Patrick.Boutot
Add accessor to get the leaf media source or output.
Change 4280624 by Patrick.Boutot
Add timecode acessor to media samples
Change 4280626 by Patrick.Boutot
Rework the timing for AJA Media Player. Previously, we took the timing of the frame. That was a bad idea because if 2 incomings video frames were coming a the same time, you would only show one. Making the buffering system useless.
That affects the Custom Time Step since it was waiting for the interrupt signal and in some behavior we would like the frame to be ready to be used by UE. Same the timecode in the MediaSample because we may not used it to stamps the frame.
Change 4283022 by Patrick.Boutot
[EditorScriptingUtilitites] Check folder names invalid characters separatly from the object's name.
#jira UE-59886, UE-62333
Change 4283112 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Rename TimemanagemenetEditor module names.
Change 4283426 by JeanLuc.Corenthin
Fix crash with FBX file
#jira UE-62501
Change 4284940 by Patrick.Boutot
A widget that let you select a single permutation from a list. It groups the values into categories and removes duplicates inside that category.
Change 4285471 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Change 4286925 by Patrick.Boutot
[AJA] Add support to read LTC from the reference In.
Add more detail on video format and the device.
MediaSource use the Permutations Selection widget to select his mode and device.
Remove debugging option to trigger an AJA custom time step and timecode provider.
Remove the UYVY pixel option from AJA. It's better do to the conversion on the AJA card that on the GPU.
Change the tooltip and category for some AjaMediaSource properties.
Change 4287026 by Julien.StJean
Modifed the file STimeCodeProviderTab.cpp to fix the position of a SComboButton that wasn't properly place.
Change 4287663 by Jon.Nabozny
Add timecode messages into nDisplay, and sync those between Master and Slave
Change 4287884 by Jon.Nabozny
Create a TimecodeProvider for SystemTime and introduce a notion for DefaultTimecodeProvider in Engine.
Change 4288050 by Jon.Nabozny
Rework the TimeSynchronization implementation for usability and functionality.
Change 4288283 by Jon.Nabozny
Fixed swapped MetaClass and DisplayName options on UEngine::DefaultTimecodeProviderClassName;
Change 4288352 by Jon.Nabozny
Set TimecodeProviderClassName and DefaultTimecodeProviderClassName in BaseEngine.ini
Change 4288378 by Jon.Nabozny
Fixup some issues in TimecodeSynchronizer where code was reset improperly due to multiple unshelves / resolves.
Change 4288394 by Jon.Nabozny
Add TimeSync functionality into LiveLink. Also add test cases for this. This should allow us to easily synchronize multiple LiveLink sources together, as well as synchronize those to anything else using the sync system (Relies on CL-4235417)
Change 4288899 by Patrick.Boutot
Fix initialization order of FMediaIOCorePlayerBase variables
Change 4289157 by Patrick.Boutot
Allow the user to change the source of a capture without stopping the current capture.
[AJA] AjaMediaCapture, add support for UpdateSceneViewport & UpdateRenderTarget
@made by julien.stjean
Change 4291328 by Jon.Nabozny
Report the Skeleton Guid with TimeSyncData and track sync state in LiveLinkTimeSynchronizationSource.
This prevents a crash that can happen if a source is quickly cleared and reset before the next tick of Time Synchronization.
Change 4296294 by Jon.Nabozny
Fixup errors when TimecodeProviderClassName is empty. It's valid to leave this empty.
Change 4297122 by Patrick.Boutot
Media Profile with timecode provider & custom time step
Change 4301855 by Austin.Crismore
Fix for movment scaling and virtual joystick controls. Movement scaling in for truck and dolly is locked to the world xy plane, and virtual joysticks use their own method for movement scaling now.
#jira UE-61762, UE-62187
Change 4301856 by Austin.Crismore
Virtual sequence level controller now listens to on object spawned, so that it can intercept the camera actor and disable attatching to HMD to prevent camera movement that isn't from the level sequence
#jira UE-61766
Change 4301860 by Austin.Crismore
Fix for touch scrubbing. Added default values back in. Added logic to only allow scrubbing when touch focus was off.
#jira UE-61865
Change 4302294 by Jamie.Dale
Added functions to get your the localized spoken and subtitle text from a dialogue wave
Change 4304393 by Jamie.Dale
Added support for BlueprintAssignable properties in Python
Change 4305852 by Jamie.Dale
Removed hard-dependency between EditorScriptingUtilities and PythonScriptPlugin
Backed-out changelist 4259264 and query Python availability based on whether anything is available to handle the command
#jira UE-62318
Change 4308550 by Jamie.Dale
Fixed crash when passing a null world to Python actor iterators
Change 4311867 by Homam.Bahnassi
Revit master material with exposed parameters matching the API when possible.
Change 4314428 by Francis.Hurteau
Made the usage of the bBuildDeveloperTools switch independent of the bCompileAgainstEngine switch.
Changed bBuildDeveloperTools TargetRule in UnrealBuildTool to a nullable to keep the old behavior in case where bBuildDeveloperTools wasn't explicitly set in TargetRules
Change 4315134 by Jamie.Dale
Defer editable text focus selection until mouse-up to allow the user to make an initial selection
#jira UE-58086
Change 4318615 by Johan.Duparc
EditorFactories: consistent return values after asset import.
Change 4322459 by Jamie.Dale
Made SequencerScripting an Editor plugin as it depends on PythonScriptPlugin which is an Editor plugin
This was causing issues at runtime when SequencerScripting was enabled, as it failed to load PythonScriptPlugin (which hadn't been built).
Change 4323341 by Francis.Hurteau
Implement proper message bus protocol version negociation with static nodes
Change 4323733 by Francis.Hurteau
Fix VR Pausing Sequence Scrubbing just setting playback speed to 0.0
Change 4324319 by Jamie.Dale
Exposed transactions to Blueprints
Change 4325847 by Alistair.White
Copying //Tasks/UE4/Private-PixelStreaming@4325566 to Dev-Enterprise-Minimal (//UE4/Dev-Enterprise-Minimal)
This adds the new experimental PixelStreaming plugin to allow streaming of an Unreal client's audio & video stream to a browser through the WebRTC protocol to support new uses for enterprise customers.
Change 4326282 by Simon.Tourangeau
nDisplay native present handler
Change 4326581 by Jamie.Dale
Replacing FDateTime with int64 Ticks value to workaround UE-63485
Change 4326599 by Homam.Bahnassi
Moving texture coords outside UVEdit function to allow using different UV channels.
Change 4333250 by Francis.Hurteau
Small TFuture changes:
* cleans up TFuture::Then with usage of TUniqueFunction
* added TFuture::Reset to invalidate it and remove continuation from a future shared state
Change 4333359 by Homam.Bahnassi
Support scaling and rotating UVs around arbitrary pivot
Change 4333566 by Johan.Duparc
Expose ProxyLOD functionalities to Scripting
#jira UEENT-1788
Change 4333988 by Jamie.Dale
Allow UHT to parse FText default parameter values
INVTEXT, NSLOCTEXT, LOCTABLE, and FText::GetEmpty() are supported. LOCTEXT isn't as it relies on an external macro that is known to C++ but not to UHT (NSLOCTEXT can easily be used instead).
Change 4335020 by Francis.Hurteau
Uncomment MessageBus::Send deprecation notice for 4.21
Update MessageBus Send usage to new API
Change 4335195 by JeanMichel.Dignard
Add a SetLodFromStaticMesh script utility function
#jira UEENT-1789
Change 4335231 by Anousack.Kitisa
Added functions to generate planar, cylindrical, box UV mapping.
#jira UEENT-1598
Change 4335373 by Jamie.Dale
Cleaned up some places creating empty literal texts
Change 4335458 by Jamie.Dale
Allow UHT to parse FText() as an alias of FText::GetEmpty() when processing default values
Change 4335875 by Max.Chen
Sequencer: Clear RF_Transient on pasted tracks/sections
#jira UE-63537
Change 4336497 by Johan.Duparc
ProxyLOD: Fix progress bar issue
- removed duplicated code
- removed duplicated LongTask object
#jira UEENT-1788
Change 4336723 by Jamie.Dale
Ensure that Python generated types create their CDO at the correct point
#jira UE-62895
Change 4340594 by Ben.Marsh
Fix manifest being invalidated when building two enterprise targets in a row. Fixes CIS error.
#jira UE-63644
[CL 4342443 by JeanMichel Dignard in Main branch]
2018-09-04 16:35:02 -04:00
// cbor
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
2019-01-10 17:26:53 -05:00
FCborStructSerializerBackend SerializerBackend ( Writer , TestFlags ) ;
Copying //UE4/Dev-Enterprise to //UE4/Dev-Main (Source: //UE4/Dev-Enterprise @ 4341740)
#lockdown Nick.Penwarden
#rb none
============================
MAJOR FEATURES & CHANGES
============================
Change 4280523 by Patrick.Boutot
Add option in AjaCustomTimeStep to wait until the frame to be ready. Previously, the frame was there but not yet processed so it was possible that it was not ready by the time we wanted to read it. It won't work with interlaced because the 2 fields are processed at the same time. In interlaced, will get a 30fps behaviour when we actually want a 60fps.
Fix bug that didn't set and reset bIsOwned properly when it was first initialized as not owned.
Change 4280526 by Patrick.Boutot
Add accessor to get the leaf media source or output.
Change 4280624 by Patrick.Boutot
Add timecode acessor to media samples
Change 4280626 by Patrick.Boutot
Rework the timing for AJA Media Player. Previously, we took the timing of the frame. That was a bad idea because if 2 incomings video frames were coming a the same time, you would only show one. Making the buffering system useless.
That affects the Custom Time Step since it was waiting for the interrupt signal and in some behavior we would like the frame to be ready to be used by UE. Same the timecode in the MediaSample because we may not used it to stamps the frame.
Change 4283022 by Patrick.Boutot
[EditorScriptingUtilitites] Check folder names invalid characters separatly from the object's name.
#jira UE-59886, UE-62333
Change 4283112 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Rename TimemanagemenetEditor module names.
Change 4283426 by JeanLuc.Corenthin
Fix crash with FBX file
#jira UE-62501
Change 4284940 by Patrick.Boutot
A widget that let you select a single permutation from a list. It groups the values into categories and removes duplicates inside that category.
Change 4285471 by Patrick.Boutot
Remove MediaFrameworkUtilititesModule dependency to the Settings module at runtime.
Change 4286925 by Patrick.Boutot
[AJA] Add support to read LTC from the reference In.
Add more detail on video format and the device.
MediaSource use the Permutations Selection widget to select his mode and device.
Remove debugging option to trigger an AJA custom time step and timecode provider.
Remove the UYVY pixel option from AJA. It's better do to the conversion on the AJA card that on the GPU.
Change the tooltip and category for some AjaMediaSource properties.
Change 4287026 by Julien.StJean
Modifed the file STimeCodeProviderTab.cpp to fix the position of a SComboButton that wasn't properly place.
Change 4287663 by Jon.Nabozny
Add timecode messages into nDisplay, and sync those between Master and Slave
Change 4287884 by Jon.Nabozny
Create a TimecodeProvider for SystemTime and introduce a notion for DefaultTimecodeProvider in Engine.
Change 4288050 by Jon.Nabozny
Rework the TimeSynchronization implementation for usability and functionality.
Change 4288283 by Jon.Nabozny
Fixed swapped MetaClass and DisplayName options on UEngine::DefaultTimecodeProviderClassName;
Change 4288352 by Jon.Nabozny
Set TimecodeProviderClassName and DefaultTimecodeProviderClassName in BaseEngine.ini
Change 4288378 by Jon.Nabozny
Fixup some issues in TimecodeSynchronizer where code was reset improperly due to multiple unshelves / resolves.
Change 4288394 by Jon.Nabozny
Add TimeSync functionality into LiveLink. Also add test cases for this. This should allow us to easily synchronize multiple LiveLink sources together, as well as synchronize those to anything else using the sync system (Relies on CL-4235417)
Change 4288899 by Patrick.Boutot
Fix initialization order of FMediaIOCorePlayerBase variables
Change 4289157 by Patrick.Boutot
Allow the user to change the source of a capture without stopping the current capture.
[AJA] AjaMediaCapture, add support for UpdateSceneViewport & UpdateRenderTarget
@made by julien.stjean
Change 4291328 by Jon.Nabozny
Report the Skeleton Guid with TimeSyncData and track sync state in LiveLinkTimeSynchronizationSource.
This prevents a crash that can happen if a source is quickly cleared and reset before the next tick of Time Synchronization.
Change 4296294 by Jon.Nabozny
Fixup errors when TimecodeProviderClassName is empty. It's valid to leave this empty.
Change 4297122 by Patrick.Boutot
Media Profile with timecode provider & custom time step
Change 4301855 by Austin.Crismore
Fix for movment scaling and virtual joystick controls. Movement scaling in for truck and dolly is locked to the world xy plane, and virtual joysticks use their own method for movement scaling now.
#jira UE-61762, UE-62187
Change 4301856 by Austin.Crismore
Virtual sequence level controller now listens to on object spawned, so that it can intercept the camera actor and disable attatching to HMD to prevent camera movement that isn't from the level sequence
#jira UE-61766
Change 4301860 by Austin.Crismore
Fix for touch scrubbing. Added default values back in. Added logic to only allow scrubbing when touch focus was off.
#jira UE-61865
Change 4302294 by Jamie.Dale
Added functions to get your the localized spoken and subtitle text from a dialogue wave
Change 4304393 by Jamie.Dale
Added support for BlueprintAssignable properties in Python
Change 4305852 by Jamie.Dale
Removed hard-dependency between EditorScriptingUtilities and PythonScriptPlugin
Backed-out changelist 4259264 and query Python availability based on whether anything is available to handle the command
#jira UE-62318
Change 4308550 by Jamie.Dale
Fixed crash when passing a null world to Python actor iterators
Change 4311867 by Homam.Bahnassi
Revit master material with exposed parameters matching the API when possible.
Change 4314428 by Francis.Hurteau
Made the usage of the bBuildDeveloperTools switch independent of the bCompileAgainstEngine switch.
Changed bBuildDeveloperTools TargetRule in UnrealBuildTool to a nullable to keep the old behavior in case where bBuildDeveloperTools wasn't explicitly set in TargetRules
Change 4315134 by Jamie.Dale
Defer editable text focus selection until mouse-up to allow the user to make an initial selection
#jira UE-58086
Change 4318615 by Johan.Duparc
EditorFactories: consistent return values after asset import.
Change 4322459 by Jamie.Dale
Made SequencerScripting an Editor plugin as it depends on PythonScriptPlugin which is an Editor plugin
This was causing issues at runtime when SequencerScripting was enabled, as it failed to load PythonScriptPlugin (which hadn't been built).
Change 4323341 by Francis.Hurteau
Implement proper message bus protocol version negociation with static nodes
Change 4323733 by Francis.Hurteau
Fix VR Pausing Sequence Scrubbing just setting playback speed to 0.0
Change 4324319 by Jamie.Dale
Exposed transactions to Blueprints
Change 4325847 by Alistair.White
Copying //Tasks/UE4/Private-PixelStreaming@4325566 to Dev-Enterprise-Minimal (//UE4/Dev-Enterprise-Minimal)
This adds the new experimental PixelStreaming plugin to allow streaming of an Unreal client's audio & video stream to a browser through the WebRTC protocol to support new uses for enterprise customers.
Change 4326282 by Simon.Tourangeau
nDisplay native present handler
Change 4326581 by Jamie.Dale
Replacing FDateTime with int64 Ticks value to workaround UE-63485
Change 4326599 by Homam.Bahnassi
Moving texture coords outside UVEdit function to allow using different UV channels.
Change 4333250 by Francis.Hurteau
Small TFuture changes:
* cleans up TFuture::Then with usage of TUniqueFunction
* added TFuture::Reset to invalidate it and remove continuation from a future shared state
Change 4333359 by Homam.Bahnassi
Support scaling and rotating UVs around arbitrary pivot
Change 4333566 by Johan.Duparc
Expose ProxyLOD functionalities to Scripting
#jira UEENT-1788
Change 4333988 by Jamie.Dale
Allow UHT to parse FText default parameter values
INVTEXT, NSLOCTEXT, LOCTABLE, and FText::GetEmpty() are supported. LOCTEXT isn't as it relies on an external macro that is known to C++ but not to UHT (NSLOCTEXT can easily be used instead).
Change 4335020 by Francis.Hurteau
Uncomment MessageBus::Send deprecation notice for 4.21
Update MessageBus Send usage to new API
Change 4335195 by JeanMichel.Dignard
Add a SetLodFromStaticMesh script utility function
#jira UEENT-1789
Change 4335231 by Anousack.Kitisa
Added functions to generate planar, cylindrical, box UV mapping.
#jira UEENT-1598
Change 4335373 by Jamie.Dale
Cleaned up some places creating empty literal texts
Change 4335458 by Jamie.Dale
Allow UHT to parse FText() as an alias of FText::GetEmpty() when processing default values
Change 4335875 by Max.Chen
Sequencer: Clear RF_Transient on pasted tracks/sections
#jira UE-63537
Change 4336497 by Johan.Duparc
ProxyLOD: Fix progress bar issue
- removed duplicated code
- removed duplicated LongTask object
#jira UEENT-1788
Change 4336723 by Jamie.Dale
Ensure that Python generated types create their CDO at the correct point
#jira UE-62895
Change 4340594 by Ben.Marsh
Fix manifest being invalidated when building two enterprise targets in a row. Fixes CIS error.
#jira UE-63644
[CL 4342443 by JeanMichel Dignard in Main branch]
2018-09-04 16:35:02 -04:00
FCborStructDeserializerBackend DeserializerBackend ( Reader ) ;
StructSerializerTest : : TestSerialization ( * this , SerializerBackend , DeserializerBackend ) ;
}
2020-01-29 18:45:15 -05:00
// cbor standard compliant endianness (big endian)
{
TArray < uint8 > Buffer ;
FMemoryReader Reader ( Buffer ) ;
FMemoryWriter Writer ( Buffer ) ;
FCborStructSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default | EStructSerializerBackendFlags : : WriteCborStandardEndianness ) ;
FCborStructDeserializerBackend DeserializerBackend ( Reader , ECborEndianness : : StandardCompliant ) ;
StructSerializerTest : : TestSerialization ( * this , SerializerBackend , DeserializerBackend ) ;
}
2014-10-01 18:20:53 -04:00
return true ;
}
2016-02-01 14:57:29 -05:00
2020-10-09 22:42:26 -04:00
IMPLEMENT_SIMPLE_AUTOMATION_TEST ( FStructElementSerializerTest , " System.Core.Serialization.StructElementSerializer " , EAutomationTestFlags : : EditorContext | EAutomationTestFlags : : EngineFilter )
bool FStructElementSerializerTest : : RunTest ( const FString & Parameters )
{
//Element de/serialization for both types of backend
{
StructSerializerTest : : TestElementSerialization < FJsonStructSerializerBackend , FJsonStructDeserializerBackend > ( * this ) ;
StructSerializerTest : : TestElementSerialization < FCborStructSerializerBackend , FCborStructDeserializerBackend > ( * this ) ;
}
return true ;
}
2019-11-20 13:14:21 -05:00
IMPLEMENT_SIMPLE_AUTOMATION_TEST ( FStructSerializerCborByteArrayTest , " System.Core.Serialization.StructSerializerCborByteArray " , EAutomationTestFlags : : EditorContext | EAutomationTestFlags : : EngineFilter )
bool FStructSerializerCborByteArrayTest : : RunTest ( const FString & Parameters )
{
// Ensure TArray<uint8>/TArray<int8> are written as CBOR byte string (~2x more compact) by default rather than a CBOR array.
{
static_assert ( ( EStructSerializerBackendFlags : : Default & EStructSerializerBackendFlags : : WriteByteArrayAsByteStream ) = = EStructSerializerBackendFlags : : WriteByteArrayAsByteStream , " Test below expects 'EStructSerializerBackendFlags::Default' to contain 'EStructSerializerBackendFlags::WriteByteArrayAsByteStream' " ) ;
// Serialization
TArray < uint8 > Buffer ;
FMemoryWriter Writer ( Buffer ) ;
FCborStructSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
FStructSerializerByteArray WrittenStruct ;
FStructSerializer : : Serialize ( WrittenStruct , SerializerBackend ) ;
TestTrue ( TEXT ( " Arrays of int8/uint8 must be encoded in byte string (compact) " ) , Buffer . Num ( ) = = 54 ) ; // Copy the 54 bytes from VC++ Memory viewer to CBOR playground http://cbor.me/ to validate the count/content.
// Deserialization
FMemoryReader Reader ( Buffer ) ;
FCborStructDeserializerBackend DeserializerBackend ( Reader ) ;
FStructDeserializerPolicies Policies ;
Policies . MissingFields = EStructDeserializerErrorPolicies : : Warning ;
FStructSerializerByteArray ReadStruct ( NoInit ) ;
FStructDeserializer : : Deserialize ( ReadStruct , DeserializerBackend , Policies ) ;
TestTrue ( TEXT ( " Value before TArray<uint8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy1 = = 1 ) ;
TestTrue ( TEXT ( " Value after TArray<uint8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy2 = = 2 ) ;
TestTrue ( TEXT ( " Value after TArray<int8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy3 = = 3 ) ;
TestTrue ( TEXT ( " Array uint8 must be the same before and after de-/serialization " ) , WrittenStruct . ByteArray = = ReadStruct . ByteArray ) ;
TestTrue ( TEXT ( " Array int8 must be the same before and after de-/serialization " ) , WrittenStruct . Int8Array = = ReadStruct . Int8Array ) ;
}
// Ensure TArray<uint8>/TArray<int8> encoded in CBOR byte string are skipped on deserialization if required by the policy.
{
// Serialization
TArray < uint8 > Buffer ;
FMemoryWriter Writer ( Buffer ) ;
FCborStructSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
FStructSerializerByteArray WrittenStruct ;
FStructSerializer : : Serialize ( WrittenStruct , SerializerBackend ) ;
// Deserialization
FMemoryReader Reader ( Buffer ) ;
FCborStructDeserializerBackend DeserializerBackend ( Reader ) ;
// Skip the array properties named "ByteArray" and "Int8Array".
FStructDeserializerPolicies Policies ;
2020-01-08 13:26:18 -05:00
Policies . PropertyFilter = [ ] ( const FProperty * CurrentProp , const FProperty * ParentProp )
2019-11-20 13:14:21 -05:00
{
const bool bFilteredOut = ( CurrentProp - > GetFName ( ) = = FName ( TEXT ( " ByteArray " ) ) | | CurrentProp - > GetFName ( ) = = FName ( TEXT ( " Int8Array " ) ) ) ;
return ! bFilteredOut ;
} ;
Policies . MissingFields = EStructDeserializerErrorPolicies : : Warning ;
FStructSerializerByteArray ReadStruct ( NoInit ) ;
FStructDeserializer : : Deserialize ( ReadStruct , DeserializerBackend , Policies ) ;
TestTrue ( TEXT ( " Per deserializer policy, value before TArray<uint8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy1 = = 1 ) ;
TestTrue ( TEXT ( " Per deserializer policy, value after TArray<uint8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy2 = = 2 ) ;
TestTrue ( TEXT ( " Per deserializer policy, value after TArray<int8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy3 = = 3 ) ;
TestTrue ( TEXT ( " Per deserializer policy, TArray<uint8> must be skipped on deserialization " ) , ReadStruct . ByteArray . Num ( ) = = 0 ) ;
TestTrue ( TEXT ( " Per deserializer policy, TArray<int8> must be skipped on deserialization " ) , ReadStruct . Int8Array . Num ( ) = = 0 ) ;
}
// Ensure empty TArray<uint8>/TArray<int8> are written as zero-length CBOR byte string.
{
// Serialization
TArray < uint8 > Buffer ;
FMemoryWriter Writer ( Buffer ) ;
FCborStructSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Default ) ;
FStructSerializerByteArray WrittenStruct ( NoInit ) ; // Keep the TArray<> empty.
WrittenStruct . Dummy1 = 1 ;
WrittenStruct . Dummy2 = 2 ;
WrittenStruct . Dummy3 = 3 ;
FStructSerializer : : Serialize ( WrittenStruct , SerializerBackend ) ;
TestTrue ( TEXT ( " Arrays of int8/uint8 must be encoded in byte string (compact) " ) , Buffer . Num ( ) = = 48 ) ; // Copy the 48 bytes from VC++ Memory viewer to CBOR playground http://cbor.me/ to validate the count/content.
// Deserialization
FMemoryReader Reader ( Buffer ) ;
FCborStructDeserializerBackend DeserializerBackend ( Reader ) ;
FStructDeserializerPolicies Policies ;
Policies . MissingFields = EStructDeserializerErrorPolicies : : Warning ;
FStructSerializerByteArray ReadStruct ( NoInit ) ;
FStructDeserializer : : Deserialize ( ReadStruct , DeserializerBackend , Policies ) ;
TestTrue ( TEXT ( " Value before TArray<uint8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy1 = = 1 ) ;
TestTrue ( TEXT ( " Value after TArray<uint8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy2 = = 2 ) ;
TestTrue ( TEXT ( " Value after TArray<int8> must be the same before and after de-/serialization. " ) , ReadStruct . Dummy3 = = 3 ) ;
TestTrue ( TEXT ( " Array uint8 must be the same before and after de-/serialization " ) , WrittenStruct . ByteArray = = ReadStruct . ByteArray ) ;
TestTrue ( TEXT ( " Array int8 must be the same before and after de-/serialization " ) , WrittenStruct . Int8Array = = ReadStruct . Int8Array ) ;
}
// Ensure TArray<uint8>/TArray<int8> CBOR serialization is backward compatible. (Serializer can write the old format and deserializer can read it)
{
static_assert ( ( EStructSerializerBackendFlags : : Legacy & EStructSerializerBackendFlags : : WriteByteArrayAsByteStream ) = = EStructSerializerBackendFlags : : None , " Test below expects 'EStructSerializerBackendFlags::Legacy' to not have 'EStructSerializerBackendFlags::WriteByteArrayAsByteStream' " ) ;
// Serialize TArray<uint8>/TArray<int8> it they were prior 4.25. (CBOR array rather than CBOR byte string)
TArray < uint8 > Buffer ;
FMemoryWriter Writer ( Buffer ) ;
FCborStructSerializerBackend SerializerBackend ( Writer , EStructSerializerBackendFlags : : Legacy ) ; // Legacy mode doesn't enable EStructSerializerBackendFlags::WriteByteArrayAsByteStream.
FStructSerializerByteArray WrittenStruct ;
FStructSerializer : : Serialize ( WrittenStruct , SerializerBackend ) ;
TestTrue ( TEXT ( " Backward compatibility: Serialized size check " ) , Buffer . Num ( ) = = 60 ) ; // Copy the 60 bytes from VC++ Memory viewer to CBOR playground http://cbor.me/ to validate the count/content.
// Deserialize TArray<uint8>/TArray<int8> as they were prior 4.25.
FMemoryReader Reader ( Buffer ) ;
FCborStructDeserializerBackend DeserializerBackend ( Reader ) ;
FStructDeserializerPolicies Policies ;
Policies . MissingFields = EStructDeserializerErrorPolicies : : Warning ;
FStructSerializerByteArray ReadStruct ( NoInit ) ;
FStructDeserializer : : Deserialize ( ReadStruct , DeserializerBackend , Policies ) ;
TestTrue ( TEXT ( " Backward compatibility: Integer must be the same before and after de-/serialization. " ) , ReadStruct . Dummy1 = = 1 ) ;
TestTrue ( TEXT ( " Backward compatibility: Integer must be the same before and after de-/serialization. " ) , ReadStruct . Dummy2 = = 2 ) ;
TestTrue ( TEXT ( " Backward compatibility: Integer must be the same before and after de-/serialization. " ) , ReadStruct . Dummy3 = = 3 ) ;
TestTrue ( TEXT ( " Backward compatibility: TArray<uint8> must be readable as CBOR array of number. " ) , WrittenStruct . ByteArray = = ReadStruct . ByteArray ) ;
TestTrue ( TEXT ( " Backward compatibility: TArray<int8> must be readable as CBOR array of number. " ) , WrittenStruct . Int8Array = = ReadStruct . Int8Array ) ;
}
return true ;
}
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
# endif //WITH_DEV_AUTOMATION_TESTS