Revert a change, add a test.

This commit is contained in:
jief 2020-04-17 16:32:12 +03:00
parent 4faa0aa8a2
commit 1db9b51864
2 changed files with 11 additions and 4 deletions

View File

@ -286,21 +286,28 @@ int printf_lite_tests(void)
Test1arg(F("| C|"), F("|%5X|"), 12);
Test1arg(F("| -12|"), F("|%5hhd|"), (char)-12);
Test1arg(F("| -12|"), F("|%5d|"), (char)-12);
Test1arg(F("| -12|"), F("|%5hd|"), (short)-12);
Test1arg(F("| -12|"), F("|%5d|"), -12);
Test1arg(F("| -12|"), F("|%5ld|"), -12L);
Test1arg(F("| -12|"), F("|%5lld|"), -12LL);
Test1arg(F("| 244|"), F("|%5hhu|"), (char)-12);
Test1arg(F("|4294967284|"), F("|%5u|"), (char)-12);
Test1arg(F("|65524|"), F("|%5hu|"), (short)-12);
Test1arg(F("|4294967284|"), F("|%5u|"), -12);
Test1arg(F("|18446744073709551604|"), F("|%5lu|"), -12L);
Test1arg(F("|18446744073709551604|"), F("|%5llu|"), -12LL);
Test1arg(F("| f4|"), F("|%5hhx|"), (char)-12);
Test1arg(F("|fffffff4|"), F("|%5x|"), (char)-12);
Test1arg(F("| fff4|"), F("|%5hx|"), (short)-12);
Test1arg(F("|fffffff4|"), F("|%5x|"), -12);
Test1arg(F("|fffffffffffffff4|"), F("|%5lx|"), -12L);
Test1arg(F("|fffffffffffffff4|"), F("|%5llx|"), -12LL);
Test1arg(F("|FFFFFFF4|"), F("|%5X|"), -12);
// test pad char but no width (no effect)
Test1arg(F("|c|"), F("|%0x|"), 12);
Test1arg(F("|C|"), F("|%0X|"), 12);

View File

@ -1745,10 +1745,10 @@ VOID SetOEMPath(CONST CHAR16 *ConfName)
OEMPath = PoolPrint(L"%s", L"EFI\\CLOVER");
if (ConfName == NULL) {
DBG ("set OEMPath (ConfName == NULL): %ls\n", OEMPath);
} else if ( nLanCards > 0 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02hhx-%02hhx-%02hhx-%02hhx-%02hhx-%02hhx", gSettings.OEMProduct, gLanMac[0][0], gLanMac[0][1], gLanMac[0][2], gLanMac[0][3], gLanMac[0][4], gLanMac[0][5]), ConfName)) {
} else if ( nLanCards > 1 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02hhx-%02hhx-%02hhx-%02hhx-%02hhx-%02hhx", gSettings.OEMProduct, gLanMac[1][0], gLanMac[1][1], gLanMac[1][2], gLanMac[1][3], gLanMac[1][4], gLanMac[1][5]), ConfName)) {
} else if ( nLanCards > 2 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02hhx-%02hhx-%02hhx-%02hhx-%02hhx-%02hhx", gSettings.OEMProduct, gLanMac[2][0], gLanMac[2][1], gLanMac[2][2], gLanMac[2][3], gLanMac[2][4], gLanMac[2][5]), ConfName)) {
} else if ( nLanCards > 3 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02hhx-%02hhx-%02hhx-%02hhx-%02hhx-%02hhx", gSettings.OEMProduct, gLanMac[3][0], gLanMac[3][1], gLanMac[3][2], gLanMac[3][3], gLanMac[3][4], gLanMac[3][5]), ConfName)) {
} else if ( nLanCards > 0 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[0][0], gLanMac[0][1], gLanMac[0][2], gLanMac[0][3], gLanMac[0][4], gLanMac[0][5]), ConfName)) {
} else if ( nLanCards > 1 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[1][0], gLanMac[1][1], gLanMac[1][2], gLanMac[1][3], gLanMac[1][4], gLanMac[1][5]), ConfName)) {
} else if ( nLanCards > 2 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[2][0], gLanMac[2][1], gLanMac[2][2], gLanMac[2][3], gLanMac[2][4], gLanMac[2][5]), ConfName)) {
} else if ( nLanCards > 3 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[3][0], gLanMac[3][1], gLanMac[3][2], gLanMac[3][3], gLanMac[3][4], gLanMac[3][5]), ConfName)) {
} else if (!gFirmwareClover && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a\\UEFI", gSettings.OEMBoard), ConfName)) {
} else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a", gSettings.OEMProduct), ConfName)) {
} else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a-%d", gSettings.OEMProduct, (INT32)(DivU64x32(gCPUStructure.CPUFrequency, Mega))), ConfName)) {