-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestCLRNetSimple.cs
More file actions
53 lines (45 loc) · 2.14 KB
/
TestCLRNetSimple.cs
File metadata and controls
53 lines (45 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
namespace CLRNetSimpleTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Testing CLRNET Managed Runtime...");
Console.WriteLine("=================================");
try
{
Console.WriteLine("\n1. Testing CLRNetManagedRuntime:");
// Test the CLRNetManagedRuntime directly
bool initialized = BrowserCore.CLRNetManagedRuntime.Initialize();
Console.WriteLine(" - Initialization: " + (initialized ? "SUCCESS" : "FAILED"));
if (initialized)
{
BrowserCore.CLRNetManagedRuntime.OptimizeMemory();
Console.WriteLine(" - Memory optimization completed");
string stats = BrowserCore.CLRNetManagedRuntime.GetPerformanceStats();
Console.WriteLine(" - Performance Stats: " + stats);
bool gpuEnabled = BrowserCore.CLRNetManagedRuntime.EnableGPUAcceleration();
Console.WriteLine(" - GPU Acceleration: " + (gpuEnabled ? "ENABLED" : "DISABLED"));
}
Console.WriteLine("\n=================================");
Console.WriteLine("CLRNET Managed Runtime Test Completed Successfully!");
Console.WriteLine("No BadImageFormatException errors detected.");
Console.WriteLine("Managed CLRNET implementation working correctly.");
}
catch (Exception ex)
{
Console.WriteLine("\nERROR: " + ex.Message);
Console.WriteLine("Type: " + ex.GetType().Name);
if (ex.InnerException != null)
{
Console.WriteLine("Inner: " + ex.InnerException.Message);
}
Console.WriteLine("\nStack Trace:");
Console.WriteLine(ex.StackTrace);
}
Console.WriteLine("\nPress any key to exit...");
Console.ReadKey();
}
}
}