From 59651b2844a5a4937901150376be34abd90ff86a Mon Sep 17 00:00:00 2001 From: Michal Antkiewicz Date: Tue, 10 Jan 2017 22:20:45 -0500 Subject: [PATCH] add assertions to the test case for #89 --- test/failing/gi89-ref-to-constant.cfr | 7 ++++++- test/failing/gi89-ref-to-constant.js | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 test/failing/gi89-ref-to-constant.js diff --git a/test/failing/gi89-ref-to-constant.cfr b/test/failing/gi89-ref-to-constant.cfr index 01a53118..1fe59f05 100644 --- a/test/failing/gi89-ref-to-constant.cfr +++ b/test/failing/gi89-ref-to-constant.cfr @@ -1,5 +1,10 @@ -abstract ASIL -> integer +abstract ASIL ->> integer A : ASIL -> 1 B : ASIL -> 2 C : ASIL -> 3 D : ASIL -> 4 + +assert [ A.dref = 1 ] +assert [ B.dref = 2 ] +assert [ C.dref = 3 ] +assert [ D.dref = 4 ] diff --git a/test/failing/gi89-ref-to-constant.js b/test/failing/gi89-ref-to-constant.js new file mode 100644 index 00000000..d3e6fca4 --- /dev/null +++ b/test/failing/gi89-ref-to-constant.js @@ -0,0 +1,19 @@ +scope({c0_ASIL:4}); +defaultScope(1); +intRange(-8, 7); +stringLength(16); + +c0_ASIL = Abstract("c0_ASIL"); +c0_A = Clafer("c0_A").withCard(1, 1); +c0_B = Clafer("c0_B").withCard(1, 1); +c0_C = Clafer("c0_C").withCard(1, 1); +c0_D = Clafer("c0_D").withCard(1, 1); +c0_ASIL.refTo(Int); +c0_A.extending(c0_ASIL).refToUnique(Int); +c0_B.extending(c0_ASIL).refToUnique(Int); +c0_C.extending(c0_ASIL).refToUnique(Int); +c0_D.extending(c0_ASIL).refToUnique(Int); +assert(equal(joinRef(global(c0_A)), constant(1))); +assert(equal(joinRef(global(c0_B)), constant(2))); +assert(equal(joinRef(global(c0_C)), constant(3))); +assert(equal(joinRef(global(c0_D)), constant(4)));