docs+repo: 正式化发布——三份 README 重写为正式版说明、DEVELOPMENT.md 取代交接文档、历史档案统一更名 worklog、全库清理交接字样;脱敏:用户本机路径/设备序列号/内网 Git 地址全部泛化,.tools 本地缓存(13MB,pyc内嵌路径)移出追踪并忽略;123 单测全绿
This commit is contained in:
@@ -91,7 +91,7 @@ class OfficialTempTest {
|
||||
|
||||
@Test
|
||||
fun ddtTailRecordMatchesCapturedDeviceRecord() {
|
||||
// The bundled DDT is the same unit (SN 160043865) the fixture was
|
||||
// The bundled DDT comes from the same calibration unit the fixture was
|
||||
// captured from, so its tail record must reproduce the captured record.
|
||||
val rec = OfficialTemp.parseDdtTail(res("mag160c_official.ddt"))
|
||||
assertNotNull("DDT tail record must parse", rec)
|
||||
@@ -121,7 +121,7 @@ class OfficialTempTest {
|
||||
@Test
|
||||
fun parsesBasePara2AtParameters() {
|
||||
// Ground truth: the 60-byte BasePara2 payload captured from the real
|
||||
// device (SN 160043865). Offsets follow the official app's own wire
|
||||
// device (the calibration unit). Offsets follow the official app's own wire
|
||||
// parse (UsbCommunication.parseCmd, D2P_SendParameter2) minus the
|
||||
// leading magic word, which our reader consumes separately.
|
||||
val captured = "0400000000000000000000000000a306050000000400000008070000fa000000" +
|
||||
|
||||
@@ -134,14 +134,14 @@ class RemoteContractTest {
|
||||
|
||||
@Test
|
||||
fun beaconRoundTrip() {
|
||||
val line = RemoteContract.hostBeacon("Pixel 8 \"test\"", 160043865L)
|
||||
val line = RemoteContract.hostBeacon("Pixel 8 \"test\"", 123456789L)
|
||||
val info = RemoteContract.parseBeacon(line, "192.168.1.23")
|
||||
assertNotNull(info)
|
||||
info!!
|
||||
assertEquals("Pixel 8 \"test\"", info.name)
|
||||
assertEquals("192.168.1.23", info.address)
|
||||
assertEquals(47511, info.tcpPort)
|
||||
assertEquals(160043865L, info.serial)
|
||||
assertEquals(123456789L, info.serial)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -175,13 +175,13 @@ class RemoteContractTest {
|
||||
|
||||
@Test
|
||||
fun welcomeParsing() {
|
||||
val w = RemoteContract.parseWelcome(RemoteContract.welcomeLine(160, 120, 15, 160043865L))
|
||||
val w = RemoteContract.parseWelcome(RemoteContract.welcomeLine(160, 120, 15, 123456789L))
|
||||
assertNotNull(w)
|
||||
w!!
|
||||
assertEquals(160, w.w)
|
||||
assertEquals(120, w.h)
|
||||
assertEquals(15, w.fps)
|
||||
assertEquals(160043865L, w.serial)
|
||||
assertEquals(123456789L, w.serial)
|
||||
assertNull(RemoteContract.parseWelcome(RemoteContract.okLine()))
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class RemoteLoopbackTest {
|
||||
@Test
|
||||
fun hostStreamsFramesToClientOverLoopback() = runBlocking {
|
||||
val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
val host = RemoteHost("jvm-test", 160043865L)
|
||||
val host = RemoteHost("jvm-test", 123456789L)
|
||||
try {
|
||||
host.start()
|
||||
// give the server socket a moment to bind
|
||||
@@ -123,13 +123,13 @@ class RemoteLoopbackTest {
|
||||
|
||||
@Test
|
||||
fun beaconFormatIsWhatTheClientParses() {
|
||||
val line = RemoteContract.hostBeacon("Redmi K70", 160043865L)
|
||||
val line = RemoteContract.hostBeacon("Redmi K70", 123456789L)
|
||||
val info = RemoteContract.parseBeacon(line, "192.168.31.7")
|
||||
assertNotNull(info)
|
||||
assertEquals("Redmi K70", info!!.name)
|
||||
assertEquals("192.168.31.7", info.address)
|
||||
assertEquals(RemoteContract.CONTROL_PORT, info.tcpPort)
|
||||
assertEquals(160043865L, info.serial)
|
||||
assertEquals(123456789L, info.serial)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user