1324145Smm/*- 2324145Smm * Copyright (c) 2017 Sean Purcell 3324145Smm * All rights reserved. 4324145Smm * 5324145Smm * Redistribution and use in source and binary forms, with or without 6324145Smm * modification, are permitted provided that the following conditions 7324145Smm * are met: 8324145Smm * 1. Redistributions of source code must retain the above copyright 9324145Smm * notice, this list of conditions and the following disclaimer. 10324145Smm * 2. Redistributions in binary form must reproduce the above copyright 11324145Smm * notice, this list of conditions and the following disclaimer in the 12324145Smm * documentation and/or other materials provided with the distribution. 13324145Smm * 14324145Smm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15324145Smm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16324145Smm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17324145Smm * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18324145Smm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19324145Smm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20324145Smm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21324145Smm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22324145Smm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23324145Smm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24324145Smm */ 25324145Smm#include "test.h" 26324145Smm 27324145SmmDEFINE_TEST(test_expand_zstd) 28324145Smm{ 29324145Smm const char *reffile = "test_expand.zst"; 30324145Smm int f; 31324145Smm 32324145Smm extract_reference_file(reffile); 33324145Smm f = systemf("%s %s >test.out 2>test.err", testprog, reffile); 34324145Smm if (f == 0 || canZstd()) { 35324145Smm assertEqualInt(0, f); 36324145Smm assertTextFileContents("contents of test_expand.zst.\n", "test.out"); 37324145Smm assertEmptyFile("test.err"); 38324145Smm } else { 39324145Smm skipping("It seems zstd is not supported on this platform"); 40324145Smm } 41324145Smm} 42