Deleted Added
full compact
test_option_lzop.c (302408) test_option_lzop.c (318482)
1/*-
2 * Copyright (c) 2003-2007 Tim Kientzle
3 * Copyright (c) 2012 Michihiro NAKAJIMA
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 25 unchanged lines hidden (view full) ---

34
35 /* Create a file. */
36 assertMakeFile("f", 0644, "a");
37
38 /* Archive it with lzop compression. */
39 r = systemf("echo f | %s -o --lzop >archive.out 2>archive.err",
40 testprog);
41 p = slurpfile(&s, "archive.err");
1/*-
2 * Copyright (c) 2003-2007 Tim Kientzle
3 * Copyright (c) 2012 Michihiro NAKAJIMA
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 25 unchanged lines hidden (view full) ---

34
35 /* Create a file. */
36 assertMakeFile("f", 0644, "a");
37
38 /* Archive it with lzop compression. */
39 r = systemf("echo f | %s -o --lzop >archive.out 2>archive.err",
40 testprog);
41 p = slurpfile(&s, "archive.err");
42 p[s] = '\0';
42 free(p);
43 if (r != 0) {
44 if (!canLzop()) {
45 skipping("lzop is not supported on this platform");
46 return;
47 }
48 failure("--lzop option is broken");
49 assertEqualInt(r, 0);
50 return;
51 }
52 /* Check that the archive file has an lzma signature. */
53 p = slurpfile(&s, "archive.out");
54 assert(s > 2);
55 assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
43 if (r != 0) {
44 if (!canLzop()) {
45 skipping("lzop is not supported on this platform");
46 return;
47 }
48 failure("--lzop option is broken");
49 assertEqualInt(r, 0);
50 return;
51 }
52 /* Check that the archive file has an lzma signature. */
53 p = slurpfile(&s, "archive.out");
54 assert(s > 2);
55 assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
56 free(p);
56}
57}