按规划继续工作

结论:补齐浏览器 OPFS 参数备份读回验证,继续通过 vendored LinuxCNC save_parameters 备份路径覆盖持久化边界。
This commit is contained in:
2026-06-08 11:38:12 +08:00
parent 5a350337c4
commit cf8c27404e
2 changed files with 20 additions and 1 deletions

View File

@@ -295,7 +295,8 @@ restore/save behavior through the exported C ABI, including out-of-order file
rejection, missing-file success, missing required numeric parameter defaulting,
required numeric parameter writeback, removal of named-parameter-only lines
from saved output, and the `.bak` backup produced by vendored
`save_parameters()`. It also covers LinuxCNC tool-table
`save_parameters()`, including browser OPFS readback of the backup text after
the host bridge writes it to persistent storage. It also covers LinuxCNC tool-table
load/save behavior through vendored `tooldata_common.cc`, including the
non-random and random-toolchanger `tooldata_init()` branches, with the SDK
only copying text into the Emscripten filesystem and calling the exported C

View File

@@ -15,6 +15,7 @@
saveMachineParametersToOpfs,
} from "../../runtime/opfs/linuxcnc-parameter-bridge.js";
import {
loadTextFile,
saveTextFile,
} from "../../runtime/opfs/file-service.js";
import {
@@ -384,6 +385,23 @@
"absent=<_named_param>",
].join("\n"),
);
if (
savedParameters.backupOpfsPath !==
"linuxcnc/machines/browser-interp/linuxcnc.var.bak"
) {
throw new Error(`unexpected parameter backup path: ${savedParameters.backupOpfsPath}`);
}
verifyExpectedOutput(
"opfs_saved_parameter_backup_text",
await loadTextFile(savedParameters.backupOpfsPath),
[
"5161 10.5",
"5162 20.25",
"5221 2.25",
"5399 44",
"<_named_param> 123",
].join("\n"),
);
const savedToolTable = await saveMachineToolTableToOpfs(
interp,
"browser-interp",