Skip to content

Commit b15f0ff

Browse files
authored
NR-218026 added Unreal to application platform (#200)
* NR-218026 added Unreal to application platform * Added a test
1 parent b22af29 commit b15f0ff

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Agent/Public/NRConstants.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ extern "C" {
3232
NRMAPlatform_ReactNative,
3333
NRMAPlatform_Flutter,
3434
NRMAPlatform_Capacitor,
35-
NRMAPlatform_MAUI
35+
NRMAPlatform_MAUI,
36+
NRMAPlatform_Unreal
3637
};
3738

3839
// these constants are paired with enum values of NRMAApplicationPlatform
@@ -49,6 +50,7 @@ extern "C" {
4950
#define kNRMAPlatformString_Flutter @"Flutter"
5051
#define kNRMAPlatformString_Capacitor @"Capacitor"
5152
#define kNRMAPlatformString_MAUI @"MAUI"
53+
#define kNRMAPlatformString_Unreal @"Unreal"
5254

5355

5456
//Custom Trace Types

Agent/Utilities/NewRelicInternalUtils.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ + (NSString*) stringFromNRMAApplicationPlatform:(NRMAApplicationPlatform)applica
171171
return kNRMAPlatformString_Capacitor;
172172
case NRMAPlatform_MAUI:
173173
return kNRMAPlatformString_MAUI;
174+
case NRMAPlatform_Unreal:
175+
return kNRMAPlatformString_Unreal;
174176
}
175177
}
176178

Tests/Unit-Tests/NewRelicAgentTests/Harvester-Tests/Harvestable-Data-Tests/NRMADeviceInformationTests.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ - (void) testCorrectness
109109
NRMAApplicationPlatform capacitor = NRMAPlatform_Capacitor;
110110
NSString* capacitorPlatformString = [NewRelicInternalUtils stringFromNRMAApplicationPlatform:capacitor];
111111
XCTAssertTrue([capacitorPlatformString isEqualToString:expectedCapacitorString]);
112+
113+
NSString* expectedUnrealString = @"Unreal";
114+
115+
NRMAApplicationPlatform Unreal = NRMAPlatform_Unreal;
116+
NSString* UnrealPlatformString = [NewRelicInternalUtils stringFromNRMAApplicationPlatform:Unreal];
117+
XCTAssertTrue([UnrealPlatformString isEqualToString:expectedUnrealString]);
112118
}
113119

114120

0 commit comments

Comments
 (0)