UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UnversionedPropertySerializationTest.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
7#define UE_ENABLE_UNVERSIONED_PROPERTY_TEST WITH_EDITORONLY_DATA
8
16
17#if UE_ENABLE_UNVERSIONED_PROPERTY_TEST
18
20
21// Avoids starting tests recursively when we test serializing nested structs or struct containers.
22// The test is both started from and recursively calls SerializeTaggedProperties().
24{
25 static thread_local bool bTlsTesting;
26 bool bStartedTest = false;
27
29 {
30 bool bTemp;
31 static bool bEnabled = GConfig->GetBool(TEXT("Core.System"), TEXT("TestUnversionedPropertySerializationWhenCooking"), bTemp, GEngineIni) && bTemp;
32
33 if (bEnabled && !bTlsTesting)
34 {
35 bTlsTesting = true;
36 bStartedTest = true;
38 }
39 }
40
42 {
43 if (bStartedTest)
44 {
45 bTlsTesting = false;
46 }
47 }
48};
49
50// Intrusive test helper that records which properties were saved
52{
54
56
58 {
59 if (Out)
60 {
61 Out->Add(Property);
62 }
63 }
64};
65
66#else // !UE_ENABLE_UNVERSIONED_PROPERTY_TEST
67
72
77
78#endif
FString GEngineIni
Definition CoreGlobals.cpp:237
FConfigCacheIni * GConfig
Definition CoreGlobals.cpp:54
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint8_t uint8
Definition binka_ue_file_header.h:8
CORE_API bool GetBool(const TCHAR *Section, const TCHAR *Key, bool &Value, const FString &Filename)
Definition ConfigCacheIni.cpp:5154
Definition UnrealType.h:174
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition Class.h:480
Definition UnversionedPropertySerializationTest.h:74
void RecordSavedProperty(FProperty *Property)
Definition UnversionedPropertySerializationTest.h:75
Definition UnversionedPropertySerializationTest.h:10
uint8 * OriginalInstance
Definition UnversionedPropertySerializationTest.h:12
const uint8 * Defaults
Definition UnversionedPropertySerializationTest.h:14
const UStruct * Struct
Definition UnversionedPropertySerializationTest.h:11
const UStruct * DefaultsStruct
Definition UnversionedPropertySerializationTest.h:13
Definition UnversionedPropertySerializationTest.h:69
FUnversionedPropertyTestRunner(const FUnversionedPropertyTestInput &Input)
Definition UnversionedPropertySerializationTest.h:70