From bd2162eb1f9acdbe0ed12aa594da89a0eb241389 Mon Sep 17 00:00:00 2001 From: Claudio Benghi Date: Tue, 26 Mar 2024 10:59:27 +0000 Subject: [PATCH] Improved test cases on Attribute facet - Updating the ids-tool.CommandLine to Version=1.0.66 a few errors emerged in the test cases and development IDS files. - Some cases have been marked "invalid" instead of "fail" to highlight that the audit tool can spot their problems - Some restriction types were missing, and have been added. - Some restriction types have been fixed (e.g.. integer vs double). --- Development/IDS_SimpleBIM_examples.ids | 2 +- Development/IDS_oma.ids | 6 +-- .../fail-dates_are_treated_as_strings_1_2.ids | 2 +- ...id-value_checks_always_fail_for_lists.ids} | 0 ...id-value_checks_always_fail_for_lists.ifc} | 0 ...-value_checks_always_fail_for_objects.ids} | 0 ...-value_checks_always_fail_for_objects.ifc} | 0 ...-value_checks_always_fail_for_selects.ids} | 0 ...-value_checks_always_fail_for_selects.ifc} | 0 ...pass-dates_are_treated_as_strings_2_2.ids} | 4 +- ...pass-dates_are_treated_as_strings_2_2.ifc} | 0 ..._may_be_done_with_a_bounds_restriction.ids | 2 +- .../fail-a_bound_can_be_inclusive_1_3.ids | 2 +- .../fail-a_bound_can_be_inclusive_3_3.ids | 2 +- .../fail-a_bound_can_be_inclusive_4_4.ids | 2 +- ...id-patterns_always_fail_on_any_number.ids} | 4 +- ...id-patterns_always_fail_on_any_number.ifc} | 0 ...only_work_on_strings_and_nothing_else.ids} | 0 ...only_work_on_strings_and_nothing_else.ifc} | 0 .../pass-a_bound_can_be_inclusive_1_4.ids | 2 +- .../pass-a_bound_can_be_inclusive_2_3.ids | 2 +- .../pass-a_bound_can_be_inclusive_2_4.ids | 2 +- .../pass-a_bound_can_be_inclusive_3_4.ids | 2 +- Documentation/testcases/scripts.md | 37 ++++++++++--------- SchemaProject/program.cs | 25 +++++++------ build/_build.csproj | 2 +- 26 files changed, 50 insertions(+), 48 deletions(-) rename Documentation/testcases/attribute/{fail-value_checks_always_fail_for_lists.ids => invalid-value_checks_always_fail_for_lists.ids} (100%) rename Documentation/testcases/attribute/{fail-value_checks_always_fail_for_lists.ifc => invalid-value_checks_always_fail_for_lists.ifc} (100%) rename Documentation/testcases/attribute/{fail-value_checks_always_fail_for_objects.ids => invalid-value_checks_always_fail_for_objects.ids} (100%) rename Documentation/testcases/attribute/{fail-value_checks_always_fail_for_objects.ifc => invalid-value_checks_always_fail_for_objects.ifc} (100%) rename Documentation/testcases/attribute/{fail-value_checks_always_fail_for_selects.ids => invalid-value_checks_always_fail_for_selects.ids} (100%) rename Documentation/testcases/attribute/{fail-value_checks_always_fail_for_selects.ifc => invalid-value_checks_always_fail_for_selects.ifc} (100%) rename Documentation/testcases/attribute/{pass-dates_are_treated_as_strings_1_2.ids => pass-dates_are_treated_as_strings_2_2.ids} (89%) rename Documentation/testcases/attribute/{pass-dates_are_treated_as_strings_1_2.ifc => pass-dates_are_treated_as_strings_2_2.ifc} (100%) rename Documentation/testcases/restriction/{fail-patterns_always_fail_on_any_number.ids => invalid-patterns_always_fail_on_any_number.ids} (87%) rename Documentation/testcases/restriction/{fail-patterns_always_fail_on_any_number.ifc => invalid-patterns_always_fail_on_any_number.ifc} (100%) rename Documentation/testcases/restriction/{fail-patterns_only_work_on_strings_and_nothing_else.ids => invalid-patterns_only_work_on_strings_and_nothing_else.ids} (100%) rename Documentation/testcases/restriction/{fail-patterns_only_work_on_strings_and_nothing_else.ifc => invalid-patterns_only_work_on_strings_and_nothing_else.ifc} (100%) diff --git a/Development/IDS_SimpleBIM_examples.ids b/Development/IDS_SimpleBIM_examples.ids index aa51b44..2d9c682 100644 --- a/Development/IDS_SimpleBIM_examples.ids +++ b/Development/IDS_SimpleBIM_examples.ids @@ -27,7 +27,7 @@ Name - + diff --git a/Development/IDS_oma.ids b/Development/IDS_oma.ids index 1a923b4..d3295d0 100644 --- a/Development/IDS_oma.ids +++ b/Development/IDS_oma.ids @@ -22,7 +22,7 @@ ObjectType - + @@ -190,7 +190,7 @@ PredefinedType - + @@ -885,7 +885,7 @@ OperationType - + diff --git a/Documentation/testcases/attribute/fail-dates_are_treated_as_strings_1_2.ids b/Documentation/testcases/attribute/fail-dates_are_treated_as_strings_1_2.ids index 9bb83b6..e995989 100644 --- a/Documentation/testcases/attribute/fail-dates_are_treated_as_strings_1_2.ids +++ b/Documentation/testcases/attribute/fail-dates_are_treated_as_strings_1_2.ids @@ -5,7 +5,7 @@ Generated via code automation in the Ids Repository on github. - + diff --git a/Documentation/testcases/attribute/fail-value_checks_always_fail_for_lists.ids b/Documentation/testcases/attribute/invalid-value_checks_always_fail_for_lists.ids similarity index 100% rename from Documentation/testcases/attribute/fail-value_checks_always_fail_for_lists.ids rename to Documentation/testcases/attribute/invalid-value_checks_always_fail_for_lists.ids diff --git a/Documentation/testcases/attribute/fail-value_checks_always_fail_for_lists.ifc b/Documentation/testcases/attribute/invalid-value_checks_always_fail_for_lists.ifc similarity index 100% rename from Documentation/testcases/attribute/fail-value_checks_always_fail_for_lists.ifc rename to Documentation/testcases/attribute/invalid-value_checks_always_fail_for_lists.ifc diff --git a/Documentation/testcases/attribute/fail-value_checks_always_fail_for_objects.ids b/Documentation/testcases/attribute/invalid-value_checks_always_fail_for_objects.ids similarity index 100% rename from Documentation/testcases/attribute/fail-value_checks_always_fail_for_objects.ids rename to Documentation/testcases/attribute/invalid-value_checks_always_fail_for_objects.ids diff --git a/Documentation/testcases/attribute/fail-value_checks_always_fail_for_objects.ifc b/Documentation/testcases/attribute/invalid-value_checks_always_fail_for_objects.ifc similarity index 100% rename from Documentation/testcases/attribute/fail-value_checks_always_fail_for_objects.ifc rename to Documentation/testcases/attribute/invalid-value_checks_always_fail_for_objects.ifc diff --git a/Documentation/testcases/attribute/fail-value_checks_always_fail_for_selects.ids b/Documentation/testcases/attribute/invalid-value_checks_always_fail_for_selects.ids similarity index 100% rename from Documentation/testcases/attribute/fail-value_checks_always_fail_for_selects.ids rename to Documentation/testcases/attribute/invalid-value_checks_always_fail_for_selects.ids diff --git a/Documentation/testcases/attribute/fail-value_checks_always_fail_for_selects.ifc b/Documentation/testcases/attribute/invalid-value_checks_always_fail_for_selects.ifc similarity index 100% rename from Documentation/testcases/attribute/fail-value_checks_always_fail_for_selects.ifc rename to Documentation/testcases/attribute/invalid-value_checks_always_fail_for_selects.ifc diff --git a/Documentation/testcases/attribute/pass-dates_are_treated_as_strings_1_2.ids b/Documentation/testcases/attribute/pass-dates_are_treated_as_strings_2_2.ids similarity index 89% rename from Documentation/testcases/attribute/pass-dates_are_treated_as_strings_1_2.ids rename to Documentation/testcases/attribute/pass-dates_are_treated_as_strings_2_2.ids index e995989..0b979a2 100644 --- a/Documentation/testcases/attribute/pass-dates_are_treated_as_strings_1_2.ids +++ b/Documentation/testcases/attribute/pass-dates_are_treated_as_strings_2_2.ids @@ -1,11 +1,11 @@ - Dates are treated as strings 1/2 + Dates are treated as strings 2/2 Generated via code automation in the Ids Repository on github. - + diff --git a/Documentation/testcases/attribute/pass-dates_are_treated_as_strings_1_2.ifc b/Documentation/testcases/attribute/pass-dates_are_treated_as_strings_2_2.ifc similarity index 100% rename from Documentation/testcases/attribute/pass-dates_are_treated_as_strings_1_2.ifc rename to Documentation/testcases/attribute/pass-dates_are_treated_as_strings_2_2.ifc diff --git a/Documentation/testcases/attribute/pass-strict_numeric_checking_may_be_done_with_a_bounds_restriction.ids b/Documentation/testcases/attribute/pass-strict_numeric_checking_may_be_done_with_a_bounds_restriction.ids index a323f20..8db5b28 100644 --- a/Documentation/testcases/attribute/pass-strict_numeric_checking_may_be_done_with_a_bounds_restriction.ids +++ b/Documentation/testcases/attribute/pass-strict_numeric_checking_may_be_done_with_a_bounds_restriction.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_1_3.ids b/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_1_3.ids index 16cae11..ae2a410 100644 --- a/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_1_3.ids +++ b/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_1_3.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_3_3.ids b/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_3_3.ids index 7b1929e..48b858b 100644 --- a/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_3_3.ids +++ b/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_3_3.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_4_4.ids b/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_4_4.ids index 4b8c718..3039d28 100644 --- a/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_4_4.ids +++ b/Documentation/testcases/restriction/fail-a_bound_can_be_inclusive_4_4.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/fail-patterns_always_fail_on_any_number.ids b/Documentation/testcases/restriction/invalid-patterns_always_fail_on_any_number.ids similarity index 87% rename from Documentation/testcases/restriction/fail-patterns_always_fail_on_any_number.ids rename to Documentation/testcases/restriction/invalid-patterns_always_fail_on_any_number.ids index 065f855..9f2354f 100644 --- a/Documentation/testcases/restriction/fail-patterns_always_fail_on_any_number.ids +++ b/Documentation/testcases/restriction/invalid-patterns_always_fail_on_any_number.ids @@ -1,11 +1,11 @@ - Patterns always fail on any number + Patterns always invalid on any number Generated via code automation in the Ids Repository on github. - + diff --git a/Documentation/testcases/restriction/fail-patterns_always_fail_on_any_number.ifc b/Documentation/testcases/restriction/invalid-patterns_always_fail_on_any_number.ifc similarity index 100% rename from Documentation/testcases/restriction/fail-patterns_always_fail_on_any_number.ifc rename to Documentation/testcases/restriction/invalid-patterns_always_fail_on_any_number.ifc diff --git a/Documentation/testcases/restriction/fail-patterns_only_work_on_strings_and_nothing_else.ids b/Documentation/testcases/restriction/invalid-patterns_only_work_on_strings_and_nothing_else.ids similarity index 100% rename from Documentation/testcases/restriction/fail-patterns_only_work_on_strings_and_nothing_else.ids rename to Documentation/testcases/restriction/invalid-patterns_only_work_on_strings_and_nothing_else.ids diff --git a/Documentation/testcases/restriction/fail-patterns_only_work_on_strings_and_nothing_else.ifc b/Documentation/testcases/restriction/invalid-patterns_only_work_on_strings_and_nothing_else.ifc similarity index 100% rename from Documentation/testcases/restriction/fail-patterns_only_work_on_strings_and_nothing_else.ifc rename to Documentation/testcases/restriction/invalid-patterns_only_work_on_strings_and_nothing_else.ifc diff --git a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_1_4.ids b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_1_4.ids index 944e001..142906b 100644 --- a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_1_4.ids +++ b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_1_4.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_3.ids b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_3.ids index 948d622..3028a10 100644 --- a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_3.ids +++ b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_3.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_4.ids b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_4.ids index 85957d3..76ea0dd 100644 --- a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_4.ids +++ b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_2_4.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_3_4.ids b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_3_4.ids index db8e616..be141e0 100644 --- a/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_3_4.ids +++ b/Documentation/testcases/restriction/pass-a_bound_can_be_inclusive_3_4.ids @@ -19,7 +19,7 @@ RefractionIndex - + diff --git a/Documentation/testcases/scripts.md b/Documentation/testcases/scripts.md index bfba9ff..8384358 100644 --- a/Documentation/testcases/scripts.md +++ b/Documentation/testcases/scripts.md @@ -245,15 +245,16 @@ Attribute: ''IsMilestone'',''FALSE'' ``` ids attribute/fail-dates_are_treated_as_strings_1_2.ids Dates are treated as strings 1/2 +IFC4 Entity: ''IFCCLASSIFICATION'' Requirements: Attribute: ''EditionDate'',''2022-01-01'' ``` -### Dates are treated as strings 1/2 +### Dates are treated as strings 2/2 -``` ids attribute/pass-dates_are_treated_as_strings_1_2.ids -Dates are treated as strings 1/2 +``` ids attribute/pass-dates_are_treated_as_strings_2_2.ids +Dates are treated as strings 2/2 IFC4 Entity: ''IFCCLASSIFICATION'' Requirements: @@ -510,7 +511,7 @@ Attribute: Pattern(''NumberOfRiser(s)?''),''42.3'' Strict numeric checking may be done with a bounds restriction Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:decimal MinInclusive(''42'') MaxInclusive(''42'') +Attribute: ''RefractionIndex'',xs:double MinInclusive(''42'') MaxInclusive(''42'') ``` ### Typecast checking may also occur within enumeration restrictions @@ -529,7 +530,7 @@ Attribute: ''RefractionIndex'',xs:double Enumeration(''42'',''43'') ### Value checks always fail for lists -``` ids attribute/fail-value_checks_always_fail_for_lists.ids +``` ids attribute/invalid-value_checks_always_fail_for_lists.ids Value checks always fail for lists Entity: ''IFCCARTESIANPOINT'' Requirements: @@ -538,7 +539,7 @@ Attribute: ''Coordinates'',''Foobar'' ### Value checks always fail for objects -``` ids attribute/fail-value_checks_always_fail_for_objects.ids +``` ids attribute/invalid-value_checks_always_fail_for_objects.ids Value checks always fail for objects IFC4 Entity: ''IFCTASK'' @@ -548,7 +549,7 @@ Attribute: ''TaskTime'',''Foobar'' ### Value checks always fail for selects -``` ids attribute/fail-value_checks_always_fail_for_selects.ids +``` ids attribute/invalid-value_checks_always_fail_for_selects.ids Value checks always fail for selects Entity: ''IFCSURFACESTYLERENDERING'' Requirements: @@ -2449,7 +2450,7 @@ Property: ''Pset_WallCommon'',''FireRating'',IFCLABEL,Pattern(''(-|[0-9]{2,3})\/ A bound can be inclusive 1/3 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinExclusive(''0'') MaxExclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinExclusive(''0'') MaxExclusive(''10'') ``` ### A bound can be inclusive 1/4 @@ -2458,7 +2459,7 @@ Attribute: ''RefractionIndex'',xs:integer MinExclusive(''0'') MaxExclusive(''10' A bound can be inclusive 1/4 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinInclusive(''0'') MaxInclusive(''10'') ``` ### A bound can be inclusive 2/3 @@ -2467,7 +2468,7 @@ Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10' A bound can be inclusive 2/3 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinExclusive(''0'') MaxExclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinExclusive(''0'') MaxExclusive(''10'') ``` ### A bound can be inclusive 2/4 @@ -2476,7 +2477,7 @@ Attribute: ''RefractionIndex'',xs:integer MinExclusive(''0'') MaxExclusive(''10' A bound can be inclusive 2/4 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinInclusive(''0'') MaxInclusive(''10'') ``` ### A bound can be inclusive 3/3 @@ -2485,7 +2486,7 @@ Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10' A bound can be inclusive 3/3 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinExclusive(''0'') MaxExclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinExclusive(''0'') MaxExclusive(''10'') ``` ### A bound can be inclusive 3/4 @@ -2494,7 +2495,7 @@ Attribute: ''RefractionIndex'',xs:integer MinExclusive(''0'') MaxExclusive(''10' A bound can be inclusive 3/4 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinInclusive(''0'') MaxInclusive(''10'') ``` ### A bound can be inclusive 4/4 @@ -2503,7 +2504,7 @@ Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10' A bound can be inclusive 4/4 Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: -Attribute: ''RefractionIndex'',xs:integer MinInclusive(''0'') MaxInclusive(''10'') +Attribute: ''RefractionIndex'',xs:double MinInclusive(''0'') MaxInclusive(''10'') ``` ### An enumeration matches case sensitively 1/3 @@ -2596,10 +2597,10 @@ Requirements: Attribute: ''Name'',MinLength(''2'') MaxLength(''3'') ``` -### Patterns always fail on any number +### Patterns always invalid on any number -``` ids restriction/fail-patterns_always_fail_on_any_number.ids -Patterns always fail on any number +``` ids restriction/invalid-patterns_always_fail_on_any_number.ids +Patterns always invalid on any number Optional Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: @@ -2608,7 +2609,7 @@ Attribute: ''RefractionIndex'',Pattern(''.*'') ### Patterns only work on strings and nothing else -``` ids restriction/fail-patterns_only_work_on_strings_and_nothing_else.ids +``` ids restriction/invalid-patterns_only_work_on_strings_and_nothing_else.ids Patterns only work on strings and nothing else Entity: ''IFCSURFACESTYLEREFRACTION'' Requirements: diff --git a/SchemaProject/program.cs b/SchemaProject/program.cs index fc33266..3f9428a 100644 --- a/SchemaProject/program.cs +++ b/SchemaProject/program.cs @@ -115,16 +115,6 @@ private static void RegenIDS() buffer.AppendLine(line); } } - - // extra IDSs - foreach (var item in allIDSs.Except(newIDSs)) - { - string t = IdsHelpers.CreateDiffReportHtml(item); - var reportFileName = Path.ChangeExtension(item, "html"); - File.WriteAllText(reportFileName, t); - Console.WriteLine($"Extra IDS report generated: {reportFileName}"); - } - // extra ifcs foreach (var item in testCasesFolder.GetFiles("*.ifc", SearchOption.AllDirectories)) { @@ -134,8 +124,8 @@ private static void RegenIDS() var invalidFileName = item.FullName.Replace("fail-", "invalid-"); if (missingIfcFileNames.Contains(invalidFileName)) { - // File.Move(item.FullName, invalidFileName); - Console.WriteLine("A matching invalid IFC is required, should you rename this?"); + File.Move(item.FullName, invalidFileName); + // Console.WriteLine("A matching invalid IFC is required, should you rename this?"); } //else if (allIfcFound) //{ @@ -143,6 +133,17 @@ private static void RegenIDS() //} } } + + // extra IDSs + foreach (var item in allIDSs.Except(newIDSs)) + { + string t = IdsHelpers.CreateDiffReportHtml(item); + var reportFileName = Path.ChangeExtension(item, "html"); + File.WriteAllText(reportFileName, t); + Console.WriteLine($"Extra IDS report generated: {reportFileName}"); + } + + if (allIfcFound) { Message("All scripting IFC files found", ConsoleColor.Green); diff --git a/build/_build.csproj b/build/_build.csproj index 266748c..5db5861 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -13,7 +13,7 @@ - +