Skip to content

Commit ba6d0a1

Browse files
committed
add test and files for a p21read segfault.
like the 210e2 segfault, this one is probably related to SELECTs.
1 parent 37cfaeb commit ba6d0a1

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

test/p21/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,14 @@ INSTANCE_TEST(${mid} FAIL "AABB('z',2,.B.,1.2);" )
126126
#p21read reports no errors on this one; I'm not certain whether that is right or wrong.
127127
#INSTANCE_TEST(${mid} FAIL "AABB(4,.BEE.,4.5);" )
128128

129+
SCHEMA_CMLIST(${SC_SOURCE_DIR}/test/unitary_schemas/select_segfault_2.exp)
130+
add_test( test_select_segfault_2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/p21read_sdai_select_segfault_2
131+
${CMAKE_CURRENT_SOURCE_DIR}/select_segfault_2.stp )
132+
set_tests_properties( test_select_segfault_2 PROPERTIES DEPENDS build_cpp_sdai_select_segfault_2 LABELS exchange_file )
133+
129134
# Local Variables:
130135
# tab-width: 8
131136
# mode: cmake
132137
# indent-tabs-mode: t
133138
# End:
134139
# ex: shiftwidth=2 tabstop=8
135-

test/p21/select_segfault_2.stp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ISO-10303-21;
2+
HEADER;
3+
FILE_DESCRIPTION((''),'2;1');
4+
FILE_NAME('','',(''),(''),'','','');
5+
FILE_SCHEMA(('select_segfault_2'));
6+
ENDSEC;
7+
DATA;
8+
9+
#1 = drc(cdl((#2,#3)));
10+
#2 = dre(4.5);
11+
#3 = dre(2.0);
12+
13+
ENDSEC;
14+
END-ISO-10303-21;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- bug exposed by an AP242 file
2+
SCHEMA select_segfault_2;
3+
ENTITY drc SUBTYPE OF ( gdr ); END_ENTITY;
4+
5+
ENTITY gdr
6+
ABSTRACT SUPERTYPE OF ( ONEOF ( DRC ) )
7+
SUBTYPE OF (sa);
8+
base: docd;
9+
END_ENTITY;
10+
11+
ENTITY sa SUPERTYPE OF (ONEOF (gdr)); END_ENTITY;
12+
13+
TYPE docd = SELECT ( cdl, d ); END_TYPE;
14+
TYPE cdl = LIST[2:?] OF dre; END_TYPE;
15+
TYPE d = REAL; END_TYPE;
16+
ENTITY dre;
17+
id: REAL;
18+
END_ENTITY;
19+
20+
END_SCHEMA;

0 commit comments

Comments
 (0)