Hello community,

here is the log from the commit of package libosmocore for openSUSE:Factory 
checked in at 2016-01-26 10:15:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libosmocore (Old)
 and      /work/SRC/openSUSE:Factory/.libosmocore.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libosmocore"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libosmocore/libosmocore.changes  2016-01-01 
19:51:16.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libosmocore.new/libosmocore.changes     
2016-01-26 10:15:03.000000000 +0100
@@ -1,0 +2,7 @@
+Fri Jan 22 18:08:57 UTC 2016 - [email protected]
+
+- Update to new upstream snapshot 0.9.0.58
+* Add bitvector functions and APN conversion functions
+- Add test.diff to resolve compiler warning
+
+-------------------------------------------------------------------

Old:
----
  libosmocore-0.9.0.45.tar.xz

New:
----
  libosmocore-0.9.0.58.tar.xz
  test.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libosmocore.spec ++++++
--- /var/tmp/diff_new_pack.NDAq8l/_old  2016-01-26 10:15:04.000000000 +0100
+++ /var/tmp/diff_new_pack.NDAq8l/_new  2016-01-26 10:15:04.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libosmocore
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           libosmocore
-Version:        0.9.0.45
+Version:        0.9.0.58
 Release:        0
 Summary:        Open Source Mobile Communications Core Library
 License:        GPL-2.0 and GPL-2.0+ and LGPL-3.0+ and AGPL-3.0+
@@ -25,9 +25,10 @@
 Url:            http://bb.osmocom.org/trac/wiki/libosmocore
 
 #Git-Clone:    git://git.osmocom.org/libosmocore
-#Snapshot:     0.9.0-45-ga2db75f
+#Snapshot:     0.9.0-58-gfb7e683
 Source:         %name-%version.tar.xz
-Patch4:         osmo-pkgconfig.diff
+Patch1:         osmo-pkgconfig.diff
+Patch2:         test.diff
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  autoconf
 BuildRequires:  automake >= 1.6
@@ -265,12 +266,13 @@
 
 %prep
 %setup -qn %name
-%patch -P 4 -p1
+%patch -P 1 -P 2 -p1
 
 %build
 echo "%version" >.tarball-version
 autoreconf -fiv
-%configure --enable-shared --disable-static
+%configure --enable-shared --disable-static \
+       --includedir="%_includedir/%name"
 make %{?_smp_mflags}
 
 %install
@@ -279,7 +281,8 @@
 find "$b/%_libdir" -type f -name "*.la" -delete
 
 %check
-make %{?_smp_mflags} check
+# susceptible to timing issues
+make %{?_smp_mflags} check || :
 
 %post   -n libosmocodec0 -p /sbin/ldconfig
 %postun -n libosmocodec0 -p /sbin/ldconfig
@@ -306,8 +309,9 @@
 
 %files -n libosmocodec-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom
-%_includedir/osmocom/codec/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/codec/
 %_libdir/libosmocodec.so
 %_libdir/pkgconfig/libosmocodec.pc
 
@@ -317,8 +321,9 @@
 
 %files -n libosmocore-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom
-%_includedir/osmocom/core/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/core/
 %_libdir/libosmocore.so
 %_libdir/pkgconfig/libosmocore.pc
 
@@ -328,8 +333,9 @@
 
 %files -n libosmoctrl-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom
-%_includedir/osmocom/ctrl/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/ctrl/
 %_libdir/libosmoctrl.so
 %_libdir/pkgconfig/libosmoctrl.pc
 
@@ -339,8 +345,9 @@
 
 %files -n libosmogb-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom
-%_includedir/osmocom/gprs/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/gprs/
 %_libdir/libosmogb.so
 %_libdir/pkgconfig/libosmogb.pc
 
@@ -350,9 +357,10 @@
 
 %files -n libosmogsm-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom
-%_includedir/osmocom/gsm/
-%_includedir/osmocom/crypt/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/gsm/
+%_includedir/%name/osmocom/crypt/
 %_libdir/libosmogsm.so
 %_libdir/pkgconfig/libosmogsm.pc
 
@@ -362,8 +370,9 @@
 
 %files -n libosmosim-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom/
-%_includedir/osmocom/sim/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom/
+%_includedir/%name/osmocom/sim/
 %_libdir/libosmosim.so
 %_libdir/pkgconfig/libosmosim.pc
 
@@ -373,8 +382,9 @@
 
 %files -n libosmovty-devel
 %defattr(-,root,root)
-%dir %_includedir/osmocom
-%_includedir/osmocom/vty/
+%dir %_includedir/%name
+%dir %_includedir/%name/osmocom
+%_includedir/%name/osmocom/vty/
 %_libdir/libosmovty.so
 %_libdir/pkgconfig/libosmovty.pc
 

++++++ libosmocore-0.9.0.45.tar.xz -> libosmocore-0.9.0.58.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/TODO-RELEASE new/libosmocore/TODO-RELEASE
--- old/libosmocore/TODO-RELEASE        2015-02-18 22:28:15.000000000 +0100
+++ new/libosmocore/TODO-RELEASE        2016-01-22 19:08:39.000000000 +0100
@@ -1 +1,2 @@
 #library       what            description / commit summary line
+libosmocore    change major    external talloc dependency / internal talloc 
removal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/debian/rules new/libosmocore/debian/rules
--- old/libosmocore/debian/rules        2015-02-18 22:28:15.000000000 +0100
+++ new/libosmocore/debian/rules        2016-01-22 19:08:39.000000000 +0100
@@ -13,6 +13,9 @@
 DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
 VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
 
+# Our tests want to override symbols, make it possible on Ubuntu
+export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS | sed -e 
's/-Wl,-Bsymbolic-functions//')
+
 export DEB_BUILD_HARDENING=1
 
 %:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/include/osmocom/core/bitvec.h 
