Files
breeze/tests/device_info_behavior.zi
T
waozi f2f1233ac9 Include app version, device and system in Lumi reports
Lumi feedback context now carries the Inner Breeze version, platform,
system version, device model and installed package (Android system
properties, Linux os-release and DMI names), with no identifiers or user
data, so the developer can see whether a newer release already fixes a
report. The confirmation card says what is included, in every locale.
2026-10-10 12:06:10 -03:00

26 lines
1.3 KiB
Ziran

// Lumi reports name the device, system and version; never identifiers.
#import "c_string"
#import "byte_text_linux"
#import, file "../src/core/device_info.zi";
#import, file "../src/core/version.zi";
Fail :: (message: string) -> s32 { print("FAIL %\n", message); return 1 }
Check :: () -> s32 {
if DeviceReleaseName("NAME=Debian\nPRETTY_NAME=\"Debian GNU/Linux 13 (trixie)\"\nID=debian\n") != "Debian GNU/Linux 13 (trixie)" { return Fail("os-release name") }
if DeviceReleaseName("ID=arch\n") != "" { return Fail("missing os-release name") }
if !DeviceStartsWithFold("Google Pixel 3a", "google") || DeviceStartsWithFold("Pixel", "Google") { return Fail("maker prefix") }
details: DeviceDetails
DeviceDescribe(*details)
if DevicePlatform() != "linux" || DeviceSystem(*details).count == 0 { return Fail("desktop system") }
for byte: DeviceModel(*details) { if byte < cast(u8)32 { return Fail("control byte in device") } }
clipped: [8]u8
size: s32 = 0
DeviceAppend(clipped[:], *size, "a\nbcdefghijk")
if TextFromBytes(clipped[:size]) != "abcdefg" { return Fail("bounded printable append") }
print("device: % · % · %\n", DeviceModel(*details), DeviceSystem(*details), VersionString)
return 0
}
Main :: () -> s32 { return Check() }