5
Test.add_func (UTIL_TEST_STACK_PREFIX + "new", () => {
6
var stk = new Stack<int> ();
9
Test.message ("Could not create stack");
12
if (stk.is_empty () == false) {
14
Test.message ("The newly created Stack" +
15
" has the reports it's not empty.");
19
Test.add_func (UTIL_TEST_STACK_PREFIX + "push_pop", () => {
20
var stk = new Stack<int> ();
22
if (stk.is_empty ()) {
24
Test.message ("Stack reports that it's empty, " +
25
"when it shouln't be.");
30
if (stk.is_empty () == false) {
32
Test.message ("Stack reports that it's not empty," +
33
" when it's only value has been poped.");
39
Test.add_func (UTIL_TEST_STACK_PREFIX + "value", () => {
40
var stk = new Stack<int> ();
44
if (stk.peek () != 1337) {
46
Test.message ("Peeked value did not match exepcted value.");
49
if (stk.pop () != 1337) {
51
Test.message ("Poped value does not match expected value.");
54
foreach (var i in new Range (0, 10000) ) {
58
foreach (var i in new Range (10000, 0)) {
59
int got_val = stk.pop ();
62
Test.message ("Wrong value: Expeted %i, get %i.",