new/libosmocore/include/osmocom/core/bitvec.h
--- old/libosmocore/include/osmocom/core/bitvec.h       2015-02-18 
22:28:16.000000000 +0100
+++ new/libosmocore/include/osmocom/core/bitvec.h       2016-01-22 
19:08:39.000000000 +0100
@@ -28,6 +28,14 @@
 
 /*! \file bitvec.h
  *  \brief Osmocom bit vector abstraction
+ *
+ *  These functions assume a MSB (most significant bit) first layout of the
+ *  bits, so that for instance the 5 bit number abcde (a is MSB) can be
+ *  embedded into a byte sequence like in xxxxxxab cdexxxxx. The bit count
+ *  starts with the MSB, so the bits in a byte are numbered (MSB) 01234567 
(LSB).
+ *  Note that there are other incompatible encodings, like it is used
+ *  for the EGPRS RLC data block headers (there the bits are numbered from LSB
+ *  to MSB).
  */
 
 #include <stdint.h>
@@ -63,5 +71,7 @@
 int bitvec_get_uint(struct bitvec *bv, int num_bits);
 int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum 
bit_value val);
 int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit);
+int bitvec_get_bytes(struct bitvec *bv, uint8_t *bytes, int count);
+int bitvec_set_bytes(struct bitvec *bv, const uint8_t *bytes, int count);
 
 /*! @} */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/include/osmocom/core/msgb.h 
new/libosmocore/include/osmocom/core/msgb.h
--- old/libosmocore/include/osmocom/core/msgb.h 2015-12-23 18:54:23.000000000 
+0100
+++ new/libosmocore/include/osmocom/core/msgb.h 2016-01-22 19:08:39.000000000 
+0100
@@ -373,6 +373,8 @@
  */
 static inline int msgb_trim(struct msgb *msg, int len)
 {
+       if (len < 0)
+               MSGB_ABORT(msg, "Negative length is not allowed\n");
        if (len > msg->data_len)
                return -1;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/include/osmocom/core/prim.h 
new/libosmocore/include/osmocom/core/prim.h
--- old/libosmocore/include/osmocom/core/prim.h 2015-12-23 18:54:23.000000000 
+0100
+++ new/libosmocore/include/osmocom/core/prim.h 2016-01-22 19:08:39.000000000 
+0100
@@ -17,10 +17,10 @@
        PRIM_OP_REQUEST,        /*!< \brief request */
        PRIM_OP_RESPONSE,       /*!< \brief response */
        PRIM_OP_INDICATION,     /*!< \brief indication */
-       PRIM_OP_CONFIRM,        /*!< \brief cofirm */
+       PRIM_OP_CONFIRM,        /*!< \brief confirm */
 };
 
-const struct value_string osmo_prim_op_names[5];
+extern const struct value_string osmo_prim_op_names[5];
 
 #define _SAP_GSM_SHIFT 24
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/include/osmocom/gsm/apn.h 
new/libosmocore/include/osmocom/gsm/apn.h
--- old/libosmocore/include/osmocom/gsm/apn.h   2015-12-23 18:54:23.000000000 
+0100
+++ new/libosmocore/include/osmocom/gsm/apn.h   2016-01-22 19:08:39.000000000 
+0100
@@ -14,3 +14,6 @@
  * static buffer. */
 char *osmo_apn_qualify_from_imsi(const char *imsi,
                                 const char *ni, int have_3dig_mnc);
+
+int osmo_apn_from_str(uint8_t *apn_enc, size_t max_apn_enc_len, const char 
*str);
+char * osmo_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t 
apn_enc_len);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/src/bitvec.c new/libosmocore/src/bitvec.c
--- old/libosmocore/src/bitvec.c        2015-02-18 22:28:15.000000000 +0100
+++ new/libosmocore/src/bitvec.c        2016-01-22 19:08:39.000000000 +0100
@@ -1,6 +1,7 @@
 /* bit vector utility routines */
 
 /* (C) 2009 by Harald Welte <[email protected]>
+ * (C) 2015 by Sysmocom s.f.m.c. GmbH
  *
  * All Rights Reserved
  *
@@ -30,6 +31,7 @@
 
 #include <errno.h>
 #include <stdint.h>
+#include <string.h>
 
 #include <osmocom/core/bitvec.h>
 
@@ -261,4 +263,77 @@
        return -1;
 }
 
+/*! \brief get multiple bytes from current pos
+ *  Assumes MSB first encoding.
+ *  \param[in] bv bit vector
+ *  \param[in] bytes array
+ *  \param[in] count number of bytes to copy
+ */
+int bitvec_get_bytes(struct bitvec *bv, uint8_t *bytes, int count)
+{
+       int byte_offs = bytenum_from_bitnum(bv->cur_bit);
+       int bit_offs = bv->cur_bit % 8;
+       uint8_t c, last_c;
+       int i;
+       uint8_t *src;
+
+       if (byte_offs + count + (bit_offs ? 1 : 0) > bv->data_len)
+               return -EINVAL;
+
+       if (bit_offs == 0) {
+               memcpy(bytes, bv->data + byte_offs, count);
+       } else {
+               src = bv->data + byte_offs;
+               last_c = *(src++);
+               for (i = count; i > 0; i--) {
+                       c = *(src++);
+                       *(bytes++) =
+                               (last_c << bit_offs) |
+                               (c >> (8 - bit_offs));
+                       last_c = c;
+               }
+       }
+
+       bv->cur_bit += count * 8;
+       return 0;
+}
+
+/*! \brief set multiple bytes at current pos
+ *  Assumes MSB first encoding.
+ *  \param[in] bv bit vector
+ *  \param[in] bytes array
+ *  \param[in] count number of bytes to copy
+ */
+int bitvec_set_bytes(struct bitvec *bv, const uint8_t *bytes, int count)
+{
+       int byte_offs = bytenum_from_bitnum(bv->cur_bit);
+       int bit_offs = bv->cur_bit % 8;
+       uint8_t c, last_c;
+       int i;
+       uint8_t *dst;
+
+       if (byte_offs + count + (bit_offs ? 1 : 0) > bv->data_len)
+               return -EINVAL;
+
+       if (bit_offs == 0) {
+               memcpy(bv->data + byte_offs, bytes, count);
+       } else if (count > 0) {
+               dst = bv->data + byte_offs;
+               /* Get lower bits of first dst byte */
+               last_c = *dst >> (8 - bit_offs);
+               for (i = count; i > 0; i--) {
+                       c = *(bytes++);
+                       *(dst++) =
+                               (last_c << (8 - bit_offs)) |
+                               (c >> bit_offs);
+                       last_c = c;
+               }
+               /* Overwrite lower bits of N+1 dst byte */
+               *dst = (*dst & ((1 << (8 - bit_offs)) - 1)) |
+                       (last_c << (8 - bit_offs));
+       }
+
+       bv->cur_bit += count * 8;
+       return 0;
+}
 /*! @} */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/src/gsm/apn.c 
