cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Test createVerticesFromHeightMap and createVerticesFromQuantizedTerrainMesh

Open bagnell opened this issue 9 years ago • 4 comments

createVerticesFromHeightMap and createVerticesFromQuantizedTerrainMesh have no unit tests.

bagnell avatar May 09 '16 18:05 bagnell

Hello, I am part of the JTC Flagship program and would like to work on this issue.

ChristianToro avatar Aug 25 '24 04:08 ChristianToro

@ChristianToro Sounds good! Our testing guide may help getting starting.

ggetz avatar Aug 26 '24 13:08 ggetz

Hey @ggetz , I have been researching the testing guide which has been helpful, but I have a few questions that need clarification:

This issue cites PR #3902, which cited the original issue #3676, referencing a terrain exaggeration sandcastle problem. When checking out tag 1.18 to try a reproduction of the issue resulted in an ES6 error during build. The terrain exaggeration example seems to use createVerticesFromQuantizedTerrainMesh but depends on fairly large set of dependencies. Given this, it would be difficult to make a unit test, rather than an integration test. How should I proceed with this? Are there other unit test examples for other workers within the code base?

ChristianToro avatar Sep 26 '24 21:09 ChristianToro

@ChristianToro Thanks for review all these materials. These are good questions.

TaskProcessorSpec.js has examples of minimal unit tests which validate workers. Namely providing some input and confirming the expected outputs.

To create these tests, I would set up two new files packages/engine/Specs/Workers/createVerticesFromHeightMapSpec.js and packages/engine/Specs/Workers/createVerticesFromQuantizedTerrainMeshSpec.js. In each of those files, I would create similarly structured unit tests using TaskProcessor to schedule and execute the workers.

For the parameters themselves, I would look at HeightmapTerrainDataSpec.js and QuantizedMeshTerrainDataSpec.js for relevant examples.

Let me know if you have any further questions!

ggetz avatar Sep 27 '24 13:09 ggetz