Path: blob/main/contrib/libarchive/cpio/test/test_option_b64encode.c
39507 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2003-2007 Tim Kientzle4* Copyright (c) 2012 Michihiro NAKAJIMA5* All rights reserved.6*/7#include "test.h"89DEFINE_TEST(test_option_b64encode)10{11char *p;12size_t s;1314/* Create a file. */15assertMakeFile("f", 0644, "a");1617/* Archive it with compress compression and uuencode. */18assertEqualInt(0,19systemf("echo f | %s -o -Z --b64encode >archive.out 2>archive.err",20testprog));21/* Check that the archive file has an uuencode signature. */22p = slurpfile(&s, "archive.out");23assert(s > 2);24assertEqualMem(p, "begin-base64 644", 16);25free(p);2627/* Archive it with uuencode only. */28assertEqualInt(0,29systemf("echo f | %s -o --b64encode >archive.out 2>archive.err",30testprog));31/* Check that the archive file has an uuencode signature. */32p = slurpfile(&s, "archive.out");33assert(s > 2);34assertEqualMem(p, "begin-base64 644", 16);35free(p);36}373839