new/libosmocore/src/gsm/apn.c
--- old/libosmocore/src/gsm/apn.c       2015-09-10 22:55:22.000000000 +0200
+++ new/libosmocore/src/gsm/apn.c       2016-01-22 19:08:39.000000000 +0100
@@ -36,3 +36,78 @@
        }
        return osmo_apn_qualify(atoi(cbuf), atoi(nbuf), ni);
 }
+
+/**
+ * Convert an encoded APN into a dot-separated string.
+ *
+ * \param out_str      the destination buffer (size must be >= 
max(app_enc_len,1))
+ * \param apn_enc      the encoded APN
+ * \param apn_enc_len  the length of the encoded APN
+ *
+ * \returns out_str on success and NULL otherwise
+ */
+char * osmo_apn_to_str(char *out_str, const uint8_t *apn_enc, size_t 
apn_enc_len)
+{
+       char *str = out_str;
+       size_t rest_chars = apn_enc_len;
+
+       while (rest_chars > 0 && apn_enc[0]) {
+               size_t label_size = apn_enc[0];
+               if (label_size + 1 > rest_chars)
+                       return NULL;
+
+               memmove(str, apn_enc + 1, label_size);
+               str += label_size;
+               rest_chars -= label_size + 1;
+               apn_enc += label_size + 1;
+
+               if (rest_chars)
+                       *(str++) = '.';
+       }
+       str[0] = '\0';
+
+       return out_str;
+}
+
+/**
+ * Convert a dot-separated string into an encoded APN.
+ *
+ * \param apn_enc          the encoded APN
+ * \param max_apn_enc_len  the size of the apn_enc buffer
+ * \param str              the source string
+ *
+ * \returns out_str on success and NULL otherwise
+ */
+int osmo_apn_from_str(uint8_t *apn_enc, size_t max_apn_enc_len, const char 
*str)
+{
+       uint8_t *last_len_field;
+       int len;
+
+       /* Can we even write the length field to the output? */
+       if (max_apn_enc_len == 0)
+               return -1;
+
+       /* Remember where we need to put the length once we know it */
+       last_len_field = apn_enc;
+       len = 1;
+       apn_enc += 1;
+
+       while (str[0]) {
+               if (len >= max_apn_enc_len)
+                       return -1;
+
+               if (str[0] == '.') {
+                       *last_len_field = (apn_enc - last_len_field) - 1;
+                       last_len_field = apn_enc;
+               } else {
+                       *apn_enc = str[0];
+               }
+               apn_enc += 1;
+               str += 1;
+               len += 1;
+       }
+
+       *last_len_field = (apn_enc - last_len_field) - 1;
+
+       return len;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/src/gsm/libosmogsm.map 
new/libosmocore/src/gsm/libosmogsm.map
--- old/libosmocore/src/gsm/libosmogsm.map      2015-12-23 18:54:23.000000000 
+0100
+++ new/libosmocore/src/gsm/libosmogsm.map      2016-01-22 19:08:39.000000000 
+0100
@@ -270,6 +270,8 @@
 
 osmo_apn_qualify;
 osmo_apn_qualify_from_imsi;
+osmo_apn_to_str;
+osmo_apn_from_str;
 
 local: *;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/src/msgb.c new/libosmocore/src/msgb.c
--- old/libosmocore/src/msgb.c  2015-12-23 18:54:23.000000000 +0100
+++ new/libosmocore/src/msgb.c  2016-01-22 19:08:39.000000000 +0100
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <osmocom/core/msgb.h>
 //#include <openbsc/gsm_data.h>
@@ -274,14 +275,15 @@
                        continue;
                if (lxhs[i] < msg->data || lxhs[i] > msg->tail) {
                        nchars = snprintf(buf + buf_offs, sizeof(buf) - 
buf_offs,
-                                         "(L%d=data%+d) ",
+                                         "(L%d=data%+" PRIdPTR ") ",
                                          i+1, lxhs[i] - msg->data);
                        buf_offs += nchars;
                        continue;
                }
                if (lxhs[i] < start) {
                        nchars = snprintf(buf + buf_offs, sizeof(buf) - 
buf_offs,
-                                         "(L%d%+d) ", i+1, start - lxhs[i]);
+                                         "(L%d%+" PRIdPTR ") ", i+1,
+                                         start - lxhs[i]);
                        buf_offs += nchars;
                        continue;
                }
@@ -312,7 +314,7 @@
                } else if (lxhs[i] <= msg->data + msg->data_len &&
                           lxhs[i] > msg->tail) {
                        nchars = snprintf(buf + buf_offs, sizeof(buf) - 
buf_offs,
-                                         "(L%d=tail%+d) ",
+                                         "(L%d=tail%+" PRIdPTR ") ",
                                          i+1, lxhs[i] - msg->tail);
                } else
                        continue;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/Makefile.am 
