Lines Matching +full:libarchive +full:- +full:dev

2  * Copyright (c) 2003-2009 Tim Kientzle
99 * configure check. If libarchive and libarchive_test both look for
105 * try to minimize conditionals by grouping platform-specific tests in
108 * differences. Platform-specific coding in libarchive_test is often
109 * a symptom that some capability is missing from libarchive itself.
165 /* Name of exe to use in printf-formatted command strings. */
354 // Silence unused-parameter compiler warnings. in invalid_parameter_handler()
377 #define VERBOSITY_SUMMARY_ONLY -1 /* -q */
379 #define VERBOSITY_LIGHT_REPORT 1 /* -v */
380 #define VERBOSITY_FULL 2 /* -vv */
443 * Copy arguments into file-local variables.
530 * The 'extra' hook here is used by libarchive to include libarchive
568 --failures; /* Undo failures++ in failure_start() */ in test_skipping()
651 * Utility to convert a single UTF-8 sequence.
657 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */ in _utf8_to_unicode()
658 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */ in _utf8_to_unicode()
659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */ in _utf8_to_unicode()
660 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */ in _utf8_to_unicode()
661 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */ in _utf8_to_unicode()
662 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */ in _utf8_to_unicode()
663 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */ in _utf8_to_unicode()
664 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */ in _utf8_to_unicode()
665 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */ in _utf8_to_unicode()
666 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */ in _utf8_to_unicode()
667 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */ in _utf8_to_unicode()
668 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */ in _utf8_to_unicode()
669 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */ in _utf8_to_unicode()
670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */ in _utf8_to_unicode()
671 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */ in _utf8_to_unicode()
672 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */ in _utf8_to_unicode()
684 * Decode 1-4 bytes depending on the value of the first byte. in _utf8_to_unicode()
688 return (0); /* Standard: return 0 for end-of-string. */ in _utf8_to_unicode()
693 return (-1); in _utf8_to_unicode()
695 /* Make a Unicode code point from a single UTF-8 sequence. */ in _utf8_to_unicode()
701 if ((s[1] & 0xc0) != 0x80) return (-1); in _utf8_to_unicode()
705 if ((s[1] & 0xc0) != 0x80) return (-1); in _utf8_to_unicode()
706 if ((s[2] & 0xc0) != 0x80) return (-1); in _utf8_to_unicode()
711 return (-1);/* Overlong sequence. */ in _utf8_to_unicode()
715 return (-1); in _utf8_to_unicode()
716 if ((s[1] & 0xc0) != 0x80) return (-1); in _utf8_to_unicode()
717 if ((s[2] & 0xc0) != 0x80) return (-1); in _utf8_to_unicode()
718 if ((s[3] & 0xc0) != 0x80) return (-1); in _utf8_to_unicode()
724 return (-1);/* Overlong sequence. */ in _utf8_to_unicode()
727 return (-1); in _utf8_to_unicode()
733 return (-1); in _utf8_to_unicode()
764 logprintf(" (length %d)", q == NULL ? -1 : (int)strlen(q)); in strdump()
767 * If the current string is UTF-8, dump its code points. in strdump()
783 len -= n; in strdump()
852 if (*s1 > *--s2) in wcscmp()
855 return -1; in wcscmp()
946 l -= 16; in assertion_equal_mem()
1176 n = (int)fread(contents, 1, s * 2 + 128 - 1, f); in assertion_text_file_contents()
1372 /* As a side-effect, asserts that both files exist. */
1484 filet = (wintm.QuadPart - EPOC_TIME) / 10000000; in assertion_file_time()
1485 filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100; in assertion_file_time()
1509 * (e.g., UFS1) always return -1 here. */ in assertion_file_time()
1510 if (filet == -1) { in assertion_file_time()
1530 /* Check that requested time is up-to-date. */ in assertion_file_time()
1532 if (filet < now - 10 || filet > now + 1) { in assertion_file_time()
1535 pathname, type, filet, now - filet); in assertion_file_time()
1557 /* Verify atime of 'pathname' is up-to-date. */
1572 /* Verify birthtime of 'pathname' is up-to-date. */
1617 /* Verify mtime of 'pathname' is up-to-date. */
1757 * non-NULL, verify that the symlink has those contents.
1846 if (buf->ReparseTag != IO_REPARSE_TAG_SYMLINK) { in is_symlink()
1860 len = buf->SymbolicLinkReparseBuffer.SubstituteNameLength; in is_symlink()
1868 memcpy(linknamew, &((BYTE *)buf->SymbolicLinkReparseBuffer.PathBuffer) in is_symlink()
1869 [buf->SymbolicLinkReparseBuffer.SubstituteNameOffset], len); in is_symlink()
1908 linklen = readlink(pathname, buff, sizeof(buff) - 1); in is_symlink()
2370 --s; in assert_version_id()
2375 s -= 3; in assert_version_id()
2388 ++q; --s; in assert_version_id()
2405 r = systemf("%s --version >version.stdout 2>version.stderr", prog); in assertVersion()
2407 r = systemf("%s -W version >version.stdout 2>version.stderr", in assertVersion()
2410 failure("Unable to run either %s --version or %s -W version", in assertVersion()
2415 /* --version should generate nothing to stdout. */ in assertVersion()
2430 q += prog_len; s -= prog_len; in assertVersion()
2433 q++; s--; in assertVersion()
2438 failure("No `-' between program name and versions: ``%s''", p); in assertVersion()
2439 assertEqualMem(q, "- ", 2); in assertVersion()
2440 q += 2; s -= 2; in assertVersion()
2442 failure("Not long enough for libarchive version: ``%s''", p); in assertVersion()
2445 failure("Libarchive version must start with `libarchive': ``%s''", p); in assertVersion()
2446 assertEqualMem(q, "libarchive ", 11); in assertVersion()
2448 q += 11; s -= 11; in assertVersion()
2452 /* Skip arbitrary third-party version numbers. */ in assertVersion()
2453 while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || in assertVersion()
2456 --s; in assertVersion()
2459 /* All terminated by end-of-line. */ in assertVersion()
2465 if (*q == '\r') { ++q; --s; } in assertVersion()
2515 /* Platform-dependent options for hiding the output of a subcommand. */
2519 static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
2530 if (systemf("bzip2 --help %s", redirectArgs) == 0) in canBzip2()
2545 if (systemf("grzip -V %s", redirectArgs) == 0) in canGrzip()
2560 if (systemf("gzip --help %s", redirectArgs) == 0) in canGzip()
2587 if (systemf("lrzip -V %s", redirectArgs) == 0) in canLrzip()
2602 if (systemf("lz4 --help %s", redirectArgs) == 0) in canLz4()
2617 if (systemf("zstd --help %s", redirectArgs) == 0) in canZstd()
2632 if (systemf("lzip --help %s", redirectArgs) == 0) in canLzip()
2647 if (systemf("lzma --help %s", redirectArgs) == 0) in canLzma()
2662 if (systemf("lzop --help %s", redirectArgs) == 0) in canLzop()
2677 if (systemf("xz --help %s", redirectArgs) == 0) in canXz()
2821 size) > -1) in setXattr()
2856 *aclcnt = -1; in sunacl_get()
2861 cnt = -2; in sunacl_get()
2862 while (cnt == -2 || (cnt == -1 && errno == ENOSPC)) { in sunacl_get()
2910 const char *acltext_posix1e = "user:1:rw-," in setTestAcl()
2911 "group:15:r-x," in setTestAcl()
2914 "other::r-x," in setTestAcl()
2918 { USER_OBJ, -1, 4 | 2 | 1 }, in setTestAcl()
2920 { GROUP_OBJ, -1, 4 | 2 | 1 }, in setTestAcl()
2922 { CLASS_OBJ, -1, 4 | 2 | 1 }, in setTestAcl()
2923 { OTHER_OBJ, -1, 4 | 2 | 1 } in setTestAcl()
2949 { -1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA | in setTestAcl()
2954 { -1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA | in setTestAcl()
2958 { -1, ACE_READ_DATA | ACE_EXECUTE | ACE_READ_ATTRIBUTES | in setTestAcl()
3075 * ensuring that the wall-clock time has actually changed before we
3076 * go back to re-read something from disk.
3111 * Returns size of file in 'sizep' if non-NULL, null-terminates
3131 /* Note: No error; non-existent file is okay here. */ in slurpfile()
3163 * Returns size of file in 'sizep' if non-NULL, null-terminates
3186 #define UUDECODE(c) (((c) - 0x20) & 0x3f)
3220 /* Write out 1-3 bytes from that. */ in extract_reference_file()
3226 --bytes; in extract_reference_file()
3231 --bytes; in extract_reference_file()
3237 --bytes; in extract_reference_file()
3333 if (type != acl->type) in archive_test_acl_match()
3335 if (permset != acl->permset) in archive_test_acl_match()
3337 if (tag != acl->tag) in archive_test_acl_match()
3347 if (qual != acl->qual) in archive_test_acl_match()
3350 if (acl->name == NULL || acl->name[0] == '\0') in archive_test_acl_match()
3354 if (acl->name == NULL) { in archive_test_acl_match()
3359 return (0 == strcmp(name, acl->name)); in archive_test_acl_match()
3399 marker[i] = marker[n - 1]; in assertion_entry_compare_acls()
3400 n--; in assertion_entry_compare_acls()
3516 * Summarize repeated failures in the just-completed test.
3562 case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */ in test_run()
3565 printf("%3d: %-64s", i, tests[i].name); in test_run()
3572 /* Chdir to the top-level work directory. */ in test_run()
3613 /* Report per-test summaries. */ in test_run()
3614 tests[i].failures = failures - failures_before; in test_run()
3615 test_summarize(tests[i].failures, skips - skips_before); in test_run()
3616 /* Close the per-test log file. */ in test_run()
3638 systemf("rm -rf %s", tests[i].name); in test_run()
3665 printf(" -d Dump core after any failure, for debugging.\n"); in usage()
3666 printf(" -k Keep all temp files.\n"); in usage()
3669 printf(" -p <path> Path to executable to be tested.\n"); in usage()
3672 printf(" -q Quiet.\n"); in usage()
3673 printf(" -r <dir> Path to dir containing reference files.\n"); in usage()
3675 printf(" -u Keep running specifies tests until one fails.\n"); in usage()
3676 printf(" -v Verbose.\n"); in usage()
3714 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3715 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3725 while (pwd[strlen(pwd) - 1] == '\n') in get_refdir()
3726 pwd[strlen(pwd) - 1] = '\0'; in get_refdir()
3732 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3733 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3738 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3739 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3748 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3749 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3755 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3756 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3763 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3764 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3769 strncat(tried, buff, tried_size - strlen(tried) - 1); in get_refdir()
3770 strncat(tried, "\n", tried_size - strlen(tried) - 1); in get_refdir()
3776 printf("Use -r option to specify full path to reference directory\n"); in get_refdir()
3793 /* Filter tests against a glob pattern. Returns non-zero if test matches
3795 * the return values (i.e. returns zero for a match, non-zero otherwise.
3854 start += *vp - '0'; in get_test_set()
3859 } else if (*vp == '-') { in get_test_set()
3862 end = limit - 1; in get_test_set()
3867 end += *vp - '0'; in get_test_set()
3872 return (-1); in get_test_set()
3874 return (-1); in get_test_set()
3884 return ((idx == 0)?-1:idx); in get_test_set()
3923 while (pwd[strlen(pwd) - 1] == '\n') in main()
3924 pwd[strlen(pwd) - 1] = '\0'; in main()
3995 while (tmplen > 0 && tmp[tmplen - 1] == '/') in main()
3996 tmplen--; in main()
3998 /* Allow -d to be controlled through the environment. */ in main()
4002 /* Allow -v to be controlled through the environment. */ in main()
4024 if (**argv != '-') in main()
4027 ++p; /* Skip '-' */ in main()
4037 "Option -%c requires argument.\n", in main()
4057 fprintf(stderr, "-p option not permitted\n"); in main()
4063 verbosity--; in main()
4084 * Sanity-check that our options make sense. in main()
4148 "%Y-%m-%dT%H.%M.%S", tmptr); in main()
4156 snprintf(tmpdir, sizeof(tmpdir), "%.*s/%s.%s-%03d", in main()