My favorites
▼
|
Sign in
sibirjak
Russischer Bär source code repository
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
asperform
/
com
/
sibirjak
/
asperform
/
collectiontests
/
dpdk
/
DpdkPriorityQueueTest.as
r27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.sibirjak.asperform.collectiontests.dpdk {
import nl.dpdk.collections.iteration.IIterator;
import nl.dpdk.collections.lists.Heap;
import com.sibirjak.asperform.collectiontests.CollectionTestCase;
import com.sibirjak.asperform.collectiontests.as3commons.TestComparator;
/**
* @author jes 25.03.2010
*/
public class DpdkPriorityQueueTest extends CollectionTestCase {
private var _heap : Heap;
/*
* Test neutralisation
*/
override protected function createCollection() : * {
_heap = new Heap((new TestComparator()).compare);
return _heap;
}
override protected function fill() : void {
for (var i : uint = 0; i < _numItems; i++) {
_heap.add(_data[i]);
}
}
override protected function get size() : uint {
return _heap.size();
}
/*
* Tests
*/
public function test_create() : void {
for (var i : uint = 0; i < iterations; i++) {
_heap = new Heap((new TestComparator()).compare);
}
}
public function test_add() : void {
for (var i : uint = 0; i < _numItems; i++) {
_heap.add(_data[i]);
}
}
public function test_has() : void {
for (var i : uint = 0; i < _numItems; i++) {
_heap.contains(_data[i]);
}
}
public function test_iterate() : void {
for (var i : uint = 0; i < iterations; i++) {
var iterator : IIterator = _heap.iterator();
while (iterator.hasNext()) {
iterator.next();
}
}
}
public function test_removeFirst() : void {
for (var i : uint = 0; i < _numItems; i++) {
_heap.removeMaximum();
}
}
}
}
Show details
Hide details
Change log
r13
by jens.struwe on May 4, 2010
Diff
[DEV] More tests and examples
Go to:
...form/collectiontests/BSTTests.as
...ectiontests/CollectionTests.mxml
...llectiontests/LinkedListTests.as
...form/collectiontests/MapTests.as
...ctiontests/PriorityQueueTests.as
...form/collectiontests/SetTests.as
...llectiontests/SortedListTests.as
...ollectiontests/SortedMapTests.as
...ollectiontests/SortedSetTests.as
...llectiontests/SortedSetTests2.as
...ts/dpdk/DpdkPriorityQueueTest.as
...lectiontests/dpdk/DpdkSetTest.as
.../examples/OrderedSetRawTests2.as
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1566 bytes, 72 lines
View raw file
Powered by
Google Project Hosting