From 84ff0984bb5b471d0b4cbc0b0fca156c29273bf5 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 2 Sep 2020 11:19:11 +0200 Subject: Fix nonexistant gnu tar sparse format 1.0 support Contrary to previous claims, support for the GNU tar sparse format 1.0 was missing entirely (the newest of their 3 different sparse mapping formats). This oversight wasn't caught, because the unit test was compiling the wrong source file and tar2sqfs had no problem processing the test file because it is still a valid POSIX-ish tar archive (but the sparse part was missing and the mapping embedded in the file). Signed-off-by: David Oberhollenzer --- tests/Makemodule.am | 2 +- tests/tar/sqfs.sha512 | 2 +- tests/tar_sparse_gnu2.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/Makemodule.am b/tests/Makemodule.am index 9694619..2aea363 100644 --- a/tests/Makemodule.am +++ b/tests/Makemodule.am @@ -87,7 +87,7 @@ test_tar_sparse_gnu1_LDADD = libtar.a libcompat.a test_tar_sparse_gnu1_CPPFLAGS = $(AM_CPPFLAGS) test_tar_sparse_gnu1_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_sparse_gnu2_SOURCES = tests/tar_sparse_gnu1.c tests/test.h +test_tar_sparse_gnu2_SOURCES = tests/tar_sparse_gnu2.c tests/test.h test_tar_sparse_gnu2_LDADD = libtar.a libcompat.a test_tar_sparse_gnu2_CPPFLAGS = $(AM_CPPFLAGS) test_tar_sparse_gnu2_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar diff --git a/tests/tar/sqfs.sha512 b/tests/tar/sqfs.sha512 index bcdd245..90dbf7f 100644 --- a/tests/tar/sqfs.sha512 +++ b/tests/tar/sqfs.sha512 @@ -5,7 +5,7 @@ 5b032c35f80b73f21aef8e9f558c16605676e3e621e927177c4ab0a60ba7441a7501dd21a1c37d43d8432bfa694b6afcbe834a277e2fd8f23315e16bc3cdd86a tests/tar/sparse-files/gnu.sqfs 5b032c35f80b73f21aef8e9f558c16605676e3e621e927177c4ab0a60ba7441a7501dd21a1c37d43d8432bfa694b6afcbe834a277e2fd8f23315e16bc3cdd86a tests/tar/sparse-files/pax-gnu0-1.sqfs 5b032c35f80b73f21aef8e9f558c16605676e3e621e927177c4ab0a60ba7441a7501dd21a1c37d43d8432bfa694b6afcbe834a277e2fd8f23315e16bc3cdd86a tests/tar/sparse-files/pax-gnu0-0.sqfs -dbeb3e3e94a9f6e778cf626492776eb77d9482d2a27b781778987225605be8ab59aa08fb85912afc9fe7bd5ac2aed94f371f930de4685955d40e1ad70aa4380c tests/tar/sparse-files/pax-gnu1-0.sqfs +5b032c35f80b73f21aef8e9f558c16605676e3e621e927177c4ab0a60ba7441a7501dd21a1c37d43d8432bfa694b6afcbe834a277e2fd8f23315e16bc3cdd86a tests/tar/sparse-files/pax-gnu1-0.sqfs 1b9525453fb10f266cd7f52300fa2ff586a9b5a1c141da46f72c6370485d4dc7e306f2e778108644cdea6f06ee95a2972325f950ef5fce98bf439db1869c692a tests/tar/large-mtime/12-digit.sqfs 1b9525453fb10f266cd7f52300fa2ff586a9b5a1c141da46f72c6370485d4dc7e306f2e778108644cdea6f06ee95a2972325f950ef5fce98bf439db1869c692a tests/tar/large-mtime/gnu.sqfs 1b9525453fb10f266cd7f52300fa2ff586a9b5a1c141da46f72c6370485d4dc7e306f2e778108644cdea6f06ee95a2972325f950ef5fce98bf439db1869c692a tests/tar/large-mtime/pax.sqfs diff --git a/tests/tar_sparse_gnu2.c b/tests/tar_sparse_gnu2.c index 84a18ec..2a54640 100644 --- a/tests/tar_sparse_gnu2.c +++ b/tests/tar_sparse_gnu2.c @@ -44,7 +44,7 @@ int main(void) TEST_EQUAL_UI(sparse->count, 4096); sparse = sparse->next; - TSET_NOT_NULL(sparse); + TEST_NOT_NULL(sparse); TEST_EQUAL_UI(sparse->offset, 524288); TEST_EQUAL_UI(sparse->count, 4096); @@ -74,7 +74,7 @@ int main(void) TEST_EQUAL_UI(sparse->count, 4096); sparse = sparse->next; - TEST_NOT_NULL(sparse != NULL); + TEST_NOT_NULL(sparse); TEST_EQUAL_UI(sparse->offset, 2097152); TEST_EQUAL_UI(sparse->count, 0); -- cgit v1.2.3