使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
7. 测试
与任何其他代码一样,您的沙盒实现应包含测试。沙盒测试的目的不是为了测试程序的正确性,而是为了检查沙盒化程序能否正常运行而不出现沙盒违规等问题。这也可确保沙盒政策正确无误。
对沙盒化程序进行测试的方式与在生产环境中运行该程序的方式相同,即使用其正常处理的参数和输入文件。
这些测试可以很简单,比如使用子进程的 shell 测试或 C++ 测试。查看示例,获取灵感。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-06。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2023-12-06。"],[[["Sandbox tests focus on ensuring the sandboxed program runs smoothly and avoids sandbox violations, not necessarily on program correctness."],["Sandbox testing involves running the program in a production-like environment with typical arguments and input files to assess its behavior within the sandbox."],["Tests can be implemented using various methods, including shell tests or C++ tests using sub-processes, to validate sandbox policy and program execution."]]],[]]