[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69BKFBK0EN21QYM79JV7W3H":3,"skill-same:01M69BKFBK0EN21QYM79JV7W3H":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":17,"ownerHtmlUrl":46,"ownerBlogUrl":47,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M69BKFBK0EN21QYM79JV7W3H","c-testing","C 语言测试编写与运行","Write, build, and run C tests for the VoxelPic library. USE FOR: adding new C test cases, understanding the test data format, debugging test failures, or running the existing C test suite.","为 VoxelPic 库编写、构建和运行 C 语言测试。适用于：添加新的 C 测试用例、理解测试数据格式、调试测试失败，或运行现有的 C 测试套件。","microsoft\u002Fvoxelpic","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69BKC93BJ9THG518QPTVV4F",0,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvoxelpic\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fc-testing\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障","SCENARIO","使用场景",[31,32,33,34,35],"testing","c testing","test","debugging","run","2026-11-10 10:12:30",false,"---\ndescription: \"Write, build, and run C tests for the VoxelPic library. USE FOR: adding new C test cases, understanding the test data format, debugging test failures, or running the existing C test suite.\"\n---\n\n# Testing the C Library\n\n## Test Suite Overview\n\nThere are three C test executables under `test\u002F`, each registered with CTest:\n\n| Executable   | Tests                        | Data Files              |\n|--------------|------------------------------|-------------------------|\n| `voxel_test` | OcTree build round-trip      | `voxel_1.dat`–`voxel_5.dat` |\n| `color_test` | Hue-codec encode\u002Fdecode      | *(none — self-contained)* |\n| `image_test` | Level encode\u002Fdecode to image | `image_7.dat`–`image_9.dat` |\n\n## Building and Running\n\n```sh\ncmake -B build --preset debug      # or release \u002F debug-clang \u002F release-clang\ncmake --build build\nctest --test-dir build -V           # -V for verbose output\n```\n\nAll four CMake presets enable `VOXELPIC_BUILD_TESTS`. To run a single test:\n\n```sh\nctest --test-dir build -R color_test -V\n```\n\nTo build with AddressSanitizer (clang):\n\n```sh\ncmake -B build --preset release-clang -DVOXELPIC_SANITIZE=address\ncmake --build build\nctest --test-dir build -V\n```\n\n## Test Data Generation\n\nTest data files are **generated automatically** by Python scripts as a\npost-build step (defined in `test\u002FCMakeLists.txt`):\n\n- `test\u002Fvoxel_test_gen.py` → produces `voxel_1.dat`–`voxel_5.dat`\n- `test\u002Fimage_test_gen.py` → produces `image_7.dat`–`image_9.dat`\n\nBoth scripts use a fixed random seed for reproducibility, and skip generation if\nthe output file already exists. Delete the `.dat` files to force regeneration.\n\n### Binary Data Format\n\nAll test data files follow the same layout:\n\n```\n[int32 big-endian]   octree level\n[int32 big-endian]   number of points\u002Fvoxels (N)\n  repeated N times:\n    [float32 native]  x\n    [float32 native]  y\n    [float32 native]  z\n    [uint8]           r\n    [uint8]           g\n    [uint8]           b\n```\n\n`voxel_test` data files additionally contain an expected-output section after\nthe input section with the same `[count][positions+colors]` layout.\n\nRead big-endian header integers with the `read_be()` helper from `test\u002Ftest.h`.\n\n## Conventions for Writing a New C Test\n\n### File Structure\n\n1. Create `test\u002F\u003Cname>_test.c`.\n2. `#include \u003Cvoxelpic\u002Fvoxelpic.h>` and `#include \"test.h\"`.\n3. Link against `voxelpic::voxelpic` in `test\u002FCMakeLists.txt`.\n4. Register with CTest via `add_test(...)`.\n\n### Pass \u002F Fail Signalling\n\n- Return **0** from `main()` on success, **1** on assertion failure.\n- CTest treats any non-zero exit code as failure.\n- Use `printf()` to log diagnostics on failure (no external assertion library).\n\n### Comparison Pattern\n\nCompare results element-by-element and print details on mismatch. Example:\n\n```c\nfor (size_t i = 0; i \u003C cloud->size; ++i) {\n  if (voxelpicVec3Compare(&actual->positions[i], &expected->positions[i])) {\n    printf(\"Position mismatch at %zu\\n\", i);\n    return 1;\n  }\n  if (actual->colors[i].value != expected->colors[i].value) {\n    printf(\"Color mismatch at %zu\\n\", i);\n    return 1;\n  }\n}\n```\n\n### Resource Cleanup\n\nUse `goto end` with a cleanup label to ensure all `*New()` allocations are\nmatched by `*Free()` calls, even on error paths:\n\n```c\nint main(int argc, char *argv[]) {\n  int result = 1;\n  voxelpicOcTree *octree = voxelpicOcTreeNew(4, 9);\n  voxelpicPointCloud *cloud = voxelpicPointCloudNew(0);\n  \u002F\u002F ... test logic ...\n  result = 0;\nend:\n  voxelpicOcTreeFree(octree);\n  voxelpicPointCloudFree(cloud);\n  return result;\n}\n```\n\n### Test Data Files\n\nIf the test needs generated data, add a Python generator script and a\n`add_custom_command(TARGET ... POST_BUILD ...)` in `test\u002FCMakeLists.txt`\nfollowing the existing pattern. Use `struct.pack(\">i\", ...)` for big-endian\nheader integers and native byte order for floats and uint8 colour values.\n\n### CMakeLists.txt Registration\n\n```cmake\nadd_executable(\u003Cname>_test \u003Cname>_test.c)\ntarget_link_libraries(\u003Cname>_test PRIVATE voxelpic::voxelpic)\nadd_test(NAME \u003Cname>_test COMMAND \u003Cname>_test [args...]\n         WORKING_DIRECTORY $\u003CTARGET_FILE_DIR:\u003Cname>_test>)\n```\n\n## Existing Test Details\n\n### voxel_test\n\nTests the full OcTree round-trip: loads a point cloud, builds an OcTree,\nextracts the level back to a cloud, and compares with expected output. Also\nverifies save\u002Fload I\u002FO for both `voxelpicPointCloud` and `voxelpicLevel`.\n\n### color_test\n\nTests `voxelpicValueToColor()` \u002F `voxelpicColorToValue()` round-trip across the\nfull `[0, VPIC_MAX_ENCODE_VALUE]` range, plus many smaller sub-ranges. Tests\nboth explicit-range and implicit-range (auto-detected min\u002Fmax) modes.\n\n### image_test\n\nTests level-to-image encoding and image-to-level decoding. Builds an OcTree,\nencodes a level into an RGBA image via `voxelpicLevelEncode()`, decodes it back\nwith `voxelpicLevelDecode()`, and compares the reconstructed cloud against the\noriginal.\n","# Testing the C Library\n\n## Test Suite Overview\n\nThere are three C test executables under `test\u002F`, each registered with CTest:\n\n| Executable   | Tests                        | Data Files              |\n|--------------|------------------------------|-------------------------|\n| `voxel_test` | OcTree build round-trip      | `voxel_1.dat`–`voxel_5.dat` |\n| `color_test` | Hue-codec encode\u002Fdecode      | *(none — self-contained)* |\n| `image_test` | Level encode\u002Fdecode to image | `image_7.dat`–`image_9.dat` |\n\n## Building and Running\n\n```sh\ncmake -B build --preset debug      # or release \u002F debug-clang \u002F release-clang\ncmake --build build\nctest --test-dir build -V           # -V for verbose output\n```\n\nAll four CMake presets enable `VOXELPIC_BUILD_TESTS`. To run a single test:\n\n```sh\nctest --test-dir build -R color_test -V\n```\n\nTo build with AddressSanitizer (clang):\n\n```sh\ncmake -B build --preset release-clang -DVOXELPIC_SANITIZE=address\ncmake --build build\nctest --test-dir build -V\n```\n\n## Test Data Generation\n\nTest data files are **generated automatically** by Python scripts as a\npost-build step (defined in `test\u002FCMakeLists.txt`):\n\n- `test\u002Fvoxel_test_gen.py` → produces `voxel_1.dat`–`voxel_5.dat`\n- `test\u002Fimage_test_gen.py` → produces `image_7.dat`–`image_9.dat`\n\nBoth scripts use a fixed random seed for reproducibility, and skip generation if\nthe output file already exists. Delete the `.dat` files to force regeneration.\n\n### Binary Data Format\n\nAll test data files follow the same layout:\n\n```\n[int32 big-endian]   octree level\n[int32 big-endian]   number of points\u002Fvoxels (N)\n  repeated N times:\n    [float32 native]  x\n    [float32 native]  y\n    [float32 native]  z\n    [uint8]           r\n    [uint8]           g\n    [uint8]           b\n```\n\n`voxel_test` data files additionally contain an expected-output section after\nthe input section with the same `[count][positions+colors]` layout.\n\nRead big-endian header integers with the `read_be()` helper from `test\u002Ftest.h`.\n\n## Conventions for Writing a New C Test\n\n### File Structure\n\n1. Create `test\u002F\u003Cname>_test.c`.\n2. `#include \u003Cvoxelpic\u002Fvoxelpic.h>` and `#include \"test.h\"`.\n3. Link against `voxelpic::voxelpic` in `test\u002FCMakeLists.txt`.\n4. Register with CTest via `add_test(...)`.\n\n### Pass \u002F Fail Signalling\n\n- Return **0** from `main()` on success, **1** on assertion failure.\n- CTest treats any non-zero exit code as failure.\n- Use `printf()` to log diagnostics on failure (no external assertion library).\n\n### Comparison Pattern\n\nCompare results element-by-element and print details on mismatch. Example:\n\n```c\nfor (size_t i = 0; i \u003C cloud->size; ++i) {\n  if (voxelpicVec3Compare(&actual->positions[i], &expected->positions[i])) {\n    printf(\"Position mismatch at %zu\\n\", i);\n    return 1;\n  }\n  if (actual->colors[i].value != expected->colors[i].value) {\n    printf(\"Color mismatch at %zu\\n\", i);\n    return 1;\n  }\n}\n```\n\n### Resource Cleanup\n\nUse `goto end` with a cleanup label to ensure all `*New()` allocations are\nmatched by `*Free()` calls, even on error paths:\n\n```c\nint main(int argc, char *argv[]) {\n  int result = 1;\n  voxelpicOcTree *octree = voxelpicOcTreeNew(4, 9);\n  voxelpicPointCloud *cloud = voxelpicPointCloudNew(0);\n  \u002F\u002F ... test logic ...\n  result = 0;\nend:\n  voxelpicOcTreeFree(octree);\n  voxelpicPointCloudFree(cloud);\n  return result;\n}\n```\n\n### Test Data Files\n\nIf the test needs generated data, add a Python generator script and a\n`add_custom_command(TARGET ... POST_BUILD ...)` in `test\u002FCMakeLists.txt`\nfollowing the existing pattern. Use `struct.pack(\">i\", ...)` for big-endian\nheader integers and native byte order for floats and uint8 colour values.\n\n### CMakeLists.txt Registration\n\n```cmake\nadd_executable(\u003Cname>_test \u003Cname>_test.c)\ntarget_link_libraries(\u003Cname>_test PRIVATE voxelpic::voxelpic)\nadd_test(NAME \u003Cname>_test COMMAND \u003Cname>_test [args...]\n         WORKING_DIRECTORY $\u003CTARGET_FILE_DIR:\u003Cname>_test>)\n```\n\n## Existing Test Details\n\n### voxel_test\n\nTests the full OcTree round-trip: loads a point cloud, builds an OcTree,\nextracts the level back to a cloud, and compares with expected output. Also\nverifies save\u002Fload I\u002FO for both `voxelpicPointCloud` and `voxelpicLevel`.\n\n### color_test\n\nTests `voxelpicValueToColor()` \u002F `voxelpicColorToValue()` round-trip across the\nfull `[0, VPIC_MAX_ENCODE_VALUE]` range, plus many smaller sub-ranges. Tests\nboth explicit-range and implicit-range (auto-detected min\u002Fmax) modes.\n\n### image_test\n\nTests level-to-image encoding and image-to-level decoding. Builds an OcTree,\nencodes a level into an RGBA image via `voxelpicLevelEncode()`, decodes it back\nwith `voxelpicLevelDecode()`, and compares the reconstructed cloud against the\noriginal.\n",{"description":7},"main","2b1cba0f161069e2a8986c6ccbb2c35d1d6c0bf6",".github\u002Fskills\u002Fc-testing",4,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvoxelpic","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-03-21 08:43:05",{"source":9,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add microsoft\u002Fvoxelpic --skill c-testing",{"tool":56,"command":57},"bunx","bunx skills add microsoft\u002Fvoxelpic --skill c-testing",{"tool":59,"command":60},"pnpm","pnpm dlx skills add microsoft\u002Fvoxelpic --skill c-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvoxelpic\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fc-testing\u002FSKILL.md",true,[],[65,78],{"skillNo":66,"name":67,"nameZh":68,"description":69,"descriptionZh":70,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":71,"categories":72,"keywords":75,"publishedAt":36},"01M69BKH5QHBR3DRWWHFT460DA","python-testing","Python 测试用例编写与运行","Write and run Python tests for the VoxelPic library. USE FOR: adding new pytest test cases, understanding the Python API and test patterns, debugging Python test failures, or running the existing Python test suite.","为 VoxelPic 库编写和运行 Python 测试。适用于：添加新的 pytest 测试用例、理解 Python API 与测试模式、调试 Python 测试失败，或运行现有的 Python 测试套件。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvoxelpic\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fpython-testing\u002FSKILL.md",[73,74],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[31,76,77,33,34,35],"python","python testing",{"skillNo":79,"name":80,"nameZh":81,"description":82,"descriptionZh":83,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":84,"categories":85,"keywords":92,"publishedAt":36},"01M69BKE3X494X2E5HQB3437FZ","bump-version","项目版本号更新","Bump the VoxelPic version to a user-specified value. USE FOR: setting or updating the project version across all files that embed it. Applies to requests like 'bump version to X.Y.Z', 'set version', or 'update version'.","将 VoxelPic 版本更新为用户指定的值。适用于：在所有嵌入版本号的文件中设置或更新项目版本。适用于“将版本升级到 X.Y.Z”“设置版本”或“更新版本”等请求。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvoxelpic\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fbump-version\u002FSKILL.md",[86,89],{"categoryNo":87,"categoryName":88,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":90,"categoryName":91,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理",[93,94],"bump version","update"]