[pulseaudio-commits] r1267 - in /trunk/src/tests: mcalign-test.c memblockq-test.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Fri Aug 18 12:56:12 PDT 2006
Author: lennart
Date: Fri Aug 18 21:56:11 2006
New Revision: 1267
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1267&root=pulseaudio&view=rev
Log:
update tests for new memory manager
Modified:
trunk/src/tests/mcalign-test.c
trunk/src/tests/memblockq-test.c
Modified: trunk/src/tests/mcalign-test.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/tests/mcalign-test.c?rev=1267&root=pulseaudio&r1=1266&r2=1267&view=diff
==============================================================================
--- trunk/src/tests/mcalign-test.c (original)
+++ trunk/src/tests/mcalign-test.c Fri Aug 18 21:56:11 2006
@@ -38,9 +38,14 @@
/* A simple program for testing pa_mcalign */
int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
- pa_mcalign *a = pa_mcalign_new(11, NULL);
+ pa_mempool *p;
+ pa_mcalign *a;
pa_memchunk c;
+ p = pa_mempool_new(0);
+
+ a = pa_mcalign_new(11);
+
pa_memchunk_reset(&c);
srand(time(NULL));
@@ -50,7 +55,7 @@
size_t l;
if (!c.memblock) {
- c.memblock = pa_memblock_new(2048, NULL);
+ c.memblock = pa_memblock_new(p, 2048);
c.index = c.length = 0;
}
@@ -94,5 +99,7 @@
if (c.memblock)
pa_memblock_unref(c.memblock);
+ pa_mempool_free(p);
+
return 0;
}
Modified: trunk/src/tests/memblockq-test.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/tests/memblockq-test.c?rev=1267&root=pulseaudio&r1=1266&r2=1267&view=diff
==============================================================================
--- trunk/src/tests/memblockq-test.c (original)
+++ trunk/src/tests/memblockq-test.c Fri Aug 18 21:56:11 2006
@@ -32,34 +32,38 @@
int main(int argc, char *argv[]) {
int ret;
+
+ pa_mempool *p;
pa_memblockq *bq;
pa_memchunk chunk1, chunk2, chunk3, chunk4;
pa_memblock *silence;
pa_log_set_maximal_level(PA_LOG_DEBUG);
+
+ p = pa_mempool_new(0);
- silence = pa_memblock_new_fixed((char*) "__", 2, 1, NULL);
+ silence = pa_memblock_new_fixed(p, (char*) "__", 2, 1);
assert(silence);
- bq = pa_memblockq_new(0, 40, 10, 2, 4, 4, silence, NULL);
+ bq = pa_memblockq_new(0, 40, 10, 2, 4, 4, silence);
assert(bq);
- chunk1.memblock = pa_memblock_new_fixed((char*) "AA", 2, 1, NULL);
+ chunk1.memblock = pa_memblock_new_fixed(p, (char*) "AA", 2, 1);
chunk1.index = 0;
chunk1.length = 2;
assert(chunk1.memblock);
- chunk2.memblock = pa_memblock_new_fixed((char*) "TTBB", 4, 1, NULL);
+ chunk2.memblock = pa_memblock_new_fixed(p, (char*) "TTBB", 4, 1);
chunk2.index = 2;
chunk2.length = 2;
assert(chunk2.memblock);
- chunk3.memblock = pa_memblock_new_fixed((char*) "ZZZZ", 4, 1, NULL);
+ chunk3.memblock = pa_memblock_new_fixed(p, (char*) "ZZZZ", 4, 1);
chunk3.index = 0;
chunk3.length = 4;
assert(chunk3.memblock);
- chunk4.memblock = pa_memblock_new_fixed((char*) "KKKKKKKK", 8, 1, NULL);
+ chunk4.memblock = pa_memblock_new_fixed(p, (char*) "KKKKKKKK", 8, 1);
chunk4.index = 0;
chunk4.length = 8;
assert(chunk4.memblock);
More information about the pulseaudio-commits
mailing list