summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/envelope-test.c2
-rw-r--r--src/tests/lock-autospawn-test.c2
-rw-r--r--src/tests/mcalign-test.c2
-rw-r--r--src/tests/memblock-test.c6
-rw-r--r--src/tests/memblockq-test.c2
-rw-r--r--src/tests/mix-test.c2
-rw-r--r--src/tests/prioq-test.c44
-rw-r--r--src/tests/remix-test.c2
-rw-r--r--src/tests/resampler-test.c2
9 files changed, 54 insertions, 10 deletions
diff --git a/src/tests/envelope-test.c b/src/tests/envelope-test.c
index d71eff1c..4a72f5a3 100644
--- a/src/tests/envelope-test.c
+++ b/src/tests/envelope-test.c
@@ -205,7 +205,7 @@ int main(int argc, char *argv[]) {
oil_init();
pa_log_set_maximal_level(PA_LOG_DEBUG);
- pa_assert_se(pool = pa_mempool_new(FALSE));
+ pa_assert_se(pool = pa_mempool_new(FALSE, 0));
pa_assert_se(envelope = pa_envelope_new(&ss));
block = generate_block(pool, &ss);
diff --git a/src/tests/lock-autospawn-test.c b/src/tests/lock-autospawn-test.c
index cb3dc87c..80cfda6a 100644
--- a/src/tests/lock-autospawn-test.c
+++ b/src/tests/lock-autospawn-test.c
@@ -28,7 +28,7 @@
#include <pulsecore/macro.h>
#include <pulsecore/thread.h>
-#include <pulse/lock-autospawn.h>
+#include <pulsecore/lock-autospawn.h>
#include <pulse/util.h>
static void thread_func(void*k) {
diff --git a/src/tests/mcalign-test.c b/src/tests/mcalign-test.c
index c0665822..92e3e14e 100644
--- a/src/tests/mcalign-test.c
+++ b/src/tests/mcalign-test.c
@@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
pa_mcalign *a;
pa_memchunk c;
- p = pa_mempool_new(0);
+ p = pa_mempool_new(FALSE, 0);
a = pa_mcalign_new(11);
diff --git a/src/tests/memblock-test.c b/src/tests/memblock-test.c
index 6da1b1e9..37b5b403 100644
--- a/src/tests/memblock-test.c
+++ b/src/tests/memblock-test.c
@@ -78,9 +78,9 @@ int main(int argc, char *argv[]) {
const char txt[] = "This is a test!";
- pool_a = pa_mempool_new(1);
- pool_b = pa_mempool_new(1);
- pool_c = pa_mempool_new(1);
+ pool_a = pa_mempool_new(TRUE, 0);
+ pool_b = pa_mempool_new(TRUE, 0);
+ pool_c = pa_mempool_new(TRUE, 0);
pa_mempool_get_shm_id(pool_a, &id_a);
pa_mempool_get_shm_id(pool_b, &id_b);
diff --git a/src/tests/memblockq-test.c b/src/tests/memblockq-test.c
index 7bf992a1..c53945b4 100644
--- a/src/tests/memblockq-test.c
+++ b/src/tests/memblockq-test.c
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
pa_log_set_maximal_level(PA_LOG_DEBUG);
- p = pa_mempool_new(0);
+ p = pa_mempool_new(FALSE, 0);
silence.memblock = pa_memblock_new_fixed(p, (char*) "__", 2, 1);
assert(silence.memblock);
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 544121fd..759d7690 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -201,7 +201,7 @@ int main(int argc, char *argv[]) {
oil_init();
pa_log_set_maximal_level(PA_LOG_DEBUG);
- pa_assert_se(pool = pa_mempool_new(FALSE));
+ pa_assert_se(pool = pa_mempool_new(FALSE, 0));
a.channels = 1;
a.rate = 44100;
diff --git a/src/tests/prioq-test.c b/src/tests/prioq-test.c
new file mode 100644
index 00000000..120b512b
--- /dev/null
+++ b/src/tests/prioq-test.c
@@ -0,0 +1,44 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <pulsecore/prioq.h>
+#include <pulsecore/macro.h>
+
+#define N 1024
+
+int main(int argc, char *argv[]) {
+ pa_prioq *q;
+ unsigned i;
+
+ srand(0);
+
+ q = pa_prioq_new(pa_idxset_trivial_compare_func);
+
+ /* Fill in 1024 */
+ for (i = 0; i < N; i++)
+ pa_prioq_put(q, PA_UINT_TO_PTR((unsigned) rand()));
+
+ /* Remove half of it again */
+ for (i = 0; i < N/2; i++){
+ unsigned u = PA_PTR_TO_UINT(pa_prioq_pop(q));
+ pa_log("%16u", u);
+ }
+
+ pa_log("Refilling");
+
+ /* Fill in another 1024 */
+ for (i = 0; i < N; i++)
+ pa_prioq_put(q, PA_UINT_TO_PTR((unsigned) rand()));
+
+
+ /* Remove everything */
+ while (!pa_prioq_isempty(q)) {
+ unsigned u = PA_PTR_TO_UINT(pa_prioq_pop(q));
+ pa_log("%16u", u);
+ }
+
+ pa_prioq_free(q, NULL, NULL);
+
+ return 0;
+}
diff --git a/src/tests/remix-test.c b/src/tests/remix-test.c
index 4777c150..3538d7d4 100644
--- a/src/tests/remix-test.c
+++ b/src/tests/remix-test.c
@@ -58,7 +58,7 @@ int main(int argc, char *argv[]) {
oil_init();
pa_log_set_maximal_level(PA_LOG_DEBUG);
- pa_assert_se(pool = pa_mempool_new(FALSE));
+ pa_assert_se(pool = pa_mempool_new(FALSE, 0));
for (i = 0; maps[i].channels > 0; i++)
for (j = 0; maps[j].channels > 0; j++) {
diff --git a/src/tests/resampler-test.c b/src/tests/resampler-test.c
index 6959127b..2d591867 100644
--- a/src/tests/resampler-test.c
+++ b/src/tests/resampler-test.c
@@ -201,7 +201,7 @@ int main(int argc, char *argv[]) {
oil_init();
pa_log_set_maximal_level(PA_LOG_DEBUG);
- pa_assert_se(pool = pa_mempool_new(FALSE));
+ pa_assert_se(pool = pa_mempool_new(FALSE, 0));
a.channels = b.channels = 1;
a.rate = b.rate = 44100;