Commit 245eb455 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added test cases for reverse iterators.

parent 054b3514
......@@ -129,6 +129,52 @@ simple_expect "42:1042" "test 86"
simple_expect "43:1043" "test 87"
simple_expect "44:1044" "test 88"
l2g_send "b0 1 55"
simple_expect "44:1044" "test 88-2"
simple_expect "43:1043" "test 87-2"
simple_expect "42:1042" "test 86-2"
simple_expect "41:1041" "test 85-2"
simple_expect "40:1040" "test 84-2"
simple_expect "39:1039" "test 83-2"
simple_expect "38:1038" "test 82-2"
simple_expect "37:1037" "test 81-2"
simple_expect "36:1036" "test 80-2"
simple_expect "35:1035" "test 79-2"
simple_expect "34:1034" "test 78-2"
simple_expect "33:1033" "test 77-2"
simple_expect "32:1032" "test 76-2"
simple_expect "31:1031" "test 75-2"
simple_expect "30:1030" "test 74-2"
simple_expect "29:1029" "test 73-2"
simple_expect "28:1028" "test 72-2"
simple_expect "27:1027" "test 71-2"
simple_expect "26:1026" "test 70-2"
simple_expect "25:1025" "test 69-2"
simple_expect "24:1024" "test 68-2"
simple_expect "23:1023" "test 67-2"
simple_expect "22:1022" "test 66-2"
simple_expect "21:1021" "test 65-2"
simple_expect "20:1020" "test 64-2"
simple_expect "19:1019" "test 63-2"
simple_expect "18:1018" "test 62-2"
simple_expect "17:1017" "test 61-2"
simple_expect "16:1016" "test 60-2"
simple_expect "15:1015" "test 59-2"
simple_expect "14:1014" "test 58-2"
simple_expect "13:1013" "test 57-2"
simple_expect "12:1012" "test 56-2"
simple_expect "11:1011" "test 55-2"
simple_expect "10:1010" "test 54-2"
simple_expect "9:1009" "test 53-2"
simple_expect "8:1008" "test 52-2"
simple_expect "7:1007" "test 51-2"
simple_expect "6:1006" "test 50-2"
simple_expect "5:1005" "test 49-2"
simple_expect "4:1004" "test 48-2"
simple_expect "3:1003" "test 47-2"
simple_expect "2:1002" "test 46-2"
simple_expect "1:1001" "test 45-2"
l2g_send "i0 1 99"
simple_expect "1:1001" "test 89"
simple_expect "2:1002" "test 90"
......@@ -175,6 +221,52 @@ simple_expect "42:1042" "test 130"
simple_expect "43:1043" "test 131"
simple_expect "44:1044" "test 132"
l2g_send "b0 1 99"
simple_expect "44:1044" "test 132-2"
simple_expect "43:1043" "test 131-2"
simple_expect "42:1042" "test 130-2"
simple_expect "41:1041" "test 129-2"
simple_expect "40:1040" "test 128-2"
simple_expect "39:1039" "test 127-2"
simple_expect "38:1038" "test 126-2"
simple_expect "37:1037" "test 125-2"
simple_expect "36:1036" "test 124-2"
simple_expect "35:1035" "test 123-2"
simple_expect "34:1034" "test 122-2"
simple_expect "33:1033" "test 121-2"
simple_expect "32:1032" "test 120-2"
simple_expect "31:1031" "test 119-2"
simple_expect "30:1030" "test 118-2"
simple_expect "29:1029" "test 117-2"
simple_expect "28:1028" "test 116-2"
simple_expect "27:1027" "test 115-2"
simple_expect "26:1026" "test 114-2"
simple_expect "25:1025" "test 113-2"
simple_expect "24:1024" "test 112-2"
simple_expect "23:1023" "test 111-2"
simple_expect "22:1022" "test 110-2"
simple_expect "21:1021" "test 109-2"
simple_expect "20:1020" "test 108-2"
simple_expect "19:1019" "test 107-2"
simple_expect "18:1018" "test 106-2"
simple_expect "17:1017" "test 105-2"
simple_expect "16:1016" "test 104-2"
simple_expect "15:1015" "test 103-2"
simple_expect "14:1014" "test 102-2"
simple_expect "13:1013" "test 101-2"
simple_expect "12:1012" "test 100-2"
simple_expect "11:1011" "test 99-2"
simple_expect "10:1010" "test 98-2"
simple_expect "9:1009" "test 97-2"
simple_expect "8:1008" "test 96-2"
simple_expect "7:1007" "test 95-2"
simple_expect "6:1006" "test 94-2"
simple_expect "5:1005" "test 93-2"
simple_expect "4:1004" "test 92-2"
simple_expect "3:1003" "test 91-2"
simple_expect "2:1002" "test 90-2"
simple_expect "1:1001" "test 89-2"
l2g_send "i0 12 30"
simple_expect "12:1012" "test 133"
simple_expect "13:1013" "test 134"
......@@ -195,6 +287,26 @@ simple_expect "27:1027" "test 148"
simple_expect "28:1028" "test 149"
simple_expect "29:1029" "test 150"
l2g_send "b0 12 30"
simple_expect "29:1029" "test 150-2"
simple_expect "28:1028" "test 149-2"
simple_expect "27:1027" "test 148-2"
simple_expect "26:1026" "test 147-2"
simple_expect "25:1025" "test 146-2"
simple_expect "24:1024" "test 145-2"
simple_expect "23:1023" "test 144-2"
simple_expect "22:1022" "test 143-2"
simple_expect "21:1021" "test 142-2"
simple_expect "20:1020" "test 141-2"
simple_expect "19:1019" "test 140-2"
simple_expect "18:1018" "test 139-2"
simple_expect "17:1017" "test 138-2"
simple_expect "16:1016" "test 137-2"
simple_expect "15:1015" "test 136-2"
simple_expect "14:1014" "test 135-2"
simple_expect "13:1013" "test 134-2"
simple_expect "12:1012" "test 133-2"
l2g_send "d0 1"
l2g_send "d0 11"
l2g_send "d0 25"
......@@ -242,6 +354,47 @@ simple_expect "41:1041" "test 187"
simple_expect "42:1042" "test 188"
simple_expect "43:1043" "test 189"
l2g_send "b0 0 999"
simple_expect "43:1043" "test 189-2"
simple_expect "42:1042" "test 188-2"
simple_expect "41:1041" "test 187-2"
simple_expect "39:1039" "test 186-2"
simple_expect "38:1038" "test 185-2"
simple_expect "37:1037" "test 184-2"
simple_expect "36:1036" "test 183-2"
simple_expect "35:1035" "test 182-2"
simple_expect "34:1034" "test 181-2"
simple_expect "33:1033" "test 180-2"
simple_expect "32:1032" "test 179-2"
simple_expect "31:1031" "test 178-2"
simple_expect "30:1030" "test 177-2"
simple_expect "29:1029" "test 176-2"
simple_expect "28:1028" "test 175-2"
simple_expect "27:1027" "test 174-2"
simple_expect "26:1026" "test 173-2"
simple_expect "24:1024" "test 172-2"
simple_expect "23:1023" "test 171-2"
simple_expect "22:1022" "test 170-2"
simple_expect "21:1021" "test 169-2"
simple_expect "20:1020" "test 168-2"
simple_expect "19:1019" "test 167-2"
simple_expect "18:1018" "test 166-2"
simple_expect "17:1017" "test 165-2"
simple_expect "16:1016" "test 164-2"
simple_expect "15:1015" "test 163-2"
simple_expect "14:1014" "test 162-2"
simple_expect "13:1013" "test 161-2"
simple_expect "12:1012" "test 160-2"
simple_expect "10:1010" "test 159-2"
simple_expect "9:1009" "test 158-2"
simple_expect "8:1008" "test 157-2"
simple_expect "7:1007" "test 156-2"
simple_expect "6:1006" "test 155-2"
simple_expect "5:1005" "test 154-2"
simple_expect "4:1004" "test 153-2"
simple_expect "3:1003" "test 152-2"
simple_expect "2:1002" "test 151-2"
l2g_send "u0"
simple_expect "Number of blocks: 5" "test 190"
simple_expect "First unused: 45" "test 191"
......@@ -353,6 +506,52 @@ simple_expect "1663:1760" "test 238"
simple_expect "1718:1763" "test 239"
simple_expect "1755:1844" "test 240"
l2g_send "b1 50 2000"
simple_expect "1755:1844" "test 240-2"
simple_expect "1718:1763" "test 239-2"
simple_expect "1663:1760" "test 238-2"
simple_expect "1609:1690" "test 237-2"
simple_expect "1571:1679" "test 236-2"
simple_expect "1534:1641" "test 235-2"
simple_expect "1475:1503" "test 234-2"
simple_expect "1420:1443" "test 233-2"
simple_expect "1371:1458" "test 232-2"
simple_expect "1334:1441" "test 231-2"
simple_expect "1300:1379" "test 230-2"
simple_expect "1246:1336" "test 229-2"
simple_expect "1201:1241" "test 228-2"
simple_expect "1169:1203" "test 227-2"
simple_expect "1139:1197" "test 226-2"
simple_expect "1106:1198" "test 225-2"
simple_expect "1052:1129" "test 224-2"
simple_expect "1019:1048" "test 223-2"
simple_expect "994:1094" "test 222-2"
simple_expect "976:1046" "test 221-2"
simple_expect "917:963" "test 220-2"
simple_expect "905:1000" "test 219-2"
simple_expect "876:899" "test 218-2"
simple_expect "837:927" "test 217-2"
simple_expect "813:908" "test 216-2"
simple_expect "799:878" "test 215-2"
simple_expect "740:808" "test 214-2"
simple_expect "713:769" "test 213-2"
simple_expect "659:765" "test 212-2"
simple_expect "610:677" "test 211-2"
simple_expect "570:658" "test 210-2"
simple_expect "542:620" "test 209-2"
simple_expect "514:580" "test 208-2"
simple_expect "503:582" "test 207-2"
simple_expect "448:538" "test 206-2"
simple_expect "411:434" "test 205-2"
simple_expect "353:455" "test 204-2"
simple_expect "330:398" "test 203-2"
simple_expect "278:361" "test 202-2"
simple_expect "233:301" "test 201-2"
simple_expect "180:240" "test 200-2"
simple_expect "153:215" "test 199-2"
simple_expect "109:158" "test 198-2"
simple_expect "66:107" "test 197-2"
l2g_send "u1"
simple_expect "Number of blocks: 5" "test 241"
simple_expect "First unused: 1756" "test 242"
......@@ -410,6 +609,48 @@ simple_expect "1609:1690" "test 284"
simple_expect "1663:1760" "test 285"
simple_expect "1718:1763" "test 286"
l2g_send "b1 0 2000"
simple_expect "1718:1763" "test 286-2"
simple_expect "1663:1760" "test 285-2"
simple_expect "1609:1690" "test 284-2"
simple_expect "1534:1641" "test 282-2"
simple_expect "1475:1503" "test 281-2"
simple_expect "1420:1443" "test 280-2"
simple_expect "1371:1458" "test 279-2"
simple_expect "1334:1441" "test 278-2"
simple_expect "1300:1379" "test 277-2"
simple_expect "1246:1336" "test 276-2"
simple_expect "1201:1241" "test 275-2"
simple_expect "1169:1203" "test 274-2"
simple_expect "1139:1197" "test 273b-2"
simple_expect "1106:1198" "test 273-2"
simple_expect "1052:1129" "test 272-2"
simple_expect "1019:1048" "test 271-2"
simple_expect "994:1094" "test 270-2"
simple_expect "917:963" "test 269-2"
simple_expect "905:1000" "test 268-2"
simple_expect "876:899" "test 267-2"
simple_expect "837:927" "test 266-2"
simple_expect "813:908" "test 265-2"
simple_expect "799:878" "test 264-2"
simple_expect "740:808" "test 263-2"
simple_expect "713:769" "test 262-2"
simple_expect "659:765" "test 261-2"
simple_expect "610:677" "test 260-2"
simple_expect "570:658" "test 259-2"
simple_expect "542:620" "test 258-2"
simple_expect "514:580" "test 257-2"
simple_expect "448:538" "test 256-2"
simple_expect "411:434" "test 255-2"
simple_expect "353:455" "test 254-2"
simple_expect "330:398" "test 253-2"
simple_expect "278:361" "test 252-2"
simple_expect "233:301" "test 251-2"
simple_expect "180:240" "test 250-2"
simple_expect "153:215" "test 249-2"
simple_expect "109:158" "test 248-2"
l2g_send "u1"
simple_expect "Number of blocks: 5" "test 287"
simple_expect "First unused: 1756" "test 288"
......
......@@ -28,16 +28,30 @@ l2g_send "I0"
l2g_send "a0 10 1010"
l2g_send "i0"
simple_expect "10:1010" "test 1"
l2g_send "b0 0 200"
simple_expect "10:1010" "test 1-2"
l2g_send "i0 3 8"
# There is nothing in the range [3..8), so no output should exist here.
l2g_send "b0 3 8"
# There is nothing in the range [3..8), so no output should exist here.
l2g_send "a0 20 2020"
l2g_send "i0"
simple_expect "10:1010" "test 2"
simple_expect "20:2020" "test 3"
l2g_send "b0 0 21"
simple_expect "20:2020" "test 3-2"
simple_expect "10:1010" "test 2-2"
l2g_send "i0 3 8"
l2g_send "i0 3 10"
l2g_send "i0 11 20"
l2g_send "i0 2 12"
simple_expect "10:1010" "test 4"
l2g_send "b0 3 8"
l2g_send "b0 3 10"
l2g_send "b0 11 20"
l2g_send "b0 2 12"
simple_expect "10:1010" "test 5-2"
l2g_send "b0 0 20"
simple_expect "10:1010" "test 6"
l2g_send "D0"
l2g_stop
......@@ -205,6 +205,61 @@ l2g_send "i0 446 475"
simple_expect "474:78372"
l2g_send "i0 446 474"
# Check reverse iterators
l2g_send "b0 0 9999"
simple_expect "1025:119385"
simple_expect "1024:117886"
simple_expect "1023:117278"
simple_expect "1022:117110"
simple_expect "1021:116365"
simple_expect "1020:113738"
simple_expect "1019:111225"
simple_expect "1018:111141"
simple_expect "1017:109959"
simple_expect "1016:108592"
simple_expect "1015:108471"
simple_expect "1014:107571"
simple_expect "1013:107469"
simple_expect "1012:107324"
simple_expect "1011:107212"
simple_expect "1010:107002"
simple_expect "1009:106784"
simple_expect "1008:106390"
simple_expect "1007:105859"
simple_expect "1006:105551"
simple_expect "1005:104444"
simple_expect "1004:103935"
simple_expect "1003:103254"
simple_expect "1002:102864"
simple_expect "1001:101613"
simple_expect "992:97960"
simple_expect "948:97085"
simple_expect "933:95724"
simple_expect "923:94866"
simple_expect "922:93794"
simple_expect "792:89215"
simple_expect "688:88856"
simple_expect "618:87514"
simple_expect "474:78372"
simple_expect "395:76393"
simple_expect "389:73612"
simple_expect "383:73113"
simple_expect "358:72910"
simple_expect "329:72239"
simple_expect "304:72037"
simple_expect "259:70441"
simple_expect "222:59570"
simple_expect "50:57456"
simple_expect "35:53428"
l2g_send "b0 444 475"
simple_expect "474:78372"
l2g_send "b0 445 475"
simple_expect "474:78372"
l2g_send "b0 446 475"
simple_expect "474:78372"
l2g_send "b0 446 474"
# Remove three items from block 2 and ensure that no compaction happens.
l2g_send "d0 923"
l2g_send "d0 1001"
......@@ -386,11 +441,16 @@ l2g_send "a0 1030 33329"
simple_expect "\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] \[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\] \[0-9\]\[0-9\]* l2g_append: won't add 33329<1030> when first_unused=1041"
l2g_send "i0 0 10"
simple_expect "\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] \[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\] \[0-9\]\[0-9\]* l2gi_searchsome\\\(0, 10\\\) called: min is 1"
l2g_send "b0 0 10"
l2g_send "i0 1 10"
l2g_send "b0 1 10"
l2g_send "i0 0 100"
simple_expect "\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] \[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\] \[0-9\]\[0-9\]* l2gi_searchsome\\\(0, 100\\\) called: min is 1"
simple_expect "35:53428"
simple_expect "50:57456"
l2g_send "b0 0 100"
simple_expect "50:57456"
simple_expect "35:53428"
l2g_send "I1"
......@@ -441,7 +501,10 @@ simple_expect "0"
l2g_send "i1 1010 1012"
simple_expect "1011:207212"
l2g_send "b1 1010 1012"
simple_expect "1011:207212"
l2g_send "i1 1020 0"
l2g_send "b1 1020 0"
# Trim the blocks one more from the tail. There are now two removed numbers.
l2g_send "d1 1009"
......@@ -470,11 +533,17 @@ simple_expect "0"
l2g_send "i1 1010 1012"
simple_expect "1011:207212"
l2g_send "b1 1010 1012"
simple_expect "1011:207212"
l2g_send "i1 1020 0"
l2g_send "b1 1020 0"
l2g_send "i1 1009 1012"
simple_expect "1011:207212"
l2g_send "b1 1009 1012"
simple_expect "1011:207212"
l2g_send "i1 1019 0"
l2g_send "b1 1019 0"
# Trim the blocks one more from the tail. There are now three removed numbers.
l2g_send "d1 1008"
......@@ -505,15 +574,24 @@ simple_expect "0"
l2g_send "i1 1010 1012"
simple_expect "1011:207212"
l2g_send "b1 1010 1012"
simple_expect "1011:207212"
l2g_send "i1 1020 0"
l2g_send "b1 1020 0"
l2g_send "i1 1009 1012"
simple_expect "1011:207212"
l2g_send "b1 1009 1012"
simple_expect "1011:207212"
l2g_send "i1 1019 0"
l2g_send "b1 1019 0"
l2g_send "i1 1008 1012"
simple_expect "1011:207212"
l2g_send "b1 1008 1012"
simple_expect "1011:207212"
l2g_send "i1 1018 0"
l2g_send "b1 1018 0"
# Remove the first entry in the second block
l2g_send "d1 1011"
......@@ -532,16 +610,23 @@ l2g_send "n1 1011"
simple_expect "1012"
l2g_send "i1 1010 1012"
l2g_send "b1 1010 1012"
l2g_send "i1 1009 1012"
l2g_send "b1 1009 1012"
l2g_send "i1 1008 1012"
l2g_send "b1 1008 1012"
l2g_send "i1 1007 1012"
simple_expect "1007:205859"
l2g_send "b1 1007 1012"
simple_expect "1007:205859"
l2g_send "i1 1008 1013"
simple_expect "1012:207324"
l2g_send "b1 1008 1013"
simple_expect "1012:207324"
# Clear 0.
l2g_send "C0"
......
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