r4853 - in trunk/src/target/opkg: libopkg tests

tick at docs.openmoko.org tick at docs.openmoko.org
Mon Dec 8 09:09:02 CET 2008


Author: tick
Date: 2008-12-08 09:09:02 +0100 (Mon, 08 Dec 2008)
New Revision: 4853

Modified:
   trunk/src/target/opkg/libopkg/active_list.h
   trunk/src/target/opkg/tests/Makefile.am
   trunk/src/target/opkg/tests/opkg_active_list_test.c
Log:
opkg: active_list tests


Modified: trunk/src/target/opkg/libopkg/active_list.h
===================================================================
--- trunk/src/target/opkg/libopkg/active_list.h	2008-12-08 08:08:47 UTC (rev 4852)
+++ trunk/src/target/opkg/libopkg/active_list.h	2008-12-08 08:09:02 UTC (rev 4853)
@@ -25,7 +25,7 @@
     struct list_head depend;
     char walked;
     struct active_list *depended;
-}  __attribute__((packed));
+};
 
 struct active_list * active_list_next(struct active_list *head, struct active_list *ptr);
 void active_list_init(struct active_list *ptr);

Modified: trunk/src/target/opkg/tests/Makefile.am
===================================================================
--- trunk/src/target/opkg/tests/Makefile.am	2008-12-08 08:08:47 UTC (rev 4852)
+++ trunk/src/target/opkg/tests/Makefile.am	2008-12-08 08:09:02 UTC (rev 4853)
@@ -1,7 +1,7 @@
 AM_CFLAGS = $(ALL_CFLAGS) -I${top_srcdir}/libopkg
 
 #noinst_PROGRAMS = opkg_hash_test opkg_extract_test
-noinst_PROGRAMS = libopkg_test
+noinst_PROGRAMS = libopkg_test opkg_active_list_test
 
 #opkg_hash_test_LDADD = $(top_builddir)/libbb/libbb.la $(top_builddir)/libopkg/libopkg.la
 #opkg_hash_test_SOURCES = opkg_hash_test.c
@@ -11,6 +11,10 @@
 #opkg_extract_test_SOURCES = opkg_extract_test.c
 #opkg_extract_test_CFLAGS = $(ALL_CFLAGS) -I$(top_srcdir)
 
+opkg_active_list_test_LDADD = $(top_builddir)/libopkg/active_list.o
+opkg_active_list_test_SOURCES = opkg_active_list_test.c
+opkg_active_list_test_CFLAGS = $(ALL_CFLAGS) -I$(top_srcdir)
+
 libopkg_test_LDADD = $(top_builddir)/libopkg/libopkg.la
 libopkg_test_SOURCE = libopkg_test.c
 

Modified: trunk/src/target/opkg/tests/opkg_active_list_test.c
===================================================================
--- trunk/src/target/opkg/tests/opkg_active_list_test.c	2008-12-08 08:08:47 UTC (rev 4852)
+++ trunk/src/target/opkg/tests/opkg_active_list_test.c	2008-12-08 08:09:02 UTC (rev 4853)
@@ -1,23 +1,30 @@
+/* opkg_active_list.c - the opkg package management system
 
-/*
-.--A---B----C----D-----E----F
-    |             |__k---L
-    |                    |_ N
-    |__ G ---H ---I---J
-             |_M      |_O
+   Tick Chen <tick at openmoko.com>
 
-Then the sequence will be 
-G M H I O J A B K N L C D E F
+   Copyright (C) 2008 Openmoko
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program 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
+   General Public License for more details.
 */
 
+
 #include <stdlib.h>
 #include <libopkg/active_list.h>
+#include <active_list.h>
 #include <stdio.h>
 
 struct active_test {
     char *str;
     struct active_list list;
-} __attribute__((packed));
+};
 
 struct active_test *active_test_new(char *str) {
     struct active_test *ans = (struct active_test *)calloc(1, sizeof(struct active_test));
@@ -33,6 +40,16 @@
     active_list_add_depend(&A->list, &B->list);
 }
 
+/*
+.--A---B----C----D-----E----F
+    |             |__k---L
+    |                    |_ N
+    |__ G ---H ---I---J
+             |_M      |_O
+
+Then the sequence will be 
+G M H I O J A B K N L C D E F
+*/
 void make_list(struct active_list *head) {
     struct active_test *A = active_test_new("A");
     struct active_test *B = active_test_new("B");




More information about the commitlog mailing list