Hello,

the originally submitted test wrongly allocates the estr variables.
Udpated debdiff attached, in a more convenient form.

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
Add simple autopkgtest for package.

Author: Vibhav Pant <vib...@ubuntu.com>
--- firestring-0.9.12.orig/debian/tests/build
+++ firestring-0.9.12/debian/tests/build
@@ -0,0 +1,39 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against firestring, to verify that
+# the headers and pkg-config file are installed correctly
+# (C) 2013 Canonical Ltd.
+# Author: Vibhav Pant <vibh...@ubuntu.com>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > firestring_test.c
+#include <firestring.h>
+#include <assert.h>
+#include <stdlib.h>
+
+void test_baselib()
+{
+       struct firestring_estr_t dest, source;
+       firestring_estr_alloc(&source, 50);
+       firestring_estr_alloc(&dest, 50);
+       firestring_estr_sprintf(&source, "autopkgtest");
+       assert(firestring_estr_base64_encode(&dest, &source) == 0);
+       void *p = firestring_malloc(sizeof(double));
+       free(p);
+}
+
+int main(void)
+{
+       test_baselib();
+       return 0;
+}
+EOF
+
+gcc -o firestring_test firestring_test.c -lfirestring -Werror -Wall
+echo "build: OK"
+[ -x firestring_test ]
+./firestring_test
+echo "run: OK"
only in patch2:
unchanged:
--- firestring-0.9.12.orig/debian/tests/control
+++ firestring-0.9.12/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: build
+Depends: libfirestring-dev, build-essential
\ No newline at end of file

Reply via email to