diff options
Diffstat (limited to 'tests/tap/basic.h')
| -rw-r--r-- | tests/tap/basic.h | 34 | 
1 files changed, 21 insertions, 13 deletions
diff --git a/tests/tap/basic.h b/tests/tap/basic.h index 4ecaaec..3f46e4f 100644 --- a/tests/tap/basic.h +++ b/tests/tap/basic.h @@ -2,11 +2,11 @@   * Basic utility routines for the TAP protocol.   *   * This file is part of C TAP Harness.  The current version plus supporting - * documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>. + * documentation is at <https://www.eyrie.org/~eagle/software/c-tap-harness/>.   * - * Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015 - *     Russ Allbery <eagle@eyrie.org> - * Copyright 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2011, 2012, 2014 + * Written by Russ Allbery <eagle@eyrie.org> + * Copyright 2009-2018 Russ Allbery <eagle@eyrie.org> + * Copyright 2001-2002, 2004-2008, 2011-2012, 2014   *     The Board of Trustees of the Leland Stanford Junior University   *   * Permission is hereby granted, free of charge, to any person obtaining a @@ -26,6 +26,8 @@   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING   * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER   * DEALINGS IN THE SOFTWARE. + * + * SPDX-License-Identifier: MIT   */  #ifndef TAP_BASIC_H @@ -88,15 +90,21 @@ void skip_block(unsigned long count, const char *reason, ...)      __attribute__((__format__(printf, 2, 3)));  /* - * Check an expected value against a seen value.  Returns true if the test - * passes and false if it fails. + * Compare two values.  Returns true if the test passes and false if it fails. + * is_bool takes an int since the bool type isn't fully portable yet, but + * interprets both arguments for their truth value, not for their numeric + * value.   */ -int is_int(long wanted, long seen, const char *format, ...) +int is_bool(int, int, const char *format, ...) +    __attribute__((__format__(printf, 3, 4))); +int is_int(long, long, const char *format, ...)      __attribute__((__format__(printf, 3, 4))); -int is_string(const char *wanted, const char *seen, const char *format, ...) +int is_string(const char *, const char *, const char *format, ...)      __attribute__((__format__(printf, 3, 4))); -int is_hex(unsigned long wanted, unsigned long seen, const char *format, ...) +int is_hex(unsigned long, unsigned long, const char *format, ...)      __attribute__((__format__(printf, 3, 4))); +int is_blob(const void *, const void *, size_t, const char *format, ...) +    __attribute__((__format__(printf, 4, 5)));  /* Bail out with an error.  sysbail appends strerror(errno). */  void bail(const char *format, ...) @@ -137,16 +145,16 @@ char *bstrndup(const char *, size_t)      __attribute__((__malloc__, __nonnull__, __warn_unused_result__));  /* - * Find a test file under BUILD or SOURCE, returning the full path.  The - * returned path should be freed with test_file_path_free(). + * Find a test file under C_TAP_BUILD or C_TAP_SOURCE, returning the full + * path.  The returned path should be freed with test_file_path_free().   */  char *test_file_path(const char *file)      __attribute__((__malloc__, __nonnull__, __warn_unused_result__));  void test_file_path_free(char *path);  /* - * Create a temporary directory relative to BUILD and return the path.  The - * returned path should be freed with test_tmpdir_free. + * Create a temporary directory relative to C_TAP_BUILD and return the path. + * The returned path should be freed with test_tmpdir_free().   */  char *test_tmpdir(void)      __attribute__((__malloc__, __warn_unused_result__));  | 
