[pulseaudio-commits] r1522 - /branches/lennart/src/tests/memblock-test.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Jul 13 16:28:12 PDT 2007


Author: lennart
Date: Sat Jul 14 01:28:11 2007
New Revision: 1522

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1522&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Fix typo in pa_memblock_release() call; s/assert/pa_assert/

Modified:
    branches/lennart/src/tests/memblock-test.c

Modified: branches/lennart/src/tests/memblock-test.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/tests/memb=
lock-test.c?rev=3D1522&root=3Dpulseaudio&r1=3D1521&r2=3D1522&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/tests/memblock-test.c (original)
+++ branches/lennart/src/tests/memblock-test.c Sat Jul 14 01:28:11 2007
@@ -23,11 +23,11 @@
 #include <config.h>
 #endif
 =

-#include <assert.h>
 #include <stdio.h>
 #include <unistd.h>
 =

 #include <pulsecore/memblock.h>
+#include <pulsecore/macro.h>
 #include <pulse/xmalloc.h>
 =

 static void release_cb(pa_memimport *i, uint32_t block_id, void *userdata)=
 {
@@ -88,7 +88,7 @@
     pa_mempool_get_shm_id(pool_b, &id_b);
     pa_mempool_get_shm_id(pool_c, &id_c);
 =

-    assert(pool_a && pool_b && pool_c);
+    pa_assert(pool_a && pool_b && pool_c);
 =

     blocks[0] =3D pa_memblock_new_fixed(pool_a, (void*) txt, sizeof(txt), =
1);
 =

@@ -100,7 +100,7 @@
     blocks[2] =3D pa_memblock_new_pool(pool_a, sizeof(txt));
     x =3D pa_memblock_acquire(blocks[2]);
     snprintf(x, pa_memblock_get_length(blocks[2]), "%s", txt);
-    pa_memblock_release(blocks[1]);
+    pa_memblock_release(blocks[2]);
 =

     blocks[3] =3D pa_memblock_new_malloced(pool_a, pa_xstrdup(txt), sizeof=
(txt));
     blocks[4] =3D NULL;
@@ -109,35 +109,35 @@
         printf("Memory block %u\n", i);
 =

         mb_a =3D blocks[i];
-        assert(mb_a);
+        pa_assert(mb_a);
 =

         export_a =3D pa_memexport_new(pool_a, revoke_cb, (void*) "A");
         export_b =3D pa_memexport_new(pool_b, revoke_cb, (void*) "B");
 =

-        assert(export_a && export_b);
+        pa_assert(export_a && export_b);
 =

         import_b =3D pa_memimport_new(pool_b, release_cb, (void*) "B");
         import_c =3D pa_memimport_new(pool_c, release_cb, (void*) "C");
 =

-        assert(import_b && import_c);
+        pa_assert(import_b && import_c);
 =

         r =3D pa_memexport_put(export_a, mb_a, &id, &shm_id, &offset, &siz=
e);
-        assert(r >=3D 0);
-        assert(shm_id =3D=3D id_a);
+        pa_assert(r >=3D 0);
+        pa_assert(shm_id =3D=3D id_a);
 =

         printf("A: Memory block exported as %u\n", id);
 =

         mb_b =3D pa_memimport_get(import_b, id, shm_id, offset, size);
-        assert(mb_b);
+        pa_assert(mb_b);
         r =3D pa_memexport_put(export_b, mb_b, &id, &shm_id, &offset, &siz=
e);
-        assert(r >=3D 0);
-        assert(shm_id =3D=3D id_a || shm_id =3D=3D id_b);
+        pa_assert(r >=3D 0);
+        pa_assert(shm_id =3D=3D id_a || shm_id =3D=3D id_b);
         pa_memblock_unref(mb_b);
 =

         printf("B: Memory block exported as %u\n", id);
 =

         mb_c =3D pa_memimport_get(import_c, id, shm_id, offset, size);
-        assert(mb_c);
+        pa_assert(mb_c);
         x =3D pa_memblock_acquire(mb_c);
         printf("1 data=3D%s\n", x);
         pa_memblock_release(mb_c);




More information about the pulseaudio-commits mailing list