#define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
else _assert(#ex, __FILE__,__LINE__); }
while (!a
.empty() && k
++ < maxprint
)
while (!a
.empty()) a
.del_front();
for (int i
= 0; i
< SIZE
; ++i
)
assert(d
.length() == SIZE
);
assert(d
.front() == (SIZE
-1));
assert(d
.rear() == (SIZE
-2));
for (i
= (SIZE
-1); i
>= 0; --i
)
assert(d1
.length() == SIZE
);
assert(d1
.front() == (SIZE
-1));
assert(d2
.length() == SIZE
);
assert(d2
.front() == (SIZE
-1));
assert(d1
.length() == SIZE
);
assert(d1
.front() == (SIZE
-1));
cout
<< "d1:"; print(d1
);
for (int i
= 0; i
< SIZE
; ++i
)
assert(d
.length() == SIZE
);
assert(d
.front() == (SIZE
-1));
assert(d
.rear() == (SIZE
-2));
for (i
= (SIZE
-1); i
>= 0; --i
)
assert(d1
.length() == SIZE
);
assert(d1
.front() == (SIZE
-1));
assert(d2
.length() == SIZE
);
assert(d2
.front() == (SIZE
-1));
assert(d1
.length() == SIZE
);
assert(d1
.front() == (SIZE
-1));
cout
<< "d1:"; print(d1
);
main(int argv
, char** argc
)
SIZE
= abs(atoi(argc
[1]));
cout
<< "XP deques:\n"; XPtest();
if (ptimes
) cout
<< "\ntime = " << return_elapsed_time(0.0) << "\n";
cout
<< "DL deques:\n"; DLtest();
if (ptimes
) cout
<< "\ntime = " << return_elapsed_time(0.0) << "\n";
cout
<< "\nEnd of test\n";