启动时在日志中记录 CPU 信息 (#3914)

This commit is contained in:
Glavo
2025-05-16 14:50:43 +08:00
committed by GitHub
parent 6e05b5ee58
commit 973b7a9716
25 changed files with 1271 additions and 299 deletions

View File

@@ -5,6 +5,7 @@ import org.junit.jupiter.api.Test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.Map;
import static org.jackhuang.hmcl.util.Pair.pair;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -12,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author Glavo
*/
public final class KeyValuePairPropertiesTest {
public final class KeyValuePairUtilsTest {
@Test
public void test() throws IOException {
String content = "#test: key0=value0\n \n" +
@@ -20,7 +21,7 @@ public final class KeyValuePairPropertiesTest {
"key2=\"value2\"\n" +
"key3=\"\\\" \\n\"\n";
KeyValuePairProperties properties = KeyValuePairProperties.load(new BufferedReader(new StringReader(content)));
Map<String, String> properties = KeyValuePairUtils.loadProperties(new BufferedReader(new StringReader(content)));
assertEquals(Lang.mapOf(
pair("key1", "value1"),

View File

@@ -99,15 +99,15 @@ public final class WinRegTest {
}
@Test
public void testQueryKeys() {
public void testQuerySubKeys() {
WinReg.HKEY hkey = WinReg.HKEY.HKEY_CURRENT_USER;
WinReg reg = WinReg.INSTANCE;
assertEquals(Arrays.asList(SUBKEYS).stream().map(it -> key + "\\" + it).collect(Collectors.toList()),
reg.queryKeys(hkey, key).stream().sorted().collect(Collectors.toList()));
reg.querySubKeys(hkey, key).stream().sorted().collect(Collectors.toList()));
for (String subkey : SUBKEYS) {
assertEquals(Collections.emptyList(), reg.queryKeys(hkey, key + "\\" + subkey));
assertEquals(Collections.emptyList(), reg.querySubKeys(hkey, key + "\\" + subkey));
}
assertEquals(Collections.emptyList(), reg.queryKeys(hkey, key + "\\NOT_EXIST"));
assertEquals(Collections.emptyList(), reg.querySubKeys(hkey, key + "\\NOT_EXIST"));
}
}