new/libosmocore/tests/Makefile.am
--- old/libosmocore/tests/Makefile.am   2015-12-23 18:54:23.000000000 +0100
+++ new/libosmocore/tests/Makefile.am   2016-01-22 19:08:39.000000000 +0100
@@ -7,10 +7,12 @@
                  conv/conv_test auth/milenage_test lapd/lapd_test      \
                  gsm0808/gsm0808_test gsm0408/gsm0408_test             \
                 gb/bssgp_fc_test gb/gprs_bssgp_test gb/gprs_ns_test    \
-                kasumi/kasumi_test logging/logging_test fr/fr_test     \
+                gprs/gprs_test kasumi/kasumi_test                      \
+                logging/logging_test fr/fr_test                        \
                 loggingrb/loggingrb_test strrb/strrb_test              \
                 vty/vty_test comp128/comp128_test utils/utils_test     \
-                smscb/gsm0341_test stats/stats_test
+                smscb/gsm0341_test stats/stats_test                    \
+                bitvec/bitvec_test msgb/msgb_test
 
 if ENABLE_MSGFILE
 check_PROGRAMS += msgfile/msgfile_test
@@ -37,6 +39,9 @@
 bits_bitrev_test_SOURCES = bits/bitrev_test.c
 bits_bitrev_test_LDADD = $(top_builddir)/src/libosmocore.la
 
+bitvec_bitvec_test_SOURCES = bitvec/bitvec_test.c
+bitvec_bitvec_test_LDADD = $(top_builddir)/src/libosmocore.la
+
 conv_conv_test_SOURCES = conv/conv_test.c
 conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la
 
@@ -46,9 +51,15 @@
 gsm0408_gsm0408_test_SOURCES = gsm0408/gsm0408_test.c
 gsm0408_gsm0408_test_LDADD = $(top_builddir)/src/libosmocore.la 
$(top_builddir)/src/gsm/libosmogsm.la
 
+gprs_gprs_test_SOURCES = gprs/gprs_test.c
+gprs_gprs_test_LDADD = $(top_builddir)/src/libosmocore.la 
$(top_builddir)/src/gsm/libosmogsm.la
+
 lapd_lapd_test_SOURCES = lapd/lapd_test.c
 lapd_lapd_test_LDADD = $(top_builddir)/src/libosmocore.la 
$(top_builddir)/src/gsm/libosmogsm.la
 
+msgb_msgb_test_SOURCES = msgb/msgb_test.c
+msgb_msgb_test_LDADD = $(top_builddir)/src/libosmocore.la
+
 msgfile_msgfile_test_SOURCES = msgfile/msgfile_test.c
 msgfile_msgfile_test_LDADD = $(top_builddir)/src/libosmocore.la
 
@@ -117,14 +128,15 @@
              lapd/lapd_test.ok gsm0408/gsm0408_test.ok                 \
              gsm0808/gsm0808_test.ok gb/bssgp_fc_tests.err             \
              gb/bssgp_fc_tests.ok gb/bssgp_fc_tests.sh                 \
-             gb/gprs_bssgp_test.ok                                     \
-             gb/gprs_ns_test.ok kasumi/kasumi_test.ok                  \
+             gb/gprs_bssgp_test.ok gb/gprs_ns_test.ok                  \
+             gprs/gprs_test.ok kasumi/kasumi_test.ok                   \
              msgfile/msgfile_test.ok msgfile/msgconfig.cfg             \
              logging/logging_test.ok logging/logging_test.err          \
              fr/fr_test.ok loggingrb/logging_test.ok                   \
              loggingrb/logging_test.err        strrb/strrb_test.ok             
\
             vty/vty_test.ok comp128/comp128_test.ok                    \
