Skip to content

Add functional tests for AP242 styled_item with both narrowing approaches#16

Merged
starseeker merged 5 commits intotreatfrom
copilot/add-ap242-step-file-test
Feb 9, 2026
Merged

Add functional tests for AP242 styled_item with both narrowing approaches#16
starseeker merged 5 commits intotreatfrom
copilot/add-ap242-step-file-test

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 9, 2026

Verify Both AP242 Tests Run Successfully

  • Check/configure build directory
  • Build vanilla AP242 schema (libsdai_242_mim_lf.so)
  • Build TREAT AP242 schema (libsdai_ap242treat.so)
  • Build test executables (tst_ap242_vanilla_styled_item, tst_ap242_styled_item)
  • Run vanilla AP242 test and verify success
  • Run TREAT AP242 test and verify success
  • Document test results
Original prompt

We have been working on adding support for stepcode to handle the newest ap242 schema, which originally had a problem parsing the vanilla ISO ap242 exp file. New support in the treat branch allows us to generate C++ with exp2cxx and compile a libsdai_ap242.so shared library, but as yet we have no functional test that actually uses the generated code to parse an ap242 step file and verify the C++ code we are producing correctly handles valid ap242 inputs exercising the newly supported mechanism. Please create a test ap242 step file input designed to exercise this aspect of the ap242 standard, and construct a test using the new libsdai_ap242.so produced by the current treat branch of stepcode to verify that a program can use it to successfully and correctly extract the expected information from your generated test file. Success is defined as being able to prove that our new generated C++ code can properly handle data encoded according to the part of the schma that originally produced errors (the ap242 file containing it should be a proper, fully compliant and correct file rather than just some sort of snippit or subset.) The problematic part of the schema was ENTITY styled_item
SUBTYPE OF (representation_item);
styles : SET [0 : ?] OF presentation_style_assignment;
item : styled_item_target;
WHERE
WR1: (SIZEOF(styles) = 0) AND
('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.STYLED_TESSELLATED_ITEM_WITH_COLOURS' IN TYPEOF(SELF)) OR
(SIZEOF(styles) = 1) OR
(SIZEOF(styles) > 1) AND
(SIZEOF(QUERY(pres_style
<* styles
| NOT ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.PRESENTATION_STYLE_BY_CONTEXT' IN
TYPEOF(pres_style)))) =
0);
WR2: NOT ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.STYLED_ITEM' IN TYPEOF(item));
WR3: ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.MAPPED_ITEM' IN TYPEOF(item)) OR
('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item)) OR
(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.SET_REPRESENTATION_ITEM' IN TYPEOF(item)) AND
(SIZEOF(QUERY(it
<* item
| NOT (('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.MAPPED_ITEM' IN TYPEOF(it)) OR
('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.GEOMETRIC_REPRESENTATION_ITEM' IN
TYPEOF(it))))) =
0));
END_ENTITY;


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 9, 2026 14:44
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
- Add test STEP file with styled_item instances
- Add C++ test program using libsdai_ap242.so
- Configure CMake to build ap242treat schema
- Add test documentation
- Test exercises TREAT expression in WR3 WHERE rule

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functional test for ap242 step file parsing Add functional test for AP242 styled_item with TREAT expression Feb 9, 2026
Copilot AI requested a review from starseeker February 9, 2026 15:29
- Add vanilla AP242 schema (242_mim_lf.exp) to build
- Create ap242_vanilla_styled_item test using flow-sensitive narrowing
- Update documentation to explain both test approaches
- Both schemas use same STEP file but different narrowing mechanisms

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Copilot AI changed the title Add functional test for AP242 styled_item with TREAT expression Add functional tests for AP242 styled_item with both narrowing approaches Feb 9, 2026
Change from "242_mim_lf" to "ap242" to match actual CMake target name

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
@starseeker starseeker marked this pull request as ready for review February 9, 2026 20:40
@starseeker starseeker merged commit e1de455 into treat Feb 9, 2026
@starseeker starseeker deleted the copilot/add-ap242-step-file-test branch February 9, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants