Path: blob/main/contrib/libarchive/unzip/test/test_0.c
39483 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2003-2007 Tim Kientzle4* All rights reserved.5*/6#include "test.h"78/*9* This first test does basic sanity checks on the environment. For10* most of these, we just exit on failure.11*/12#if !defined(_WIN32) || defined(__CYGWIN__)13#define DEV_NULL "/dev/null"14#else15#define DEV_NULL "NUL"16#endif1718DEFINE_TEST(test_0)19{20struct stat st;2122failure("File %s does not exist?!", testprog);23if (!assertEqualInt(0, stat(testprogfile, &st))) {24fprintf(stderr,25"\nFile %s does not exist; aborting test.\n\n",26testprog);27exit(1);28}2930failure("%s is not executable?!", testprog);31if (!assert((st.st_mode & 0111) != 0)) {32fprintf(stderr,33"\nFile %s not executable; aborting test.\n\n",34testprog);35exit(1);36}3738/* TODO: Ensure that our reference files are available. */39}404142