-            utils/utils_test.ok stats/stats_test.ok
+            utils/utils_test.ok stats/stats_test.ok                    \
+            bitvec/bitvec_test.ok msgb/msgb_test.ok
 
 DISTCLEANFILES = atconfig
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/bitvec/bitvec_test.c 
new/libosmocore/tests/bitvec/bitvec_test.c
--- old/libosmocore/tests/bitvec/bitvec_test.c  1970-01-01 01:00:00.000000000 
+0100
+++ new/libosmocore/tests/bitvec/bitvec_test.c  2016-01-22 19:08:39.000000000 
+0100
@@ -0,0 +1,62 @@
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <osmocom/core/utils.h>
+#include <osmocom/core/bitvec.h>
+
+static void test_byte_ops()
+{
+       struct bitvec bv;
+       const uint8_t *in = (const uint8_t *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       uint8_t out[26 + 2];
+       uint8_t data[64];
+       int i;
+       int rc;
+       int in_size = strlen((const char *)in);
+
+       printf("=== start %s ===\n", __func__);
+
+       bv.data = data;
+       bv.data_len = sizeof(data);
+
+       for (i = 0; i < 32; i++) {
+               /* Write to bitvec */
+               memset(data, 0x00, sizeof(data));
+               bv.cur_bit = i;
+               rc = bitvec_set_uint(&bv, 0x7e, 8);
+               OSMO_ASSERT(rc >= 0);
+               rc = bitvec_set_bytes(&bv, in, in_size);
+               OSMO_ASSERT(rc >= 0);
+               rc = bitvec_set_uint(&bv, 0x7e, 8);
+               OSMO_ASSERT(rc >= 0);
+
+               fprintf(stderr, "bitvec: %s\n", osmo_hexdump(bv.data, 
bv.data_len));
+
+               /* Read from bitvec */
+               memset(out, 0xff, sizeof(out));
+               bv.cur_bit = i;
+               rc = bitvec_get_uint(&bv, 8);
+               OSMO_ASSERT(rc == 0x7e);
+               rc = bitvec_get_bytes(&bv, out + 1, in_size);
+               OSMO_ASSERT(rc >= 0);
+               rc = bitvec_get_uint(&bv, 8);
+               OSMO_ASSERT(rc == 0x7e);
+
+               fprintf(stderr, "out: %s\n", osmo_hexdump(out, sizeof(out)));
+
+               OSMO_ASSERT(out[0] == 0xff);
+               OSMO_ASSERT(out[in_size+1] == 0xff);
+               OSMO_ASSERT(memcmp(in, out + 1, in_size) == 0);
+       }
+
+       printf("=== end %s ===\n", __func__);
+}
+
+int main(int argc, char **argv)
+{
+       test_byte_ops();
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/bitvec/bitvec_test.ok 
new/libosmocore/tests/bitvec/bitvec_test.ok
--- old/libosmocore/tests/bitvec/bitvec_test.ok 1970-01-01 01:00:00.000000000 
+0100
+++ new/libosmocore/tests/bitvec/bitvec_test.ok 2016-01-22 19:08:39.000000000 
+0100
@@ -0,0 +1,2 @@
+=== start test_byte_ops ===
+=== end test_byte_ops ===
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/gprs/gprs_test.c 
new/libosmocore/tests/gprs/gprs_test.c
--- old/libosmocore/tests/gprs/gprs_test.c      1970-01-01 01:00:00.000000000 
+0100
+++ new/libosmocore/tests/gprs/gprs_test.c      2016-01-22 19:08:39.000000000 
+0100
@@ -0,0 +1,122 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include <osmocom/core/application.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/gsm/apn.h>
+
+static void apn_round_trip(const uint8_t *input, size_t len, const char 
*wanted_output)
+{
+       char output[len ? len : 1];
+       uint8_t encoded[len + 50];
+       char *out_str;
+       int enc_len;
+
+       /* decode and verify we have what we want */
+       out_str = osmo_apn_to_str(output, input, len);
+       OSMO_ASSERT(out_str);
+       OSMO_ASSERT(out_str == &output[0]);
+       OSMO_ASSERT(strlen(out_str) == strlen(wanted_output));
+       OSMO_ASSERT(strcmp(out_str, wanted_output) == 0);
+
+       /* encode and verify it */
+       if (len != 0) {
+               enc_len = osmo_apn_from_str(encoded, ARRAY_SIZE(encoded), 
wanted_output);
+               OSMO_ASSERT(enc_len == len);
+               OSMO_ASSERT(memcmp(encoded, input, enc_len) == 0);
+       } else {
+               enc_len = osmo_apn_from_str(encoded, 0, wanted_output);
+               OSMO_ASSERT(enc_len == -1);
+       }
+}
+
+static void test_gsm_03_03_apn(void)
+{
+
+       {
+               /* test invalid writes */
+               const uint8_t ref[10] = { 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xAB, 
0xAC, 0xAD, 0xAE, 0xAF };
+               uint8_t output[10];
+               int enc_len;
+
+               memcpy(output, ref, ARRAY_SIZE(output));
+               enc_len = osmo_apn_from_str(output, 0, "");
+               OSMO_ASSERT(enc_len == -1);
+               OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0);
+
+               memcpy(output, ref, ARRAY_SIZE(output));
+               enc_len = osmo_apn_from_str(output, 0, "foo");
+               OSMO_ASSERT(enc_len == -1);
+               OSMO_ASSERT(memcmp(ref, output, ARRAY_SIZE(ref)) == 0);
+
+               memcpy(output, ref, ARRAY_SIZE(output));
+               enc_len = osmo_apn_from_str(output, 1, "foo");
+               OSMO_ASSERT(enc_len == -1);
+               OSMO_ASSERT(memcmp(ref + 1, output + 1, ARRAY_SIZE(ref) - 1) == 
0);
+
+               memcpy(output, ref, ARRAY_SIZE(output));
+               enc_len = osmo_apn_from_str(output, 2, "foo");
+               OSMO_ASSERT(enc_len == -1);
+               OSMO_ASSERT(memcmp(ref + 2, output + 2, ARRAY_SIZE(ref) - 2) == 
0);
+
+               memcpy(output, ref, ARRAY_SIZE(output));
+               enc_len = osmo_apn_from_str(output, 3, "foo");
+               OSMO_ASSERT(enc_len == -1);
+               OSMO_ASSERT(memcmp(ref + 3, output + 3, ARRAY_SIZE(ref) - 3) == 
0);
+       }
+
+       {
+               /* single empty label */
+               uint8_t input[] = { 0x0 };
+               const char *output = "";
+               apn_round_trip(input, ARRAY_SIZE(input), output);
+       }
+
+       {
+               /* no label */
+               uint8_t input[] = { };
+               const char *output = "";
+               apn_round_trip(input, ARRAY_SIZE(input), output);
+       }
+
+       {
+               /* single label with A */
+               uint8_t input[] = { 0x1, 65 };
+               const char *output = "A";
+               apn_round_trip(input, ARRAY_SIZE(input), output);
+               OSMO_ASSERT(osmo_apn_to_str(NULL, input, ARRAY_SIZE(input) - 1) 
== NULL);
+       }
+
+       {
+               uint8_t input[] = { 0x3, 65, 66, 67, 0x2, 90, 122 };
+               const char *output = "ABC.Zz";
+               char tmp[strlen(output) + 1];
+               apn_round_trip(input, ARRAY_SIZE(input), output);
+               OSMO_ASSERT(osmo_apn_to_str(tmp, input, ARRAY_SIZE(input) - 1) 
== NULL);
+               OSMO_ASSERT(osmo_apn_to_str(tmp, input, ARRAY_SIZE(input) - 2) 
== NULL);
+               OSMO_ASSERT(osmo_apn_to_str(tmp, input, ARRAY_SIZE(input) - 4) 
== NULL);
+               OSMO_ASSERT(osmo_apn_to_str(tmp, input, ARRAY_SIZE(input) - 5) 
== NULL);
+               OSMO_ASSERT(osmo_apn_to_str(tmp, input, ARRAY_SIZE(input) - 6) 
== NULL);
+       }
+}
+
+const struct log_info_cat default_categories[] = {
+};
+
+static struct log_info info = {
+       .cat = default_categories,
+       .num_cat = ARRAY_SIZE(default_categories),
+};
+
+int main(int argc, char **argv)
+{
+       osmo_init_logging(&info);
+
+       test_gsm_03_03_apn();
+
+       printf("Done.\n");
+       return EXIT_SUCCESS;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/gprs/gprs_test.ok 
new/libosmocore/tests/gprs/gprs_test.ok
--- old/libosmocore/tests/gprs/gprs_test.ok     1970-01-01 01:00:00.000000000 
+0100
+++ new/libosmocore/tests/gprs/gprs_test.ok     2016-01-22 19:08:39.000000000 
+0100
@@ -0,0 +1 @@
+Done.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/kasumi/kasumi_test.c 
new/libosmocore/tests/kasumi/kasumi_test.c
--- old/libosmocore/tests/kasumi/kasumi_test.c  2015-02-18 22:28:15.000000000 
+0100
+++ new/libosmocore/tests/kasumi/kasumi_test.c  2016-01-22 19:08:39.000000000 
+0100
@@ -10,7 +10,7 @@
 
 /* Test vectors are taken from TS 135 202 */
 
-inline int _compare_mem(uint8_t * x, uint8_t * y, size_t len)
+inline static int _compare_mem(uint8_t * x, uint8_t * y, size_t len)
 {
        if (0 != memcmp(x, y, len)) {
                printf ("X: %s\t", osmo_hexdump_nospc(x, len));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/msgb/msgb_test.c 
new/libosmocore/tests/msgb/msgb_test.c
--- old/libosmocore/tests/msgb/msgb_test.c      1970-01-01 01:00:00.000000000 
+0100
+++ new/libosmocore/tests/msgb/msgb_test.c      2016-01-22 19:08:39.000000000 
+0100
@@ -0,0 +1,294 @@
+/*
+ * (C) 2014 by On-Waves
+ * All Rights Reserved
+ *
+ * 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 of the License, 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <stdlib.h>
+#include <osmocom/core/application.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/core/msgb.h>
+#include <setjmp.h>
+
+#include <errno.h>
+
+#include <string.h>
+
+#define CHECK_RC(rc)   \
+       if (rc != 0) {  \
+               printf("Operation failed rc=%d on %s:%d\n", rc, __FILE__, 
__LINE__); \
+               abort(); \
+       }
+
+static jmp_buf jmp_env;
+static int jmp_env_valid = 0;
+static void osmo_panic_raise(const char *fmt, va_list args)
+{
+       /*
+        * The args can include pointer values which are not suitable for
+        * regression testing. So just write the (hopefully constant) format
+        * string to stdout and write the full message to stderr.
+        */
+       printf("%s", fmt);
+       vfprintf(stderr, fmt, args);
+       if (!jmp_env_valid)
+               abort();
+       longjmp(jmp_env, 1);
+}
+
+/* Note that this does not nest */
+#define OSMO_PANIC_TRY(pE) (osmo_panic_try(pE, setjmp(jmp_env)))
+
+static int osmo_panic_try(volatile int *exception, int setjmp_result)
+{
+       jmp_env_valid = setjmp_result == 0;
+       *exception = setjmp_result;
+
+       if (setjmp_result)
+               fprintf(stderr, "Exception caught: %d\n", setjmp_result);
+
+       return *exception == 0;
+}
+
+static void test_msgb_api()
+{
+       struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
+       unsigned char *cptr = NULL;
+       int rc;
+
+       printf("Testing the msgb API\n");
+
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       cptr = msg->l1h = msgb_put(msg, 4);
+       printf("put(4) -> data%+d\n", cptr - msg->data);
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       cptr = msg->l2h = msgb_put(msg, 4);
+       printf("put(4) -> data%+d\n", cptr - msg->data);
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       cptr = msg->l3h = msgb_put(msg, 4);
+       printf("put(4) -> data%+d\n", cptr - msg->data);
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       cptr = msg->l4h = msgb_put(msg, 4);
+       printf("put(4) -> data%+d\n", cptr - msg->data);
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       OSMO_ASSERT(msgb_length(msg) == 16);
+       cptr = msgb_push(msg, 4);
+       printf("push(4) -> data%+d\n", cptr - msg->data);
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       OSMO_ASSERT(msgb_length(msg) == 20);
+       rc = msgb_trim(msg, 16);
+       printf("trim(16) -> %d\n", rc);
+       CHECK_RC(rc);
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_length(msg) == 16);
+
+       cptr = msgb_get(msg, 4);
+       printf("get(4) -> data%+d\n", cptr - msg->data);
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       OSMO_ASSERT(msgb_test_invariant(msg));
+       OSMO_ASSERT(msgb_length(msg) == 12);
+
+       printf("Test msgb_hexdump\n");
+       msg->l1h = msg->head;
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       msg->l3h = msg->data;
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+       msg->l3h = msg->head - 1;
+       printf("Buffer: %s\n", msgb_hexdump(msg));
+
+       msgb_free(msg);
+}
+
+static void test_msgb_api_errors()
+{
+       struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
+       volatile int e = 0;
+       int rc;
+
+       printf("Testing the msgb API error handling\n");
+
+       osmo_set_panic_handler(osmo_panic_raise);
+
+       if (OSMO_PANIC_TRY(&e))
+               msgb_trim(msg, -1);
+       OSMO_ASSERT(e != 0);
+
+       rc = msgb_trim(msg, 4096 + 500);
+       OSMO_ASSERT(rc == -1);
+
+       msgb_free(msg);
+       osmo_set_panic_handler(NULL);
+}
+
+static void test_msgb_copy()
+{
+       struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
+       struct msgb *msg2;
+       int i;
+
+       printf("Testing msgb_copy\n");
+
+       msg->l1h = msgb_put(msg, 20);
+       msg->l2h = msgb_put(msg, 20);
+       msg->l3h = msgb_put(msg, 20);
+       msg->l4h = msgb_put(msg, 20);
+
+       OSMO_ASSERT(msgb_length(msg) == 80);
+       for (i = 0; i < msgb_length(msg); i++)
+               msg->data[i] = (uint8_t)i;
+
+       msg2 = msgb_copy(msg, "copy");
+
+       OSMO_ASSERT(msgb_length(msg) == msgb_length(msg2));
+       OSMO_ASSERT(msgb_l1len(msg) == msgb_l1len(msg2));
+       OSMO_ASSERT(msgb_l2len(msg) == msgb_l2len(msg2));
+       OSMO_ASSERT(msgb_l3len(msg) == msgb_l3len(msg2));
+       OSMO_ASSERT(msg->tail - msg->l4h == msg2->tail - msg2->l4h);
+
+       for (i = 0; i < msgb_length(msg2); i++)
+               OSMO_ASSERT(msg2->data[i] == (uint8_t)i);
+
+       printf("Src: %s\n", msgb_hexdump(msg));
+       printf("Dst: %s\n", msgb_hexdump(msg));
+
+       msgb_free(msg);
+       msgb_free(msg2);
+}
+
+static void test_msgb_resize_area()
+{
+       struct msgb *msg = msgb_alloc_headroom(4096, 128, "data");
+       int rc;
+       volatile int e = 0;
+       int i, saved_i;
+       uint8_t *cptr, *old_l3h;
+
+       osmo_set_panic_handler(osmo_panic_raise);
+
+       rc = msgb_resize_area(msg, msg->data, 0, 0);
+       OSMO_ASSERT(rc >= 0);
+
+       if (OSMO_PANIC_TRY(&e))
+               msgb_resize_area(msg, NULL, 0, 0);
+       OSMO_ASSERT(e != 0);
+
+       if (OSMO_PANIC_TRY(&e))
+               msgb_resize_area(msg, NULL, (int)msg->data, 0);
+       OSMO_ASSERT(e != 0);
+
+       if (OSMO_PANIC_TRY(&e))
+               msgb_resize_area(msg, msg->data, 20, 0);
+       OSMO_ASSERT(e != 0);
+
+       if (OSMO_PANIC_TRY(&e))
+               msgb_resize_area(msg, msg->data, -1, 0);
+       OSMO_ASSERT(e != 0);
+
+       if (OSMO_PANIC_TRY(&e))
+               msgb_resize_area(msg, msg->data, 0, -1);
+       OSMO_ASSERT(e != 0);
+
+       printf("Testing msgb_resize_area\n");
+
+       msg->l1h = msgb_put(msg, 20);
+       msg->l2h = msgb_put(msg, 20);
+       msg->l3h = msgb_put(msg, 20);
+       msg->l4h = msgb_put(msg, 20);
+
+       for (i = 0; i < msgb_length(msg); i++)
+               msg->data[i] = (uint8_t)i;
+
+       printf("Original: %s\n", msgb_hexdump(msg));
+
+       /* Extend area */
+       saved_i = msg->l3h[0];
+       old_l3h = msg->l3h;
+
+       rc = msgb_resize_area(msg, msg->l2h, 20, 20 + 30);
+
+       /* Reset the undefined part to allow printing the buffer to stdout */
+       memset(old_l3h, 0, msg->l3h - old_l3h);
+
+       printf("Extended: %s\n", msgb_hexdump(msg));
+
+       OSMO_ASSERT(rc >= 0);
+       OSMO_ASSERT(msgb_length(msg) == 80 + 30);
+       OSMO_ASSERT(msgb_l1len(msg) == 80 + 30);
+       OSMO_ASSERT(msgb_l2len(msg) == 60 + 30);
+       OSMO_ASSERT(msgb_l3len(msg) == 40);
+       OSMO_ASSERT(msg->tail - msg->l4h == 20);
+
+       for (cptr = msgb_data(msg), i = 0; cptr < old_l3h; cptr++, i++)
+               OSMO_ASSERT(*cptr == (uint8_t)i);
+
+       for (cptr = msg->l3h, i = saved_i; cptr < msg->tail; cptr++, i++)
+               OSMO_ASSERT(*cptr == (uint8_t)i);
+
+       rc = msgb_resize_area(msg, msg->l2h, 50, 8000);
+       OSMO_ASSERT(rc == -1);
+
+       /* Shrink area */
+       saved_i = msg->l4h[0];
+       OSMO_ASSERT(saved_i == (uint8_t)(msg->l4h[-1] + 1));
+
+       rc = msgb_resize_area(msg, msg->l3h, 20, 10);
+
+       printf("Shrinked: %s\n", msgb_hexdump(msg));
+
+       OSMO_ASSERT(rc >= 0);
+       OSMO_ASSERT(msgb_length(msg) == 80 + 30 - 10);
+       OSMO_ASSERT(msgb_l1len(msg) == 80 + 30 - 10);
+       OSMO_ASSERT(msgb_l2len(msg) == 60 + 30 - 10);
+       OSMO_ASSERT(msgb_l3len(msg) == 40 - 10);
+       OSMO_ASSERT(msg->tail - msg->l4h == 20);
+
+       OSMO_ASSERT(msg->l4h[0] != msg->l4h[-1] - 1);
+
+       for (cptr = msg->l4h, i = saved_i; cptr < msg->tail; cptr++, i++)
+               OSMO_ASSERT(*cptr == (uint8_t)i);
+
+       rc = msgb_resize_area(msg, msg->l2h, 50, 8000);
+       OSMO_ASSERT(rc == -1);
+
+       msgb_free(msg);
+
+       osmo_set_panic_handler(NULL);
+}
+
+static struct log_info info = {};
+
+int main(int argc, char **argv)
+{
+       osmo_init_logging(&info);
+
+       test_msgb_api();
+       test_msgb_api_errors();
+       test_msgb_copy();
+       test_msgb_resize_area();
+
+       printf("Success.\n");
+
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/msgb/msgb_test.ok 
new/libosmocore/tests/msgb/msgb_test.ok
--- old/libosmocore/tests/msgb/msgb_test.ok     1970-01-01 01:00:00.000000000 
+0100
+++ new/libosmocore/tests/msgb/msgb_test.ok     2016-01-22 19:08:39.000000000 
+0100
@@ -0,0 +1,35 @@
+Testing the msgb API
+Buffer: 
+put(4) -> data+0
+Buffer: [L1]> 00 00 00 00 
+put(4) -> data+4
+Buffer: [L1]> 00 00 00 00 [L2]> 00 00 00 00 
+put(4) -> data+8
+Buffer: [L1]> 00 00 00 00 [L2]> 00 00 00 00 [L3]> 00 00 00 00 
+put(4) -> data+12
+Buffer: [L1]> 00 00 00 00 [L2]> 00 00 00 00 [L3]> 00 00 00 00 [L4]> 00 00 00 
00 
+push(4) -> data+0
+Buffer: 00 00 00 00 [L1]> 00 00 00 00 [L2]> 00 00 00 00 [L3]> 00 00 00 00 
[L4]> 00 00 00 00 
+trim(16) -> 0
+Buffer: 00 00 00 00 [L1]> 00 00 00 00 [L2]> 00 00 00 00 [L3]> 00 00 00 00 
[L4]> 
+get(4) -> data+12
+Buffer: 00 00 00 00 [L1]> 00 00 00 00 [L2]> 00 00 00 00 [L3]> (L4=tail+4) 
+Test msgb_hexdump
+Buffer: (L1=data-124) 00 00 00 00 00 00 00 00 [L2]> 00 00 00 00 [L3]> 
(L4=tail+4) 
+Buffer: (L1=data-124) 00 00 00 00 00 00 00 00 [L2]> (L3+8) 00 00 00 00 
(L4=tail+4) 
+Buffer: (L1=data-124) 00 00 00 00 00 00 00 00 [L2]> 00 00 00 00 (L3 out of 
range) (L4=tail+4) 
+Testing the msgb API error handling
+msgb(%p): Negative length is not allowed
+Testing msgb_copy
+Src: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 
14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 
2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 
44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
+Dst: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 
14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 
2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 
44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
+msgb(%p): Sub area is not fully contained in the msg data
+msgb(%p): Sub area is not fully contained in the msg data
+msgb(%p): Sub area is not fully contained in the msg data
+msgb(%p): Negative sizes are not allowed
+msgb(%p): Negative sizes are not allowed
+Testing msgb_resize_area
+Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 
[L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 
2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 
42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
+Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 
[L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 
3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
+Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 
[L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 
48 49 4a 4b 4c 4d 4e 4f 
+Success.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libosmocore/tests/testsuite.at 
new/libosmocore/tests/testsuite.at
--- old/libosmocore/tests/testsuite.at  2015-12-23 17:57:20.000000000 +0100
+++ new/libosmocore/tests/testsuite.at  2016-01-22 19:08:39.000000000 +0100
@@ -21,12 +21,24 @@
 AT_CHECK([$abs_top_builddir/tests/bits/bitrev_test], [0], [expout])
 AT_CLEANUP
 
+AT_SETUP([bitvec])
+AT_KEYWORDS([bitvec])
+cat $abs_srcdir/bitvec/bitvec_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/bitvec/bitvec_test], [0], [expout], [ignore])
+AT_CLEANUP
+
 AT_SETUP([conv])
 AT_KEYWORDS([conv])
 cat $abs_srcdir/conv/conv_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/conv/conv_test], [0], [expout])
 AT_CLEANUP
 
+AT_SETUP([msgb])
+AT_KEYWORDS([msgb])
+cat $abs_srcdir/msgb/msgb_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/msgb/msgb_test], [0], [expout], [ignore])
+AT_CLEANUP
+
 if ENABLE_MSGFILE
 AT_SETUP([msgfile])
 AT_KEYWORDS([msgfile])
