Commit a23d7d9c authored by Per Cederqvist's avatar Per Cederqvist
Browse files

The "C" command now takes the arguments the other way around. Adjust

the test case.  Comments added.  Expect the "u" command to print
first_unused.
parent e86c41e0
......@@ -4,9 +4,10 @@ l2g_send "I0"
l2g_send "I1"
l2g_send "D0"
l2g_send "I0"
l2g_send "C0 1"
l2g_send "C0 1"
l2g_send "C0 1"
l2g_send "C1 0"
l2g_send "C1 0"
l2g_send "C1 0"
# Attempt to look up entries in an empty set.
l2g_send "l 0 0"
simple_expect "0" "test 0"
......@@ -21,8 +22,10 @@ simple_expect "0" "test 4"
l2g_send "l 0 5"
simple_expect "0" "test 5"
# Insert 3:103
l2g_send "a 0 3 103"
# Look up the first few numbers in a single-valued set.
l2g_send "l 0 1"
simple_expect "0" "test 6"
l2g_send "l 0 2"
......@@ -34,8 +37,10 @@ simple_expect "0" "test 9"
l2g_send "l 0 5"
simple_expect "0" "test 10"
# Append 4:104, resuling in the set 3:103, 4:104
l2g_send "a 0 4 104"
# Look up again.
l2g_send "l 0 1"
simple_expect "0" "test 11"
l2g_send "l 0 2"
......@@ -47,6 +52,7 @@ simple_expect "104" "test 14"
l2g_send "l 0 5"
simple_expect "0" "test 15"
# Append 8 more, resulting in a single full dense block.
l2g_send "a 0 5 105"
l2g_send "a 0 6 106"
l2g_send "a 0 7 107"
......@@ -58,8 +64,11 @@ l2g_send "a 0 12 1012"
l2g_send "u 0"
simple_expect "Number of blocks: 1" "test 16"
simple_expect "0: 10 0 3 .dense. .103 104 105 106 107 108 109 1010 1011 1012 ." "test 17"
#
simple_expect "First unused: 13" "test 16b"
simple_expect "0: 10 0 3 \\(dense\\) \\\[103 104 105 106 107 108 109 1010 1011 1012 \\\]" "test 17"
# Append 11 more, resulting in two full dense blocks and one dense
# block with a single entry.
l2g_send "a 0 13 1013"
l2g_send "a 0 14 1014"
l2g_send "a 0 15 1015"
......@@ -151,7 +160,7 @@ check_state 0
l2g_send "n 1 0"
simple_expect "0" "test 49"
l2g_send "C0 1"
l2g_send "C1 0"
check_state 1
......@@ -164,38 +173,46 @@ simple_expect "0" "test 50"
l2g_send "l 1 13"
simple_expect "0" "test 51"
# Test the representation.
l2g_send "I2"
l2g_send "u 2"
simple_expect "Number of blocks: 0" "test 52"
simple_expect "First unused: 1" "test 52b"
l2g_send "a2 10 139"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 53"
simple_expect "First unused: 11" "test 53b"
simple_expect "0: 1 9 10 \\(dense\\) \\\[139 \\\]" "test 54"
l2g_send "a2 12 141"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 55"
simple_expect "First unused: 13" "test 55b"
simple_expect "0: 3 8 10 \\(dense\\) \\\[139 0 141 \\\]" "test 56"
l2g_send "a2 14 147"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 57"
simple_expect "First unused: 15" "test 57b"
simple_expect "0: 5 7 10 \\(dense\\) \\\[139 0 141 0 147 \\\]" "test 58"
l2g_send "a2 16 153"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 59"
simple_expect "First unused: 17" "test 59b"
simple_expect "0: 7 6 10 \\(dense\\) \\\[139 0 141 0 147 0 153 \\\]" "test 60"
l2g_send "a2 18 157"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 61"
simple_expect "First unused: 19" "test 61b"
simple_expect "0: 9 5 10 \\(dense\\) \\\[139 0 141 0 147 0 153 0 157 \\\]" "test 62"
l2g_send "a2 21 167"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 63"
simple_expect "First unused: 22" "test 63b"
simple_expect "0: 6 4 10 \\(sparse\\) \\\[10:139 12:141 14:147 16:153 18:157 21:167 \\\]" "test 64"
l2g_send "a2 28 170"
......@@ -205,6 +222,7 @@ l2g_send "a2 102 173"
l2g_send "u 2"
simple_expect "Number of blocks: 1" "test 65"
simple_expect "First unused: 103" "test 65b"
simple_expect "0: 10 0 10 \\(sparse\\) \\\[10:139 12:141 14:147 16:153 18:157 21:167 28:170 92:171 99:172 102:173 \\\]" "test 66"
set block1 ""
......@@ -220,6 +238,7 @@ foreach x {{103 177} {104 178} {105 179} {106 180} {107 181} {108 182} {109 183}
incr zeroes -1
simple_expect "Number of blocks: 2" "test 67"
simple_expect "First unused: [expr 1 + [lindex $x 0]]" "test 67b"
simple_expect "0: 10 0 10 \\(sparse\\) \\\[10:139 12:141 14:147 16:153 18:157 21:167 28:170 92:171 99:172 102:173 \\\]" "test 68"
simple_expect "1: $nf $zeroes 103 \\(dense\\) \\\[$block1\\\]" "test 69"
}
......@@ -227,6 +246,7 @@ foreach x {{103 177} {104 178} {105 179} {106 180} {107 181} {108 182} {109 183}
l2g_send "a2 113 189"
l2g_send "u2"
simple_expect "Number of blocks: 3" "test 70"
simple_expect "First unused: 114" "test 70b"
simple_expect "0: 10 0 10 \\(sparse\\) \\\[10:139 12:141 14:147 16:153 18:157 21:167 28:170 92:171 99:172 102:173 \\\]" "test 71"
simple_expect "1: 10 0 103 \\(dense\\) \\\[$block1\\\]" "test 72"
simple_expect "2: 1 9 113 \\(dense\\) \\\[189 \\\]" "test 73"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment