123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- #!/bin/sh
- . ./Common
- ###############################################################################
- fped_dump "qualified measurements: no qualifier" <<EOF
- frame c { v: vec @(0mm, 0mm) }
- frame b { frame c @ }
- frame a { frame b @ }
- frame a @
- meas c.v >> c.v
- EOF
- expect <<EOF
- /* MACHINE-GENERATED ! */
- frame c {
- v: vec @(0mm, 0mm)
- }
- frame b {
- frame c @
- }
- frame a {
- frame b @
- }
- package "_"
- unit mm
- frame a @
- meas c.v >> c.v
- EOF
- #------------------------------------------------------------------------------
- fped_dump "qualified measurements: fully qualified" <<EOF
- frame c { v: vec @(0mm, 0mm) }
- frame b { frame c @ }
- frame a { frame b @ }
- frame a @
- meas a/b/c.v >> c.v
- EOF
- expect_grep '^meas' <<EOF
- meas a/b/c.v >> c.v
- EOF
- #------------------------------------------------------------------------------
- fped_dump "qualified measurements: partially qualified" <<EOF
- frame c { v: vec @(0mm, 0mm) }
- frame b { frame c @ }
- frame a { frame b @ }
- frame a @
- meas a/c.v >> c.v
- EOF
- expect_grep '^meas' <<EOF
- meas a/c.v >> c.v
- EOF
- #------------------------------------------------------------------------------
- fped_dump "qualified measurements: wrong order" <<EOF
- frame c { v: vec @(0mm, 0mm) }
- frame b { frame c @ }
- frame a { frame b @ }
- frame a @
- meas b/a/c.v >> c.v
- EOF
- expect_grep 'warning' <<EOF
- 5: warning: not all qualifiers can be reached near "v"
- EOF
- #------------------------------------------------------------------------------
- fped_dump "qualified measurements: unlinked frame" <<EOF
- frame c { v: vec @(0mm, 0mm) }
- frame b { frame c @ }
- frame a { frame b @ }
- frame x {}
- frame a @
- frame x @
- meas a/c.v >> x/c.v
- EOF
- expect_grep 'warning' <<EOF
- 7: warning: not all qualifiers can be reached near "v"
- EOF
- #------------------------------------------------------------------------------
- fped_fail "qualified measurements: duplicate qualifier" <<EOF
- frame c { v: vec @(0mm, 0mm) }
- frame b { frame c @ }
- frame a { frame b @ }
- frame a @
- meas b/b/c.v >> c.v
- EOF
- expect <<EOF
- 5: duplicate qualifier "b" near "v"
- EOF
- #------------------------------------------------------------------------------
- fped "qualified measurements: \"macro\" unqualified" <<EOF
- frame x {
- a: vec @(0mm, 0mm)
- b: vec .(d, 0mm)
- }
- frame a {
- set d = 2mm
- frame x @
- }
- frame b {
- set d = 3mm
- frame x @
- }
- frame a @
- vec @(1mm, 0mm)
- frame b .
- meas x.a >> x.b /* dummy */
- m: meas x.a >> x.b
- %meas m
- EOF
- expect <<EOF
- 4
- EOF
- #------------------------------------------------------------------------------
- fped "qualified measurements: \"macro\" qualified (a)" <<EOF
- frame x {
- a: vec @(0mm, 0mm)
- b: vec .(d, 0mm)
- }
- frame a {
- set d = 2mm
- frame x @
- }
- frame b {
- set d = 3mm
- frame x @
- }
- frame a @
- vec @(1mm, 0mm)
- frame b .
- meas x.a >> x.b /* dummy */
- m: meas a/x.a >> a/x.b
- %meas m
- EOF
- expect <<EOF
- 2
- EOF
- #------------------------------------------------------------------------------
- fped "qualified measurements: \"macro\" qualified (b)" <<EOF
- frame x {
- a: vec @(0mm, 0mm)
- b: vec .(d, 0mm)
- }
- frame a {
- set d = 2mm
- frame x @
- }
- frame b {
- set d = 3mm
- frame x @
- }
- frame a @
- vec @(1mm, 0mm)
- frame b .
- meas x.a >> x.b /* dummy */
- m: meas b/x.a >> b/x.b
- %meas m
- EOF
- expect <<EOF
- 3
- EOF
- #------------------------------------------------------------------------------
- fped "qualified measurements: \"macro\" qualified (a/b)" <<EOF
- frame x {
- a: vec @(0mm, 0mm)
- b: vec .(d, 0mm)
- }
- frame a {
- set d = 2mm
- frame x @
- }
- frame b {
- set d = 3mm
- frame x @
- }
- frame a @
- vec @(1mm, 0mm)
- frame b .
- meas x.a >> x.b /* dummy */
- m: meas a/x.a >> b/x.b
- %meas m
- EOF
- expect <<EOF
- 4
- EOF
- #------------------------------------------------------------------------------
- fped "qualified measurements: \"macro\" qualified (b/a)" <<EOF
- frame x {
- a: vec @(0mm, 0mm)
- b: vec .(d, 0mm)
- }
- frame a {
- set d = 2mm
- frame x @
- }
- frame b {
- set d = 3mm
- frame x @
- }
- frame a @
- vec @(1mm, 0mm)
- frame b .
- meas x.a >> x.b /* dummy */
- m: meas b/x.a >> a/x.b
- %meas m
- EOF
- expect <<EOF
- 1
- EOF
- ###############################################################################
|