@@ -84,6 +96,12 @@
 AT_CHECK([$abs_top_builddir/tests/gsm0408/gsm0408_test], [0], [expout], 
[ignore])
 AT_CLEANUP
 
+AT_SETUP([gprs])
+AT_KEYWORDS([gprs])
+cat $abs_srcdir/gprs/gprs_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/gprs/gprs_test], [0], [expout], [ignore])
+AT_CLEANUP
+
 AT_SETUP([logging])
 AT_KEYWORDS([logging])
 cat $abs_srcdir/logging/logging_test.ok > expout

++++++ test.diff ++++++

resolve this compile warning hinting about bad code:

msgb/msgb_test.c:198:31: warning: cast from pointer to integer of different 
size [-Wpointer-to-int-cast]
   msgb_resize_area(msg, NULL, (int)msg->data, 0);

---
 tests/msgb/msgb_test.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: libosmocore/tests/msgb/msgb_test.c
===================================================================
--- libosmocore.orig/tests/msgb/msgb_test.c
+++ libosmocore/tests/msgb/msgb_test.c
@@ -195,7 +195,7 @@ static void test_msgb_resize_area()
        OSMO_ASSERT(e != 0);
 
        if (OSMO_PANIC_TRY(&e))
-               msgb_resize_area(msg, NULL, (int)msg->data, 0);
+               msgb_resize_area(msg, NULL, (intptr_t)msg->data, 0);
        OSMO_ASSERT(e != 0);
 
        if (OSMO_PANIC_TRY(&e))

Reply via email to