- Timestamp:
- May 4, 2020, 8:45:20 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d3ab183
- Parents:
- 3f7d0b4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/list/dlist-insert-remove.cfa
r3f7d0b4 r4d741e9 258 258 dlist(fred_in_mine, fred) lf; 259 259 260 verify(validate(lf)); 261 260 262 printMyFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 261 263 printYourFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 … … 264 266 insert_first(lf, f1); 265 267 268 verify(validate(lf)); 269 266 270 printMyFreddies(f1, f2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) 267 271 printYourFreddies(f1, f2, 0); // 3.14; 3.14; 0.5; 0.5 (unmodified) … … 275 279 dlist(fred_in_yours, fred) lf; 276 280 281 verify(validate(lf)); 282 277 283 printMyFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 278 284 printYourFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 … … 281 287 insert_first(lf, f1); 282 288 289 verify(validate(lf)); 290 283 291 printMyFreddies(f1, f2, 0); // 3.14; 3.14; 0.5; 0.5 (unmodified) 284 292 printYourFreddies(f1, f2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) … … 292 300 dlist(mary, mary) lm; 293 301 302 verify(validate(lm)); 294 303 printMariatheotokos(m1, m2, 1); // 3.14; 3.14; 0.5; 0.5 295 304 … … 298 307 299 308 printMariatheotokos(m1, m2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) 309 verify(validate(lm)); 300 310 } 301 311 … … 317 327 dlist(fred_in_mine, fred) lf; 318 328 329 verify(validate(lf)); 330 319 331 printMyFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 320 332 printYourFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 … … 323 335 insert_last(lf, f2); 324 336 337 verify(validate(lf)); 338 325 339 printMyFreddies(f1, f2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) 326 340 printYourFreddies(f1, f2, 0); // 3.14; 3.14; 0.5; 0.5 (unmodified) … … 334 348 dlist(fred_in_yours, fred) lf; 335 349 350 verify(validate(lf)); 351 336 352 printMyFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 337 353 printYourFreddies(f1, f2, 1); // 3.14; 3.14; 0.5; 0.5 … … 340 356 insert_last(lf, f2); 341 357 358 verify(validate(lf)); 359 342 360 printMyFreddies(f1, f2, 0); // 3.14; 3.14; 0.5; 0.5 (unmodified) 343 361 printYourFreddies(f1, f2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) … … 351 369 dlist(mary, mary) lm; 352 370 371 verify(validate(lm)); 353 372 printMariatheotokos(m1, m2, 1); // 3.14; 3.14; 0.5; 0.5 354 373 … … 356 375 insert_last(lm, m2); 357 376 377 verify(validate(lm)); 358 378 printMariatheotokos(m1, m2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) 359 379 } … … 384 404 assert(& lf`last == & f1); 385 405 406 verify(validate(lf)); 407 386 408 insert_after(f1`in_mine, f2); 409 410 verify(validate(lf)); 387 411 388 412 printMyFreddies(f1, f2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) … … 408 432 assert(& lf`last == & f1); 409 433 434 verify(validate(lf)); 435 410 436 insert_after(f1`in_yours, f2); 437 438 verify(validate(lf)); 411 439 412 440 printMyFreddies(f1, f2, 0); // 3.14; 3.14; 0.5; 0.5 (unmodified) … … 432 460 assert(& lm`last == & m1); 433 461 462 verify(validate(lm)); 463 434 464 insert_after(m1, m2); 465 466 verify(validate(lm)); 435 467 436 468 printMariatheotokos(m1, m2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) … … 465 497 assert(& lf`last == & f2); 466 498 499 verify(validate(lf)); 500 467 501 insert_before(f2`in_mine, f1); 502 503 verify(validate(lf)); 468 504 469 505 printMyFreddies(f1, f2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) … … 489 525 assert(& lf`last == & f2); 490 526 527 verify(validate(lf)); 528 491 529 insert_before(f2`in_yours, f1); 530 531 verify(validate(lf)); 492 532 493 533 printMyFreddies(f1, f2, 0); // 3.14; 3.14; 0.5; 0.5 (unmodified) … … 513 553 assert(& lm`last == & m2); 514 554 555 verify(validate(lm)); 556 515 557 insert_before(m2, m1); 558 559 verify(validate(lm)); 516 560 517 561 printMariatheotokos(m1, m2, 0); // 3.14, 0.5; 3.14; 0.5; 0.5, 3.14 (modified) … … 822 866 printYourFreddies(fly`first, fly`last, 1); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 823 867 868 verify(validate(fly)); 869 verify(validate(flm)); 870 824 871 remove(f1`in_mine); 872 873 verify(validate(fly)); 874 verify(validate(flm)); 825 875 826 876 printMyFreddies(flm`first, flm`last, 0); // 2.7, 3.7; 2.7; 3.7; 3.7, 2.7 (modified) … … 854 904 printYourFreddies(fly`first, fly`last, 1); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 855 905 906 verify(validate(fly)); 907 verify(validate(flm)); 908 856 909 remove(f1`in_yours); 910 911 verify(validate(fly)); 912 verify(validate(flm)); 857 913 858 914 printMyFreddies(flm`first, flm`last, 0); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 (unmodified) … … 880 936 printMariatheotokos(ml`first, ml`last, 1); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 881 937 938 verify(validate(ml)); 939 882 940 remove(m1); 941 942 verify(validate(ml)); 883 943 884 944 printMariatheotokos(ml`first, ml`last, 0); // 2.7, 3.7; 2.7; 3.7; 3.7, 2.7 (modified) … … 921 981 printYourFreddies(fly`first, fly`last, 1); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 922 982 983 verify(validate(fly)); 984 verify(validate(flm)); 985 923 986 remove(f3`in_mine); 987 988 verify(validate(fly)); 989 verify(validate(flm)); 924 990 925 991 printMyFreddies(flm`first, flm`last, 0); // 1.7, 2.7; 1.7; 2.7; 2.7, 1.7 (modified) … … 953 1019 printYourFreddies(fly`first, fly`last, 1); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 954 1020 1021 verify(validate(fly)); 1022 verify(validate(flm)); 1023 955 1024 remove(f3`in_yours); 1025 1026 verify(validate(fly)); 1027 verify(validate(flm)); 956 1028 957 1029 printMyFreddies(flm`first, flm`last, 0); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 (unmodified) … … 979 1051 printMariatheotokos(ml`first, ml`last, 1); // 1.7, 2.7, 3.7; 1.7; 3.7; 3.7, 2.7, 1.7 980 1052 1053 verify(validate(ml)); 1054 981 1055 remove(m3); 1056 1057 verify(validate(ml)); 982 1058 983 1059 printMariatheotokos(ml`first, ml`last, 0); // 1.7, 2.7; 1.7; 2.7; 2.7, 1.7 (modified) … … 1014 1090 printYourFreddies(fly`first, fly`last, 1); // 0.7; 0.7; 0.7; 0.7 1015 1091 1092 verify(validate(fly)); 1093 verify(validate(flm)); 1094 1016 1095 remove(f`in_mine); 1096 1097 verify(validate(fly)); 1098 verify(validate(flm)); 1017 1099 1018 1100 assert(& flm`first == 0p); … … 1029 1111 1030 1112 insert_last(flm, f); 1113 verify(validate(fly)); 1114 verify(validate(flm)); 1031 1115 printMyFreddies(flm`first, flm`last, 0); // 0.7; 0.7; 0.7; 0.7 1032 1116 } … … 1045 1129 printYourFreddies(fly`first, fly`last, 1); // 0.7; 0.7; 0.7; 0.7 1046 1130 1131 verify(validate(fly)); 1132 verify(validate(flm)); 1133 1047 1134 remove(f`in_yours); 1135 1136 verify(validate(fly)); 1137 verify(validate(flm)); 1048 1138 1049 1139 assert(& fly`first == 0p); … … 1060 1150 1061 1151 insert_last(fly, f); 1152 verify(validate(fly)); 1153 verify(validate(flm)); 1062 1154 printYourFreddies(fly`first, fly`last, 0); // 0.7; 0.7; 0.7; 0.7 1063 1155 } … … 1072 1164 printMariatheotokos(ml`first, ml`last, 1); // 0.7; 0.7; 0.7; 0.7 1073 1165 1166 verify(validate(ml)); 1167 1074 1168 remove(m); 1169 1170 verify(validate(ml)); 1075 1171 1076 1172 assert(& ml`first == 0p); … … 1085 1181 1086 1182 insert_last(ml, m); 1183 verify(validate(ml)); 1087 1184 printMariatheotokos(ml`first, ml`last, 0); // 0.7; 0.7; 0.7; 0.7 1088 1185 }
Note: See TracChangeset
for help on using the changeset viewer.