]> git.meshlink.io Git - catta/blobdiff - tests/prioq-test.c
rename everything avahi to catta
[catta] / tests / prioq-test.c
index 579c75d0af5dd51322fd86e5ed4d12f73b6b135f..b01068cf9a192b4d7c684a0b42052b6d58f0f2ac 100644 (file)
@@ -1,18 +1,18 @@
 /***
-  This file is part of avahi.
+  This file is part of catta.
 
-  avahi is free software; you can redistribute it and/or modify it
+  catta is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
 
-  avahi is distributed in the hope that it will be useful, but WITHOUT
+  catta is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
 
   You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
+  License along with catta; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
 ***/
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <assert.h>
 
-#include <avahi/gccmacro.h>
+#include <catta/gccmacro.h>
 
 #include "../src/prioq.h"
 
@@ -43,7 +43,7 @@ static int compare_ptr(const void* a, const void* b) {
     return a < b ? -1 : (a > b ? 1 : 0);
 }
 
-static void rec(AvahiPrioQueueNode *n) {
+static void rec(CattaPrioQueueNode *n) {
     if (!n)
         return;
 
@@ -80,17 +80,17 @@ static void rec(AvahiPrioQueueNode *n) {
     rec(n->right);
 }
 
-int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
-    AvahiPrioQueue *q, *q2;
+int main(CATTA_GCC_UNUSED int argc, CATTA_GCC_UNUSED char *argv[]) {
+    CattaPrioQueue *q, *q2;
     int i;
 
-    q = avahi_prio_queue_new(compare_int);
-    q2 = avahi_prio_queue_new(compare_ptr);
+    q = catta_prio_queue_new(compare_int);
+    q2 = catta_prio_queue_new(compare_ptr);
 
     srand(time(NULL));
 
     for (i = 0; i < 10000; i++)
-        avahi_prio_queue_put(q2, avahi_prio_queue_put(q, INT_TO_POINTER(random() & 0xFFFF)));
+        catta_prio_queue_put(q2, catta_prio_queue_put(q, INT_TO_POINTER(random() & 0xFFFF)));
 
     while (q2->root) {
         rec(q->root);
@@ -98,10 +98,10 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 
         assert(q->n_nodes == q2->n_nodes);
 
-        printf("%i\n", POINTER_TO_INT(((AvahiPrioQueueNode*)q2->root->data)->data));
+        printf("%i\n", POINTER_TO_INT(((CattaPrioQueueNode*)q2->root->data)->data));
 
-        avahi_prio_queue_remove(q, q2->root->data);
-        avahi_prio_queue_remove(q2, q2->root);
+        catta_prio_queue_remove(q, q2->root->data);
+        catta_prio_queue_remove(q2, q2->root);
     }
 
 
@@ -110,11 +110,11 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) {
 /*         int v = GPOINTER_TO_INT(q->root->data); */
 /*         rec(q->root); */
 /*         printf("%i\n", v); */
-/*         avahi_prio_queue_remove(q, q->root); */
+/*         catta_prio_queue_remove(q, q->root); */
 /*         assert(v >= prev); */
 /*         prev = v; */
 /*     } */
 
-    avahi_prio_queue_free(q);
+    catta_prio_queue_free(q);
     return 0;
 }