Test cases for restrictions on bounded properties (#371) - #451
Open
BIMvoice wants to merge 2 commits into
Open
Conversation
Addresses the restriction half of buildingSMART#371: no official fixture exercised a restriction facet (minInclusive/maxInclusive/minExclusive/maxExclusive) against an IfcPropertyBoundedValue before this change. Adds two families under Documentation/ImplementersDocumentation/TestCases/property: - a two sided restriction, checking both bounds against an inclusive and an exclusive end - a one sided restriction, checking that only the constrained bound is required and that SetPointValue alone does not satisfy it Hand authored to match the format produced by CreateTestCases, since the .NET build could not be run locally. Validated against Schema/ids.xsd and against a fixed IfcTester implementation. AI-assisted with Claude Code.
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the restriction half of #371.
What this measures
Searching the whole
Documentation/ImplementersDocumentation/TestCasestree, no existing.idsfile combines anIFCPROPERTYBOUNDEDVALUEfixture with anxs:restrictionrequirement. Therestriction/folder only exercises theAttributefacet, andproperty/'s bounded value fixtures only exercise equality viasimpleValue. Restriction against a bounded property's bounds was completely untested.That gap is not academic. IfcOpenShell's IfcTester had a real bug here: its restriction handling for
IfcPropertyBoundedValuedid not distinguish LowerBoundValue from UpperBoundValue from SetPointValue, and did not fail when a bound the restriction depends on was missing. We fixed it in IfcOpenShell#9250, and it shipped unnoticed for as long as it did because no official test case would have caught it. Running this PR's cases against IfcTester before that fix, 3 of the 6 give the wrong verdict, all wrongly passing where they should fail. After the fix, all 6 are correct.What is covered, per the thread's agreed decision
@atomczak (2024-11-06): "Let's ignore SetPointValue then and focus on Bounds only... the bounds in IFC should be within the IDS min/max."
@andyward (2024-11-06): "Agreed we should ignore SetPointValue", with his table for
minInclusive="20": Lower=20/Upper=40 pass, Lower=15/Upper=40 fail, Lower=25/empty pass, empty/Upper=40 fail.Two families under
property/, both restricted to bounds only:a_restriction_on_a_bounded_property_requires_both_bounds_within_range(1-3): two-sidedminExclusive="20" maxInclusive="40". Both bounds inside passes; the lower bound sitting exactly on the excluded minimum fails; the upper bound sitting exactly on the included maximum passes.a_one_sided_restriction_on_a_bounded_property_requires_the_matching_bound(1-3): one-sidedminInclusive="20", mirroring the table directly. The third case has only SetPointValue set and no bounds, which fails, since the required bound is absent and SetPointValue is not considered.Pass and fail cases share the same specification, so a pass alone cannot be mistaken for not-checked-at-all.
Deliberately not covered: equality
The equality half of #371 is still open. @andyward's last comment ends on "Feels like this may be a 1.1 change vs retrospective 1.0?", and the shipped v1.0 fixture
pass-any_matching_value_in_a_bounded_property_will_pass_3_4currently passes only because SetPointValue participates in equality matching. Adding a case there would take a side in an argument the thread has not closed.How these were built
Correction: I originally wrote that
CreateTestCasescould not be run. That was wrong. The build needs the .NET 8 runtime specifically, because Nuke usesBinaryFormatter, which .NET 9 removed. With that installed it runs in about a second. These.idsfiles are still hand-authored; I am happy to regenerate them through the official build on request. Validation, unchanged: all six are XSD-valid againstSchema/ids.xsd, and all six give the correct verdict against fixed IfcTester.@atomczak @andyward, flagging for your review since you two worked out the agreed behaviour in the thread. Happy to adjust naming, add boundary cases, or split the families differently.
This PR was created with the assistance of an AI coding tool.