aboutsummaryrefslogtreecommitdiff
path: root/lib/tar/test
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-05 19:06:42 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-05 16:01:34 +0200
commitc9a8adc15f9de110771156fdc85fb98533648a53 (patch)
treecdd6300b1c69a002628a76c4bac45ac6664111d9 /lib/tar/test
parent57ca46cdd74fd1004a3b0476c136e1f26fcf002d (diff)
Move dir_entry_xattr_t from libio to libsquashfs
The structure and functions are renamed to sqfs_xattr_* instead, an additional helper is added to accept an encoded xattr. Documentation and unit test are added as well. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/test')
-rw-r--r--lib/tar/test/tar_write_simple.c17
-rw-r--r--lib/tar/test/tar_xattr.c1
-rw-r--r--lib/tar/test/tar_xattr_bin.c1
3 files changed, 11 insertions, 8 deletions
diff --git a/lib/tar/test/tar_write_simple.c b/lib/tar/test/tar_write_simple.c
index 738b469..8a41c8f 100644
--- a/lib/tar/test/tar_write_simple.c
+++ b/lib/tar/test/tar_write_simple.c
@@ -9,6 +9,7 @@
#include "io/ostream.h"
#include "io/file.h"
#include "util/test.h"
+#include "sqfs/xattr.h"
#include "compat.h"
/*****************************************************************************/
@@ -52,7 +53,7 @@ static const char *buffer_get_filename(ostream_t *strm)
#define TIME_STAMP (1057296600)
-static dir_entry_xattr_t *mkxattr_chain(void)
+static sqfs_xattr_t *mkxattr_chain(void)
{
static const uint8_t value[] = {
0x00, 0x00, 0x00, 0x02,
@@ -61,20 +62,20 @@ static dir_entry_xattr_t *mkxattr_chain(void)
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
};
- dir_entry_xattr_t *list;
+ sqfs_xattr_t *list;
- list = dir_entry_xattr_create("user.mime_type",
- (const sqfs_u8 *)"blob/magic", 10);
+ list = sqfs_xattr_create("user.mime_type",
+ (const sqfs_u8 *)"blob/magic", 10);
TEST_NOT_NULL(list);
- list->next = dir_entry_xattr_create("security.capability",
- value, sizeof(value));
+ list->next = sqfs_xattr_create("security.capability",
+ value, sizeof(value));
TEST_NOT_NULL(list->next);
return list;
}
int main(int argc, char **argv)
{
- dir_entry_xattr_t *xattr;
+ sqfs_xattr_t *xattr;
struct stat sb;
istream_t *fp;
int ret;
@@ -154,7 +155,7 @@ int main(int argc, char **argv)
ret = write_tar_header(&mem_stream, &sb, "home/goliath/test.exe",
NULL, xattr, 11);
TEST_EQUAL_I(ret, 0);
- dir_entry_xattr_list_free(xattr);
+ sqfs_xattr_list_free(xattr);
ret = ostream_append(&mem_stream, ":-)\n", 4);
TEST_EQUAL_I(ret, 0);
diff --git a/lib/tar/test/tar_xattr.c b/lib/tar/test/tar_xattr.c
index 122d1db..1577fc7 100644
--- a/lib/tar/test/tar_xattr.c
+++ b/lib/tar/test/tar_xattr.c
@@ -8,6 +8,7 @@
#include "io/file.h"
#include "tar/tar.h"
#include "util/test.h"
+#include "sqfs/xattr.h"
int main(int argc, char **argv)
{
diff --git a/lib/tar/test/tar_xattr_bin.c b/lib/tar/test/tar_xattr_bin.c
index 90443a1..129d227 100644
--- a/lib/tar/test/tar_xattr_bin.c
+++ b/lib/tar/test/tar_xattr_bin.c
@@ -8,6 +8,7 @@
#include "io/file.h"
#include "tar/tar.h"
#include "util/test.h"
+#include "sqfs/xattr.h"
static const uint8_t value[] = {
0x00, 0x00, 0x00, 0x02,