AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
aud.test.StackTest Class Reference

Public Member Functions

void testStack ()
 
void testInvalid_top ()
 
void testInvalid_pop ()
 

Static Public Member Functions

static void main (String args[])
 

Detailed Description

Definition at line 9 of file StackTest.java.

Member Function Documentation

◆ main()

static void aud.test.StackTest.main ( String  args[])
static

Definition at line 43 of file StackTest.java.

43 {
44 org.junit.runner.JUnitCore.main("aud.test.StackTest");
45 }

◆ testInvalid_pop()

void aud.test.StackTest.testInvalid_pop ( )

Definition at line 38 of file StackTest.java.

38 {
39 Stack<Integer> stack=new Stack<Integer>();
40 stack.pop();
41 }

References aud.Stack< T >.pop().

+ Here is the call graph for this function:

◆ testInvalid_top()

void aud.test.StackTest.testInvalid_top ( )

Definition at line 33 of file StackTest.java.

33 {
34 Stack<Integer> stack=new Stack<Integer>();
35 stack.top();
36 }

References aud.Stack< T >.top().

+ Here is the call graph for this function:

◆ testStack()

void aud.test.StackTest.testStack ( )

Definition at line 12 of file StackTest.java.

12 {
13 Stack<Integer> stack=new Stack<Integer>();
14
15 assertTrue(stack.is_empty());
16 stack.push(1);
17 assertFalse(stack.is_empty());
18 assertEquals(stack.top().intValue(),1);
19
20 stack.pop();
21 assertTrue(stack.is_empty());
22
23 stack.push(1);
24 stack.push(2);
25 stack.push(3);
26 assertTrue(stack.pop()==3);
27 assertTrue(stack.pop()==2);
28 assertTrue(stack.pop()==1);
29 assertTrue(stack.is_empty());
30 }

References aud.Stack< T >.is_empty(), aud.Stack< T >.pop(), aud.Stack< T >.push(), and aud.Stack< T >.top().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: