Skip to content

Commit

Permalink
add test and files for a p21read segfault.
Browse files Browse the repository at this point in the history
like the 210e2 segfault, this one is probably related to SELECTs.
  • Loading branch information
mpictor committed Feb 17, 2015
1 parent 37cfaeb commit ba6d0a1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/p21/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ INSTANCE_TEST(${mid} FAIL "AABB('z',2,.B.,1.2);" )
#p21read reports no errors on this one; I'm not certain whether that is right or wrong.
#INSTANCE_TEST(${mid} FAIL "AABB(4,.BEE.,4.5);" )

SCHEMA_CMLIST(${SC_SOURCE_DIR}/test/unitary_schemas/select_segfault_2.exp)
add_test( test_select_segfault_2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/p21read_sdai_select_segfault_2
${CMAKE_CURRENT_SOURCE_DIR}/select_segfault_2.stp )
set_tests_properties( test_select_segfault_2 PROPERTIES DEPENDS build_cpp_sdai_select_segfault_2 LABELS exchange_file )

# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8

14 changes: 14 additions & 0 deletions test/p21/select_segfault_2.stp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION((''),'2;1');
FILE_NAME('','',(''),(''),'','','');
FILE_SCHEMA(('select_segfault_2'));
ENDSEC;
DATA;

#1 = drc(cdl((#2,#3)));
#2 = dre(4.5);
#3 = dre(2.0);

ENDSEC;
END-ISO-10303-21;
20 changes: 20 additions & 0 deletions test/unitary_schemas/select_segfault_2.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- bug exposed by an AP242 file
SCHEMA select_segfault_2;
ENTITY drc SUBTYPE OF ( gdr ); END_ENTITY;

ENTITY gdr
ABSTRACT SUPERTYPE OF ( ONEOF ( DRC ) )
SUBTYPE OF (sa);
base: docd;
END_ENTITY;

ENTITY sa SUPERTYPE OF (ONEOF (gdr)); END_ENTITY;

TYPE docd = SELECT ( cdl, d ); END_TYPE;
TYPE cdl = LIST[2:?] OF dre; END_TYPE;
TYPE d = REAL; END_TYPE;
ENTITY dre;
id: REAL;
END_ENTITY;

END_SCHEMA;

0 comments on commit ba6d0a1

Please sign in to comment.