#include // Only use angled for Platform, else, xcode project won't compile #include "../cpp_foundation/XString.h" #include "../cpp_foundation/XStringArray.h" #include "../cpp_foundation/unicode_conversions.h" #include "../Platform/plist/plist.h" #include "../cpp_lib/XmlLiteSimpleTypes.h" #include "../cpp_lib/XmlLiteParser.h" #include "../Settings/ConfigPlist/ConfigPlistClass.h" #ifndef _MSC_VER static const char* config_all = R"V0G0N( ACPI AutoMerge #AutoMerge1 ##AutoMerge2 DSDT Debug Fixes FixDarwin FixDisplay FixS3D Name aa Patches Comment ACPI1 Disabled Find AA== Replace AQ== Comment ACPI2 Disabled Find Ag== Replace Aw== Comment change EHC1 to EH01 Disabled Find RUhDMQ== Replace RUgwMQ== ReuseFFFF Rtc8Allowed SuspendOverride DisableASPM DisabledAML aa bb DropTables Signature SSDT TableId CpuPm HaltEnabler PatchAPIC ResetAddress 01 ResetValue 02 SortedOrder dd cc smartUPS Boot Arguments -v arch=i386 slide=0 dart=0 -xcpm darkwake=1 npci=0x2000 cpus=1 debug=0x100 aa BlackList hh CustomLogo Apple Debug DefaultLoader ii DefaultVolume LastBootedVolume DisableCloverHotkeys HibernationFixup Legacy LegacyBiosDefault LegacyBiosDefaultEntry 12 NeverDoRecovery NeverHibernate NoEarlyProgress Policy Allow Secure SignatureFixup SkipHibernateTimeout StrictHibernate Timeout 2 WhiteList ff gg XMPDetection 1 BootGraphics DefaultBackgroundColor 0xF1F1F1 EFILoginHiDPI 2 UIScale 4 flagstate 3 CPU BusSpeedkHz 800 C2 C4 C6 FrequencyMHz 2000 HWPEnable HWPValue 0x7 Latency 0x3 QEMU QPI 4 TDP 6 TurboDisable Type 0x5 UseARTFrequency Devices AddProperties Device SATA Disabled Key 10 Value 11 Device LPC Disabled Key 12 Value 13 Device SmBUS Disabled Key kk Value ll Device Firewire Disabled Key 14 Value FQ== AirportBridgeDeviceName airportbridge Arbitrary Comment C1 CustomProperties Disabled Key ll Value mm Disabled Key nn Value 1 Disabled Key oo Value Ag== PciAddr 00:00.01 Audio AFGLowPowerState Inject Detect ResetHDA DisableFunctions 2 FakeID ATI 0x22221002 IMEI 0x22221002 IntelGFX 0x22221002 LAN 0x22221002 NVidia 0x22221002 SATA 0x22221002 WIFI 0x22221002 XHCI 0x22221002 ForceHPET Inject IntelMaxValue 1 NoDefaultProperties Properties jj kk SetIntelBacklight SetIntelMaxBacklight USB AddClockID FixOwnership HighCurrent Inject UseIntelHDMI DisableDrivers OsxAptioFixDrv Ps2KeyboardDxe Ps2MouseDxe GUI ConsoleMode Max Custom Entries AddArguments addarg Arguments arg BootBgColor bootbgcolor CustomLogo Apple Disabled DriveImage driveimage Title title FullTitle title Hidden Hotkey H Image image Path path Settings settings SubEntries AddArguments arg2 FullTitle title1 AddArguments arg3 Title title2 AddArguments arg4 FullTitle title3 AddArguments arg5 Title title4 Type Oldest Volume v1 VolumeType Internal Legacy Disabled FullTitle title Hidden Hotkey a Type Windows Volume v2 Tool Arguments b Disabled Hidden Hotkey b Path path Title title Volume tool1 CustomIcons Hide sdfsdfdf sdfsfdf Language es:0 Mouse Enabled Mirror Speed 5 Scan Entries Kernel First Legacy First Linux Tool ScreenResolution 1366x768 ShowOptimus TextOnly Theme th Graphics ATI IOPCIPrimaryMatch 0x1002888 IOPCISubDevId 0x106B LoadVBios Model cc VRAM 2000 VideoPorts 3 BootDisplay 12 DualLink 1 EDID Custom AQID Inject ProductID 0x9777 VendorID 0x1007 FBName Exmoor Inject ATI Intel NVidia LoadVBios NVCAP 0304 NVIDIA IOPCIPrimaryMatch 0x10DE999 IOPCISubDevId 0x106B LoadVBios Model aa VRAM 1000 VideoPorts 1 IOPCIPrimaryMatch 0x10DE999 IOPCISubDevId 0x106B LoadVBios Model bb VRAM 1000 VideoPorts 2 NvidiaGeneric NvidiaNoEFI NvidiaSingle PatchVBios PatchVBiosBytes Find AwQF Replace BgcI VRAM 1500 VideoPorts 2 display-cfg 04 ig-platform-id 0x59230000 KernelAndKextPatches ATIConnectorsController ATICtl ATIConnectorsData 111213 ATIConnectorsPatch 141516 AppleIntelCPUPM AppleRTC BootPatches Comment c3 Disabled Find MTI= MatchBuild 10.12.6 MatchOS 10.12 Replace MzQ= Debug DellSMBIOSPatch FakeCPUID 0x0306D0 ForceKextsToLoad ForceKext KernelLapic KernelPm KernelToPatch Comment c2 Disabled Find ISI= MatchBuild 10.13.6 MatchOS 10.13 Replace IyQ= KernelXCPM KextsToPatch Comment c1 Disabled Find AQ== InfoPlistPatch MatchBuild 10.14.6 MatchOS 10.14 Name k1 Replace Ag== Comment IONVMeFamily IONameMatch Disabled Find PHN0cmluZz5wY2kxNDRkLGE4MDQ8L3N0cmluZz4= InfoPlistPatch Name IONVMeFamily Replace PHN0cmluZz5wY2kxNDRkLGE4MDI8L3N0cmluZz4= RtVariables BooterConfig 0x1 CsrActiveConfig 0x2 MLB 12345678901234567 ROM MBRwYnHo SMBIOS BiosReleaseDate 08/08/17 BiosVendor Apple Inc. BiosVersion MBP81.88Z.004D.B00.1708080655 Board-ID Mac-94245B3640C91C81 BoardManufacturer Apple Inc. BoardSerialNumber W89135306OPDM6CAD BoardType 10 BoardVersion 1.0 ChassisAssetTag MacBook-Aluminum ChassisManufacturer Apple Inc. ChassisType 0x0A Family MacBook Pro FirmwareFeatures 0xC00DE137 FirmwareFeaturesMask 0xFF1FFF3F LocationInChassis Part Component Manufacturer Apple Inc. Memory Channels 2 Modules Frequency 333 Part Part1 Serial Ser1 Size 2048 Slot 1 Type DDR Vendor v1 Frequency 366 Part Part2 Serial Ser2 Size 4096 Slot 2 Type DDR2 Vendor v2 SlotCount 4 Mobile PlatformFeature 0xFFFF ProductName MacBookPro8,1 SerialNumber W89G91VFDH2G Slots Device NVidia ID 1 Name APPL,sdfsdf Type 1 SmUUID F1AB23C0-C35A-473E-BDB7-455C3A6271E8 Version 1.0 SystemParameters BacklightLevel 2 CustomUUID 2926A57C-FF0E-4A64-980F-23483BD41969 InjectKexts Yes InjectSystemID NoCaches NvidiaWeb )V0G0N"; #endif static const char* config_test = R"V0G0N( ACPIx AutoMerge 0 )V0G0N"; #ifndef RETURN_IF_FALSE #define RETURN_IF_FALSE(Expression) do { bool b = Expression; if ( !b ) return false; } while (0); #endif static int breakpoint(int i) { return i; } int config_plist_tests() { #ifndef _MSC_VER (void)config_all; #endif // int ret; // // const char* tag; // size_t length; // bool isOpeningTag, isClosingTag; bool b; ConfigPlistClass configPlistTest; XmlLiteParser xmlLiteParser; // xmlLiteParser.init(config_all, strlen(config_all)); xmlLiteParser.init(config_test, strlen(config_test)); b = configPlistTest.parse(&xmlLiteParser, LString8("main")); for ( size_t idx = 0 ; idx < xmlLiteParser.getXmlParserMessageArray().size() ; idx++ ) { printf("%s\n", xmlLiteParser.getXmlParserMessageArray()[idx].getFormattedMsg().c_str()); } if ( !b ) { return breakpoint(102); } // if ( !configPlistTest.validate(xmlLiteParser, subXmlPath, pos, generateErrors) ) { return 0; }