repo.or.cz
/
lilypond.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
lilypond-1.3.0
[lilypond.git]
/
flowertest
/
pqtest.cc
blob
ea28bcb0fa27a380e9dd6759e97275d7ec118ff0
1
#include
"flower-test.hh"
2
#include
"pqueue.hh"
3
#include <stdlib.h>
4
5
int
compare
(
int
i
,
int
j
)
6
{
7
return
i
-
j
;
8
}
9
10
void
11
pqtest
()
12
{
13
PQueue
<
int
>
pq
;
14
15
for
(
int
i
=
0
;
i
<
10
;
i
++) {
16
int
r
=
rand
()/
10000
;
17
pq
.
insert
(
r
);
18
cout
<<
"adding: "
<<
r
<<
endl
;
19
}
20
while
(
pq
.
size
()) {
21
cout
<<
"getting : "
<<
flush
;
22
cout
<<
pq
.
get
() <<
"
\n
"
;
23
}
24
}
25
26
ADD_TEST
(
pqtest
);