From 6085045313d7b979d2574abca93de44d03d2ba32 Mon Sep 17 00:00:00 2001 From: wangdequan Date: Mon, 8 Jun 2026 11:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=96=87=E4=BB=B6=E9=94=99=E8=AF=AF=E8=A6=86?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:浏览器解释器 smoke 现在直接通过 LinuxCNC restore_parameters C ABI 验证缺失参数文件成功和乱序参数文件拒绝路径。 --- wasm-port/docs/compatibility-validation.md | 4 +++- wasm-port/tests/browser/interp_smoke.html | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 8b8e3f3..c3e0a82 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -138,6 +138,8 @@ named-parameter file path and negative interpreter fixtures with expected error text plus absent canonical motion output. It also uses real browser OPFS storage plus the interpreter SDK to restore and save a LinuxCNC parameter file through vendored `Interp::restore_parameters()` and `Interp::save_parameters()`, +and directly checks missing-file success plus out-of-order parameter-file +rejection through the same LinuxCNC `restore_parameters()` C ABI, to load/save LinuxCNC tool tables through vendored `tooldata_common.cc`, and to reject invalid INI-derived parameter/tool-table file names through the OPFS path model after the names are parsed by the LinuxCNC-backed INI WASM SDK. It @@ -267,7 +269,7 @@ post-execute position parameters differently than the line-by-line MDI smoke. The same Node WASM and browser file-path smokes also cover the negative fixture group and check the LinuxCNC file-execution error text plus absent canonical motion constraints where applicable. -The Node WASM interpreter smoke also covers LinuxCNC parameter-file +The Node WASM and browser interpreter smokes also cover LinuxCNC parameter-file restore/save behavior through the exported C ABI, including out-of-order file rejection, missing-file success, required numeric parameter writeback, removal of named-parameter-only lines from saved output, and the `.bak` backup produced diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index fac4488..3e65b19 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -202,6 +202,22 @@ namedParamExpectedText, ); + verifyExpectedOutput( + "restore_parameters_missing_file", + interp.restoreParameters("/work/browser-missing.var"), + "restore_parameters=0", + ); + const outOfOrderParameterFilePath = "/work/browser-out-of-order.var"; + interp.writeTextFile(outOfOrderParameterFilePath, "5220 1\n5161 2\n"); + verifyExpectedOutput( + "restore_parameters_out_of_order", + interp.restoreParameters(outOfOrderParameterFilePath), + [ + "restore_parameters=5", + "restore_error_text=Parameter file out of order", + ].join("\n"), + ); + await saveMachineTextFiles("browser-interp", { ini: "[EMC]\nMACHINE = browser-interp\n", toolTable: "T2 P7 Z3.125 D1.5 I12 J34 Q4 ;browser finish tool\n",