[med-svn] [Git][med-team/libvbz-hdf-plugin][master] 2 commits: d/watch: Use Dist in Gihub template
Andreas Tille (@tille)
gitlab at salsa.debian.org
Mon Sep 14 17:08:53 BST 2026
Andreas Tille pushed to branch master at Debian Med / libvbz-hdf-plugin
Commits:
0a361c20 by Andreas Tille at 2026-09-14T17:59:40+02:00
d/watch: Use Dist in Gihub template
- - - - -
bad6561e by Andreas Tille at 2026-09-14T18:08:39+02:00
Add autopkgtest
- - - - -
8 changed files:
- + debian/README.test
- debian/changelog
- + debian/libvbz-hdf-plugin-dev.docs
- + debian/libvbz-hdf-plugin-dev.examples
- + debian/tests/control
- + debian/tests/run-unit-test
- + debian/tests/test_vbz.c
- debian/watch
Changes:
=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+ sh run-unit-test
+
+in order to confirm its integrity.
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+libvbz-hdf-plugin (1.0.13-2) UNRELEASED; urgency=medium
+
+ * d/watch: Use Dist in Gihub template
+ * Add autopkgtest
+
+ -- Andreas Tille <tille at debian.org> Mon, 14 Sep 2026 10:05:49 +0200
+
libvbz-hdf-plugin (1.0.13-1) unstable; urgency=medium
[ Andreas Tille ]
=====================================
debian/libvbz-hdf-plugin-dev.docs
=====================================
@@ -0,0 +1,2 @@
+debian/tests/run-unit-test
+debian/README.test
=====================================
debian/libvbz-hdf-plugin-dev.examples
=====================================
@@ -0,0 +1 @@
+debian/tests/*.c
=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, hdf5-helpers
+Restrictions: allow-stderr
=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+pkg=libvbz-hdf-plugin
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+ AUTOPKGTEST_TMP=$(mktemp -d /var/tmp/${pkg}-test.XXXXXX)
+ # shellcheck disable=SC2064
+ trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}-dev/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+h5cc -Wall -O2 test_vbz.c -o test_vbz
+
+DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
+export HDF5_PLUGIN_PATH="/usr/lib/${DEB_HOST_MULTIARCH}/hdf5/plugins"
+
+./test_vbz
=====================================
debian/tests/test_vbz.c
=====================================
@@ -0,0 +1,138 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <hdf5.h>
+
+#define VBZ_FILTER_ID 32020
+
+/* Parameters documented by the VBZ plugin:
+ * 0: filter version
+ * 0: padding
+ * 2: integer size
+ * 1: zig-zag encoding
+ * 1: zstd compression level
+ */
+static const unsigned int vbz_params[] = { 0, 0, 2, 1, 1 };
+
+#define N 10000
+
+static void check(herr_t status, const char *what)
+{
+ if (status < 0) {
+ fprintf(stderr, "ERROR: %s\n", what);
+ exit(EXIT_FAILURE);
+ }
+}
+
+int main(void)
+{
+ const char *filename = "test_vbz.h5";
+ const char *dataset = "signal";
+
+ uint16_t write_data[N];
+ uint16_t read_data[N];
+
+ for (size_t i = 0; i < N; i++)
+ write_data[i] = (uint16_t)(i % 1000);
+
+ /* ------------------------------------------------------------ */
+ /* Create file and write a VBZ-compressed dataset */
+ /* ------------------------------------------------------------ */
+
+ hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (file < 0) {
+ fprintf(stderr, "ERROR: H5Fcreate failed\n");
+ return EXIT_FAILURE;
+ }
+
+ hsize_t dims[] = { N };
+ hsize_t chunk[] = { N };
+
+ hid_t space = H5Screate_simple(1, dims, NULL);
+ if (space < 0) {
+ fprintf(stderr, "ERROR: H5Screate_simple failed\n");
+ return EXIT_FAILURE;
+ }
+
+ hid_t dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ if (dcpl < 0) {
+ fprintf(stderr, "ERROR: H5Pcreate failed\n");
+ return EXIT_FAILURE;
+ }
+
+ check(H5Pset_chunk(dcpl, 1, chunk), "H5Pset_chunk");
+
+ check(H5Pset_filter(dcpl,
+ VBZ_FILTER_ID,
+ H5Z_FLAG_MANDATORY,
+ sizeof(vbz_params) / sizeof(vbz_params[0]),
+ vbz_params),
+ "H5Pset_filter(VBZ)");
+
+ hid_t dset = H5Dcreate2(file, dataset, H5T_NATIVE_UINT16,
+ space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+
+ if (dset < 0) {
+ fprintf(stderr, "ERROR: H5Dcreate2 failed\n");
+ return EXIT_FAILURE;
+ }
+
+ printf("Writing %zu uint16 values...\n", (size_t)N);
+
+ check(H5Dwrite(dset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, write_data),
+ "H5Dwrite");
+
+ check(H5Dclose(dset), "H5Dclose");
+ check(H5Pclose(dcpl), "H5Pclose");
+ check(H5Sclose(space), "H5Sclose");
+ check(H5Fclose(file), "H5Fclose");
+
+ printf("Write successful.\n");
+
+ /* ------------------------------------------------------------ */
+ /* Reopen and read the VBZ-compressed dataset */
+ /* ------------------------------------------------------------ */
+
+ file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file < 0) {
+ fprintf(stderr, "ERROR: H5Fopen failed\n");
+ return EXIT_FAILURE;
+ }
+
+ dset = H5Dopen2(file, dataset, H5P_DEFAULT);
+ if (dset < 0) {
+ fprintf(stderr, "ERROR: H5Dopen2 failed\n");
+ return EXIT_FAILURE;
+ }
+
+ printf("Reading %zu uint16 values...\n", (size_t)N);
+
+ check(H5Dread(dset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, read_data),
+ "H5Dread");
+
+ check(H5Dclose(dset), "H5Dclose");
+ check(H5Fclose(file), "H5Fclose");
+
+ /* ------------------------------------------------------------ */
+ /* Verify the round trip */
+ /* ------------------------------------------------------------ */
+
+ for (size_t i = 0; i < N; i++) {
+ if (read_data[i] != write_data[i]) {
+ fprintf(stderr,
+ "ERROR: data mismatch at index %zu: "
+ "wrote %u, read %u\n",
+ i, write_data[i], read_data[i]);
+ return EXIT_FAILURE;
+ }
+ }
+
+ printf("Read successful.\n");
+ printf("VBZ round-trip successful.\n");
+
+ return EXIT_SUCCESS;
+}
+
=====================================
debian/watch
=====================================
@@ -1,5 +1,4 @@
Version: 5
Template: Github
-Owner: nanoporetech
-Project: vbz_compression
+Dist: https://github.com/nanoporetech/vbz_compression
View it on GitLab: https://salsa.debian.org/med-team/libvbz-hdf-plugin/-/compare/413888423ef5d26109bfe40e2316e059bd4bf592...bad6561e630b45f79b82db5acc5eee5aea61cac6
--
View it on GitLab: https://salsa.debian.org/med-team/libvbz-hdf-plugin/-/compare/413888423ef5d26109bfe40e2316e059bd4bf592...bad6561e630b45f79b82db5acc5eee5aea61cac6
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260914/a9811d2f/attachment-0001.htm>
More information about the debian-med-commit
mailing list