📄 tests1.exp
字号:
"print range location" # powerset locations test_print_accept "ptype pl1" \ "POWERSET SET \\(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\\)" \ "print mode of powerset location 1" test_print_accept "whatis pl1" "pm1" \ "print mode mode name of powerset location" test_print_accept "print pl1" \ "\[\[\]p1:p10\[\]\]" \ "print powerset location 1" test_print_accept "print pl2" {\[\]} \ "print powerset location 2" test_print_accept "print pl3" "\[\[\]p1, p10\[\]\]" \ "print powerset location 3" test_print_accept "print pl4" {\[p1:p2, p4:p6, p8:p10\]} \ "print powerset location 4" test_print_accept "print pl5" {\[p1:p4, p6, p8:p10\]} \ "print powerset location 5" test_print_accept "print pl6" {\[p1, p3:p8, p10\]} \ "print powerset location 6" test_print_accept "ptype pl7" \ "POWERSET byte \\(1:8\\)" \ "print mode of byte powerset location" test_print_accept "whatis pl7" "pm2" \ "print modename of byte powerset location" test_print_accept "print pl7" {\[1:8\]} \ "print powerset location 7" test_print_accept "ptype pl8" \ "POWERSET int \\(-32768:32767\\)" \ "print mode of int powerset location" test_print_accept "whatis pl8" "pm3" \ "print modename of int powerset location" test_print_accept "print pl8" {\[-32768:32767\]} \ "print powerset location 8" # test_print_accept "ptype pl9" \# "POWERSET long \\(-2147483648:2147483647\\)" \# "print mode of long powerset location"# test_print_accept "whatis pl9" "pm5" \# "print modename of long powerset location"# test_print_accept "print pl9" {\[-2147483648:2147483647\]} \# "print powerset location 9" # reference modes test_print_accept "ptype ref3l" "PTR" "print mode of reference location" # setup_xfail "*-*-*" test_print_accept "whatis ref3l" "ref3" \ "print modename of reference location" # setup_xfail "*-*-*" test_print_accept "print ref3l" "ref3\\(H'.*\\)" \ "print reference location" test_print_accept "ptype ref4l" "PTR" "print mode of reference location" # setup_xfail "*-*-*" test_print_accept "whatis ref4l" "ref4" \ "print modename of reference location" # setup_xfail "*-*-*" test_print_accept "print ref4l" "ref4\\(H'.*\\)" \ "print reference location" test_print_accept "ptype ref5l" "PTR" "print mode of reference location" test_print_accept "whatis ref5l" "PTR" \ "print modename of reference location" test_print_accept "print ref5l" "PTR\\(H'.*\\)" \ "print reference location" # dereference a little bit.. test_print_accept "print ref6l->syn_int" "42" \ "dereference reference to synmode location" test_print_accept "print ref7l->int" "-42" \ "dereference reference to predefined mode location" test_print_accept "print ref8l->pm1" \ "\[\[\]p1:p10\[\]\]" \ "dereference reference to newmode location" # synchronization mode locations # FIXME: synchronization modes are not supported so far... xfail "no synchronization mode location support, not implemented yet" # timing mode locations # FIXME: callbacks to abstime, inttime not implemented xfail "timing modes not implemented properly yet" # char string locations # some tests are don in chillvars.exp test_print_accept "ptype strl1" \ "CHARS \\(7\\) VARYING" \ "print varying string location" test_print_accept "whatis strl1" "strm2" \ "print string locationa mode name" test_print_accept "print strl1" \ {\"hansi\^\(0\)\"} \ "print string location" # string elements test_print_accept "print strl1(0)" "\'h\'" \ "print string element 1" test_print_accept "print strl1(5)" {'\^[(]0[)]'} \ "print string element 2" test_print_accept "print strl1(3)" "\'s\'" \ "print string element 3" test_print_accept "ptype strl1(0)" "char" \ "print mode of string element" # slices test_print_accept "print strl1(3:4)" "\"si\"" \ "print string slice 1" test_print_accept "print strl1(0:5)" \ {\"hansi\^\(0\)\"} \ "print string slice 2" test_print_accept "print strl1(0:0)" "\"h\"" \ "print string slice 3" test_print_accept "print strl1(0 up 6)" \ {\"hansi\^\(0\)\"} \ "print string slice 4" # FIXME: adjust error message, when implented gdb_test "print strl1(6 up 1)" \ ".*slice.*out of range.*" \ "print invalid string slice length" gdb_test "print strl1(-1 up 5)" \ ".*slice.*out of range.*" \ "print invalid string slice length" gdb_test "print strl1(-1:5)" \ ".*slice.*out of range.*" \ "print invalid string slice" gdb_test "print strl1(-1:7)" \ ".*slice.*out of range.*" \ "print invalid string slice" gdb_test "print strl1(0 up -1)" \ ".*slice.*out of range.*" \ "print invalid string slice length" gdb_test "print strl1(0 up 0)" {""} # bitstring locations test_print_accept "ptype bstr1" \ "BOOLS \\(20\\)" \ "print mode of bitstring location" test_print_accept "whatis bstrl1" "bstr1" \ "print mode name of bitstring location" test_print_accept "print bstrl1" \ "B'10101010101010101010'" \ "print bitstring location" test_print_accept "ptype bstrl1(0)" "bool|BOOL" \ "print mode of bitstring element" test_print_accept "print bstrl1(0)" "TRUE" \ "print bitstring element 1" test_print_accept "print bstrl1(19)" "FALSE" \ "print bitstring element 2" test_print_accept "print bstrl1(10)" "TRUE" \ "print bitstring element 3" test_print_accept "print bstrl1(0:19)" \ "B'10101010101010101010'" \ "print bitstring location slice 1" test_print_accept "print bstrl1(0:0)" \ "B'1'" \ "print bitstring location slice 2" test_print_accept "print bstrl1(3:9)" \ "B'0101010'" \ "print bitstring location slice 3" test_print_accept "print bstrl1(0 up 20)" \ "B'10101010101010101010'" \ "print bitstring location slice 4" test_print_accept "print bstrl1(19 up 1)" \ "B'0'" \ "print bitstring location slice 5" gdb_test "print bstrl1(20 up 1)" \ ".*slice out of range.*" \ "print invalid bitstring slice (20 up 1)" gdb_test "print bstrl1(-4:5)" \ ".*slice out of range.*" \ "print invalid bitstring slice (-4:5)" gdb_test "print bstrl1(-1:up 1)" \ ".*invalid expression syntax.*" \ "print invalid bitstring slice (-1:ip 1)" gdb_test "print bstrl1(-1:20)" \ ".*slice out of range.*" \ "print invalid bitstring slice (-1:20)" gdb_test "print bstrl1(0 up -1)" \ ".*slice out of range.*" \ "print invalid bitstring slice (0 up -1)" test_print_accept "print bstrl1(4 up 0)" "B''" # array mode locations gdb_test_exact "ptype arrl1" \ "ARRAY (1:100) set1" \ "print mode of array location" gdb_test "whatis arrl1" "arr1m" \ "print mode name of array location" gdb_test_exact "print arrl1" {[(1:100): aaa]} \ "print array location" test_print_accept "ptype arrl1(1)" \ "SET \\(aaa, bbb, ccc\\)" \ "print mode of array element" gdb_test_exact "print arrl3" \ {[(1:5): [(1:3): [(1:2): -2147483648]]]} \ "print array location 2" gdb_test_exact "print arrl3(1)" \ {[(1:3): [(1:2): -2147483648]]} \ "print array location 3" gdb_test_exact "ptype arrl3(1)" \ {ARRAY (1:3) ARRAY (1:2) long} \ "print mode of array element" test_print_accept "print arrl3(5)" \ {\[\(1:3\): \[\(1:2\): -2147483648\]\]} \ "print array location 4" test_print_accept "print arrl3(1,1)" \ {\[\(1:2\): -2147483648\]} \ "print array location 5" test_print_accept "ptype arrl3(1,1)" \ {ARRAY \(1:2\) long} \ "print mode of array element" test_print_accept "print arrl3(5,3)" \ {\[\(1:2\): -2147483648\]} \ "print array location 6" test_print_accept "print arrl3(1,1,1)" \ "-2147483648" \ "print array location 7" test_print_accept "print arrl3(5,3,2)" \ "-2147483648" \ "print array location 8" test_print_accept "print arrl3(1)(3)(2)" \ "-2147483648" \ "print array location 9" # reject the following range fails # FIXME: adjust error messages gdb_test "print arrl3(-1)" \ ".*out of range.*" \ "check invalid array indices 1" gdb_test "print arrl3(6)" \ ".*out of range.*" \ "check invalid array indices 2" gdb_test "print arrl3(0,0)" \ ".*out of range.*" \ "check invalid array indices 3" gdb_test "print arrl3(1,0)" \ ".*out of range.*" \ "check invalid array indices 4" gdb_test "print arrl3(1,4)" \ ".*out of range.*" \ "check invalid array indices 5" gdb_test "print arrl3(6,4)" \ ".*out of range.*" \ "check invalid array indices 6" gdb_test "print arrl3(1,1,0)" \ ".*out of range.*" \ "check invalid array indices 7" gdb_test "print arrl3(6,4,0)" \ ".*out of range.*" \ "check invalid array indices 8" gdb_test "print arrl3(1,1,3)" \ ".*out of range.*" \ "check invalid array indices 9" gdb_test "print arrl3(0)(0)" \ ".* array or string index out of range.*" \ "check invalid array indices 10" gdb_test "print arrl3(1)(0)" \ ".* array or string index out of range.*" \ "check invalid array indices 11" gdb_test "print arrl3(1)(4)" \ ".* array or string index out of range.*" \ "check invalid array indices 12" gdb_test "print arrl3(6)(4)" \ ".* array or string index out of range.*" \ "check invalid array indices 13" gdb_test "print arrl3(1)(1)(0)" \ ".* array or string index out of range.*" \ "check invalid array indices 14" gdb_test "print arrl3(6)(4)(0)" \ ".* array or string index out of range.*" \ "check invalid array indices 15" gdb_test "print arrl3(1)(1)(3)" \ ".* array or string index out of range.*" \ "check invalid array indices 16" # slices test_print_accept "print arrl4(1:3)" \ {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\]\]} \ "print array slice 1" test_print_accept "ptype arrl4(1:3)" \ {ARRAY \(1:3\) ARRAY \(1:3\) ARRAY \(1:2\) long} \ "print mode of array slice"# The next one is bogus:# test_print_accept "print arrl4(5, 2:3, 1)" \# # FIXME: maybe the '(1): ' in the inner tupel should be omitted ? \# {\[(2): \[\(1\): 100\], \(3\):\[\(1\): 100\]\]} \# "print array slice 2" test_print_accept "print arrl4(1 up 4)" \ {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\], \(4\): \[\(1:3\): \[\(1:2\): -2147483648\]\]\]} \ "print array slice 3"# The next two are bogus:# test_print_accept "print arrl4(3, 2 up 1)" \# {\[\(2:3\): \[\(1:2\): 100\]\]} \# "print array slice 4"# test_print_accept "print arrl4(1:2, 1 up 1, 2)" \# {\[\(1\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\], \(2\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\]\]} \# "print array slice 4" # reject invalid slices # FIXME: adjust error messages gdb_test "print arrl4(5:6)" \ ".*slice out of range.*" \ "check invalid range 1" gdb_test "print arrl4(0:1)" \ ".*slice out of range.*" \ "check invalid range 2" gdb_test "print arrl4(0:6)" \ ".*slice out of range.*" \ "check invalid range 3" gdb_test "print arrl4(3:2)" \ ".*slice out of range.*" \ "check invalid range 4" gdb_test "print arrl4(1,3:4)" \ ".*syntax error.*" \ "check invalid range 5" gdb_test "print arrl4(1,0:1)" \ ".*syntax error.*" \ "check invalid range 6" gdb_test "print arrl4(1,0:4)" \ ".*syntax error.*" \ "check invalid range 7" gdb_test "print arrl4(1,3:2)" \ ".*syntax error.*" \ "check invalid range 8" gdb_test "print arrl4(5 up 2)" \ ".*slice out of range.*" \ "check invalid range 9" gdb_test "print arrl4(-1 up 1)" \ ".*slice out of range.*" \ "check invalid range 10" gdb_test "print arrl4(-1 up 7)" \ ".*slice out of range.*" \ "check invalid range 11" gdb_test "print arrl4(1 up 0)" \ ".*slice out of range.*" \ "check invalid range 12" gdb_test "print arrl4(1,3 up 1)" \ ".*syntax error.*" \ "check invalid range 13" gdb_test "print arrl4(1,-1 up 1)" \ ".*syntax error.*" \ "check invalid range 14" gdb_test "print arrl4(1,-1 up 5)" \ ".*syntax error.*" \ "check invalid range 15" gdb_test "print arrl4(1,2 up 0)" \ ".*syntax error.*" \ "check invalid range 16" # structure modes # some tests are in chillvars.exp # FIXME: no tag processing implemented do maybe adjust these tests setup_xfail "*-*-*" test_print_accept "ptype stru1m" \ "STRUCT \\(.*a long,.*b long,.*CASE b OF.*\\(42\\):.*ch1 CHARS\\(20\\),.*\\(52\\):.*ch2 CHARS\\(10\\).*ELSE.*ch3 CHARS\\(1\\).*ESAC.*\\)" \ "print mode of structure location 1" test_print_accept "whatis strul1" "stru1m" \ "print mode name of structure location 1" setup_xfail "*-*-*" test_print_accept "print strul1" \ {\[\.a: -2147483648, \.b: 42, \.\(b\): \{\(42\) = \[\.ch1: \"12345678900987654321\"\], \(52\) = \[\.ch2: \"1234567890\"\], (else) = \[\.ch3: \"1\"\]\}\]} \ "print structure location 1" test_print_accept "print strul1.a" \ "-2147483648" \ "print field of structure location 1" test_print_accept "print strul1.b" "42" \ "print field of structure location 1" test_print_accept "print strul1.ch1" \ "\"12345678900987654321\"" \ "print field of structure location 1" # setup_xfail "*-*-*" test_print_accept "print strul1.ch2" \ "\"1234567890\"" \ "print field of structure location 1" # setup_xfail "*-*-*" test_print_accept "print strul1.ch3" \ "\"1\"" \ "print field of structure location 1" if $passcount then { pass "$passcount correct locations printed" }}# This is chill/9434proc test_9434 {} { global passcount verbose "testing pr-9434" test_print_accept "ptype m_xyzmode" "STRUCT \\(.*next REF m_xyzmode,.*i long.*\\)"}# Start with a fresh gdb.gdb_exitgdb_startgdb_reinitialize_dir $srcdir/$subdirgdb_test "set print sevenbit-strings" ".*"if [set_lang_chill] then { test_modes test_locations test_9434} else { warning "$test_name tests suppressed."}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -