Comments (1)
I agree that such a case could be added.
A bit more generally, this is related to #226 . One could consider roughly the approaches:
- write "classical" unit tests, that set up some data + mocks, and check the result of calling a certain function
- use the more "holistic" ("integration-level") approach of trying to create one invalid file for each possible validation issue
Right now, the latter is used.
And I think that there is some benefit in having the actual file with the actual issue.
(A bit snarky: I'm pretty sure that there is a considerable number of "unit tests" in the world that do not really test functionality - in some cases they are testing whether something was mocked in a certain way. It's an art, and I'm by no means claiming that I'm doing the right thing, but for the validator, using that "file-based" level of tests seemed to make sense)
One drawback: There may be many files, and there could be quite some redundancy.
For example, the case that you described will be validated by the FeatureIdValidator
. And this will use the same code path, regardless of whether the feature IDs come from an attribute or from a texture. So one could create a test for feature ID textures and a nullFeatureId
, but it will "only" be another test of this particular function.
In the more "classical" unit-test approach, this function would be covered explicitly and only once (with all combinations of inputs) with something like
const featureIdSet = ...;
const nullFeatureId = ...;
FeatureIdValidator.validateFeatureIdSet(... featureIdSet, nullFeatureId, mockContext);
expect(mockContext.issues.length).toBe(1);
I'll keep this open as a reminder, even though increasing the test coverage is an ongoing task.
from 3d-tiles-validator.
Related Issues (20)
- Examine the effects of 'semantics' for the validation
- Check if transforms are affine
- Refining the report format and report file handling
- Cycles in external tilesets are not detected HOT 1
- TypeScript compilation fails HOT 5
- Tool can't be packaged HOT 1
- Validator fails to resolve GLB from I3DM with URI with spaces
- Build broken? HOT 1
- Streamline the validation of arrays of objects
- 3DTILES_content_gltf ? HOT 3
- Allow validation of tile content files
- Geometric error inconsistencies should be a WARNING and not an ERROR
- Out of memory crash HOT 1
- glTF extension support? HOT 4
- ValidFeatureIdAttributeWithLargerFeatureCount.gltf not valid HOT 8
- ValidFeatureIdAttributeWithByteStride.glb not a 3D Tile HOT 1
- PropertyAttributesPropertyAttributePropertyMaxMismatch.gltf is valid HOT 7
- Handle invalid alignments more graciously
- Missing 'refine' in root tile is not detected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3d-tiles-validator.