2014-11-14 15:58:54 -08:00
|
|
|
/*
|
2018-02-23 09:53:12 +01:00
|
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2014-11-14 15:58:54 -08:00
|
|
|
*
|
2021-06-03 08:37:05 +02:00
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*
|
2016-06-27 14:56:38 +10:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 16:20:40 -07:00
|
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
*
|
|
|
|
* See the COPYRIGHT file distributed with this work for additional
|
|
|
|
* information regarding copyright ownership.
|
2014-11-14 15:58:54 -08:00
|
|
|
*/
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
#if HAVE_CMOCKA
|
|
|
|
|
|
|
|
#include <fcntl.h>
|
2018-10-30 13:33:25 +01:00
|
|
|
#include <limits.h>
|
Include <sched.h> where necessary for musl libc
All unit tests define the UNIT_TESTING macro, which causes <cmocka.h> to
replace malloc(), calloc(), realloc(), and free() with its own functions
tracking memory allocations. In order for this not to break
compilation, the system header declaring the prototypes for these
standard functions must be included before <cmocka.h>.
Normally, these prototypes are only present in <stdlib.h>, so we make
sure it is included before <cmocka.h>. However, musl libc also defines
the prototypes for calloc() and free() in <sched.h>, which is included
by <pthread.h>, which is included e.g. by <isc/mutex.h>. Thus, unit
tests including "dnstest.h" (which includes <isc/mem.h>, which includes
<isc/mutex.h>) after <cmocka.h> will not compile with musl libc as for
these programs, <sched.h> will be included after <cmocka.h>.
Always including <cmocka.h> after all other header files is not a
feasible solution as that causes the mock assertion macros defined in
<isc/util.h> to mangle the contents of <cmocka.h>, thus breaking
compilation. We cannot really use the __noreturn__ or analyzer_noreturn
attributes with cmocka assertion functions because they do return if the
tested condition is true. The problem is that what BIND unit tests do
is incompatible with Clang Static Analyzer's assumptions: since we use
cmocka, our custom assertion handlers are present in a shared library
(i.e. it is the cmocka library that checks the assertion condition, not
a macro in unit test code). Redefining cmocka's assertion macros in
<isc/util.h> is an ugly hack to overcome that problem - unfortunately,
this is the only way we can think of to make Clang Static Analyzer
properly process unit test code. Giving up on Clang Static Analyzer
being able to properly process unit test code is not a satisfactory
solution.
Undefining _GNU_SOURCE for unit test code could work around the problem
(musl libc's <sched.h> only defines the prototypes for calloc() and
free() when _GNU_SOURCE is defined), but doing that could introduce
discrepancies for unit tests including entire *.c files, so it is also
not a good solution.
All in all, including <sched.h> before <cmocka.h> for all affected unit
tests seems to be the most benign way of working around this musl libc
quirk. While quite an ugly solution, it achieves our goals here, which
are to keep the benefit of proper static analysis of unit test code and
to fix compilation against musl libc.
2019-07-30 21:08:40 +02:00
|
|
|
#include <sched.h> /* IWYU pragma: keep */
|
2020-02-12 13:59:18 +01:00
|
|
|
#include <setjmp.h>
|
|
|
|
#include <stdarg.h>
|
2018-10-30 13:33:25 +01:00
|
|
|
#include <stdbool.h>
|
2020-02-12 13:59:18 +01:00
|
|
|
#include <stddef.h>
|
2014-11-14 15:58:54 -08:00
|
|
|
#include <stdlib.h>
|
2018-10-30 13:33:25 +01:00
|
|
|
#include <string.h>
|
2018-10-24 00:43:33 -07:00
|
|
|
#include <unistd.h>
|
2014-11-14 15:58:54 -08:00
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
#define UNIT_TESTING
|
|
|
|
#include <cmocka.h>
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
#include <isc/buffer.h>
|
2018-10-30 08:06:34 -07:00
|
|
|
#include <isc/print.h>
|
2018-10-30 13:33:25 +01:00
|
|
|
#include <isc/region.h>
|
2014-11-14 15:58:54 -08:00
|
|
|
#include <isc/result.h>
|
2018-10-30 13:33:25 +01:00
|
|
|
#include <isc/types.h>
|
2018-10-24 00:43:33 -07:00
|
|
|
#include <isc/util.h>
|
|
|
|
|
|
|
|
#include "isctest.h"
|
|
|
|
|
|
|
|
static int
|
2020-02-13 14:44:37 -08:00
|
|
|
_setup(void **state) {
|
2018-10-24 00:43:33 -07:00
|
|
|
isc_result_t result;
|
|
|
|
|
|
|
|
UNUSED(state);
|
|
|
|
|
|
|
|
result = isc_test_begin(NULL, true, 0);
|
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
return (0);
|
2014-11-14 15:58:54 -08:00
|
|
|
}
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
static int
|
2020-02-13 14:44:37 -08:00
|
|
|
_teardown(void **state) {
|
2018-10-24 00:43:33 -07:00
|
|
|
UNUSED(state);
|
|
|
|
|
|
|
|
isc_test_end();
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* reserve space in dynamic buffers */
|
|
|
|
static void
|
2020-02-13 14:44:37 -08:00
|
|
|
isc_buffer_reserve_test(void **state) {
|
|
|
|
isc_result_t result;
|
2014-11-14 15:58:54 -08:00
|
|
|
isc_buffer_t *b;
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
UNUSED(state);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
b = NULL;
|
2020-02-02 08:35:46 +01:00
|
|
|
isc_buffer_allocate(test_mctx, &b, 1024);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(b->length, 1024);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 1024 bytes should already be available, so this call does
|
|
|
|
* nothing.
|
|
|
|
*/
|
|
|
|
result = isc_buffer_reserve(&b, 1024);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
|
|
|
assert_true(ISC_BUFFER_VALID(b));
|
|
|
|
assert_non_null(b);
|
|
|
|
assert_int_equal(b->length, 1024);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This call should grow it to 2048 bytes as only 1024 bytes are
|
|
|
|
* available in the buffer.
|
|
|
|
*/
|
|
|
|
result = isc_buffer_reserve(&b, 1025);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
|
|
|
assert_true(ISC_BUFFER_VALID(b));
|
|
|
|
assert_non_null(b);
|
|
|
|
assert_int_equal(b->length, 2048);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 2048 bytes should already be available, so this call does
|
|
|
|
* nothing.
|
|
|
|
*/
|
2014-11-15 00:56:17 -08:00
|
|
|
result = isc_buffer_reserve(&b, 2000);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
|
|
|
assert_true(ISC_BUFFER_VALID(b));
|
|
|
|
assert_non_null(b);
|
|
|
|
assert_int_equal(b->length, 2048);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This call should grow it to 4096 bytes as only 2048 bytes are
|
|
|
|
* available in the buffer.
|
|
|
|
*/
|
2014-11-15 00:56:17 -08:00
|
|
|
result = isc_buffer_reserve(&b, 3000);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
|
|
|
assert_true(ISC_BUFFER_VALID(b));
|
|
|
|
assert_non_null(b);
|
|
|
|
assert_int_equal(b->length, 4096);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
/* Consume some of the buffer so we can run the next test. */
|
|
|
|
isc_buffer_add(b, 4096);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This call should fail and leave buffer untouched.
|
|
|
|
*/
|
|
|
|
result = isc_buffer_reserve(&b, UINT_MAX);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_NOMEMORY);
|
|
|
|
assert_true(ISC_BUFFER_VALID(b));
|
|
|
|
assert_non_null(b);
|
|
|
|
assert_int_equal(b->length, 4096);
|
2014-11-14 15:58:54 -08:00
|
|
|
|
|
|
|
isc_buffer_free(&b);
|
2016-05-26 21:23:19 +02:00
|
|
|
}
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
/* dynamic buffer automatic reallocation */
|
|
|
|
static void
|
2020-02-13 14:44:37 -08:00
|
|
|
isc_buffer_dynamic_test(void **state) {
|
2016-05-26 21:23:19 +02:00
|
|
|
isc_buffer_t *b;
|
2020-02-13 14:44:37 -08:00
|
|
|
size_t last_length = 10;
|
|
|
|
int i;
|
2016-05-26 21:23:19 +02:00
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
UNUSED(state);
|
2016-05-26 21:23:19 +02:00
|
|
|
|
|
|
|
b = NULL;
|
2020-02-02 08:35:46 +01:00
|
|
|
isc_buffer_allocate(test_mctx, &b, last_length);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_non_null(b);
|
|
|
|
assert_int_equal(b->length, last_length);
|
2016-05-26 21:23:19 +02:00
|
|
|
|
2018-04-17 08:29:14 -07:00
|
|
|
isc_buffer_setautorealloc(b, true);
|
2016-05-26 21:23:19 +02:00
|
|
|
|
|
|
|
isc_buffer_putuint8(b, 1);
|
|
|
|
|
|
|
|
for (i = 0; i < 1000; i++) {
|
|
|
|
isc_buffer_putstr(b, "thisisa24charslongstring");
|
|
|
|
}
|
2020-02-12 13:59:18 +01:00
|
|
|
assert_true(b->length - last_length >= 1000 * 24);
|
|
|
|
last_length += 1000 * 24;
|
2016-05-26 21:23:19 +02:00
|
|
|
|
|
|
|
for (i = 0; i < 10000; i++) {
|
|
|
|
isc_buffer_putuint8(b, 1);
|
|
|
|
}
|
|
|
|
|
2020-02-12 13:59:18 +01:00
|
|
|
assert_true(b->length - last_length >= 10000 * 1);
|
|
|
|
last_length += 10000 * 1;
|
2016-05-26 21:23:19 +02:00
|
|
|
|
|
|
|
for (i = 0; i < 10000; i++) {
|
|
|
|
isc_buffer_putuint16(b, 1);
|
|
|
|
}
|
|
|
|
|
2020-02-12 13:59:18 +01:00
|
|
|
assert_true(b->length - last_length >= 10000 * 2);
|
2016-05-26 21:23:19 +02:00
|
|
|
|
2020-02-12 13:59:18 +01:00
|
|
|
last_length += 10000 * 2;
|
2016-05-26 21:23:19 +02:00
|
|
|
for (i = 0; i < 10000; i++) {
|
|
|
|
isc_buffer_putuint24(b, 1);
|
|
|
|
}
|
2020-02-12 13:59:18 +01:00
|
|
|
assert_true(b->length - last_length >= 10000 * 3);
|
2016-05-26 21:23:19 +02:00
|
|
|
|
2020-02-12 13:59:18 +01:00
|
|
|
last_length += 10000 * 3;
|
2016-05-26 21:23:19 +02:00
|
|
|
|
|
|
|
for (i = 0; i < 10000; i++) {
|
|
|
|
isc_buffer_putuint32(b, 1);
|
|
|
|
}
|
2020-02-12 13:59:18 +01:00
|
|
|
assert_true(b->length - last_length >= 10000 * 4);
|
2016-05-26 21:23:19 +02:00
|
|
|
|
|
|
|
isc_buffer_free(&b);
|
2018-10-30 13:33:25 +01:00
|
|
|
}
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
/* copy a region into a buffer */
|
|
|
|
static void
|
2020-02-13 14:44:37 -08:00
|
|
|
isc_buffer_copyregion_test(void **state) {
|
2018-10-30 13:33:25 +01:00
|
|
|
unsigned char data[] = { 0x11, 0x22, 0x33, 0x44 };
|
|
|
|
isc_buffer_t *b = NULL;
|
2020-02-13 14:44:37 -08:00
|
|
|
isc_result_t result;
|
2018-10-30 13:33:25 +01:00
|
|
|
|
|
|
|
isc_region_t r = {
|
|
|
|
.base = data,
|
|
|
|
.length = sizeof(data),
|
|
|
|
};
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
UNUSED(state);
|
2018-10-30 13:33:25 +01:00
|
|
|
|
2020-02-02 08:35:46 +01:00
|
|
|
isc_buffer_allocate(test_mctx, &b, sizeof(data));
|
2018-10-30 13:33:25 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Fill originally allocated buffer space.
|
|
|
|
*/
|
|
|
|
result = isc_buffer_copyregion(b, &r);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2018-10-30 13:33:25 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Appending more data to the buffer should fail.
|
|
|
|
*/
|
|
|
|
result = isc_buffer_copyregion(b, &r);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_NOSPACE);
|
2018-10-30 13:33:25 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable auto reallocation and retry. Appending should now succeed.
|
|
|
|
*/
|
|
|
|
isc_buffer_setautorealloc(b, true);
|
|
|
|
result = isc_buffer_copyregion(b, &r);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2018-10-30 13:33:25 +01:00
|
|
|
|
|
|
|
isc_buffer_free(&b);
|
2017-10-09 11:43:07 +02:00
|
|
|
}
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
/* sprintf() into a buffer */
|
|
|
|
static void
|
2020-02-13 14:44:37 -08:00
|
|
|
isc_buffer_printf_test(void **state) {
|
|
|
|
unsigned int used, prev_used;
|
|
|
|
const char *empty_fmt;
|
|
|
|
isc_result_t result;
|
2017-10-09 11:43:07 +02:00
|
|
|
isc_buffer_t *b, sb;
|
2020-02-13 14:44:37 -08:00
|
|
|
char buf[8];
|
2017-10-09 11:43:07 +02:00
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
UNUSED(state);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Prepare a buffer with auto-reallocation enabled.
|
|
|
|
*/
|
|
|
|
b = NULL;
|
2020-02-02 08:35:46 +01:00
|
|
|
isc_buffer_allocate(test_mctx, &b, 0);
|
2018-04-17 08:29:14 -07:00
|
|
|
isc_buffer_setautorealloc(b, true);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Sanity check.
|
|
|
|
*/
|
|
|
|
result = isc_buffer_printf(b, "foo");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(b);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used, 3);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
result = isc_buffer_printf(b, "bar");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(b);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used, 3 + 3);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Also check the terminating NULL byte is there, even though it is not
|
|
|
|
* part of the buffer's used region.
|
|
|
|
*/
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_memory_equal(isc_buffer_current(b), "foobar", 7);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Skip over data from previous check to prevent failures in previous
|
|
|
|
* check from affecting this one.
|
|
|
|
*/
|
|
|
|
prev_used = used;
|
|
|
|
isc_buffer_forward(b, prev_used);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Some standard usage checks.
|
|
|
|
*/
|
|
|
|
isc_buffer_printf(b, "%d", 42);
|
|
|
|
used = isc_buffer_usedlength(b);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used - prev_used, 2);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
isc_buffer_printf(b, "baz%1X", 42);
|
|
|
|
used = isc_buffer_usedlength(b);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used - prev_used, 2 + 5);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
isc_buffer_printf(b, "%6.1f", 42.42f);
|
|
|
|
used = isc_buffer_usedlength(b);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used - prev_used, 2 + 5 + 6);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Also check the terminating NULL byte is there, even though it is not
|
|
|
|
* part of the buffer's used region.
|
|
|
|
*/
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_memory_equal(isc_buffer_current(b), "42baz2A 42.4", 14);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Check an empty format string is properly handled.
|
2018-05-01 18:12:41 +10:00
|
|
|
*
|
|
|
|
* Note: we don't use a string literal for the format string to
|
|
|
|
* avoid triggering [-Werror=format-zero-length].
|
|
|
|
* Note: we have a dummy third argument as some compilers complain
|
|
|
|
* without it.
|
2017-10-09 11:43:07 +02:00
|
|
|
*/
|
|
|
|
prev_used = used;
|
|
|
|
empty_fmt = "";
|
2018-05-01 18:12:41 +10:00
|
|
|
result = isc_buffer_printf(b, empty_fmt, "");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(b);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(prev_used, used);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
isc_buffer_free(&b);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check overflow on a static buffer.
|
|
|
|
*/
|
|
|
|
isc_buffer_init(&sb, buf, sizeof(buf));
|
|
|
|
result = isc_buffer_printf(&sb, "123456");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(&sb);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used, 6);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
result = isc_buffer_printf(&sb, "789");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_NOSPACE);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(&sb);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used, 6);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
result = isc_buffer_printf(&sb, "78");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_NOSPACE);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(&sb);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used, 6);
|
2017-10-09 11:43:07 +02:00
|
|
|
|
|
|
|
result = isc_buffer_printf(&sb, "7");
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(result, ISC_R_SUCCESS);
|
2017-10-09 11:43:07 +02:00
|
|
|
used = isc_buffer_usedlength(&sb);
|
2018-10-24 00:43:33 -07:00
|
|
|
assert_int_equal(used, 7);
|
|
|
|
}
|
2017-10-09 11:43:07 +02:00
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
int
|
2020-02-13 14:44:37 -08:00
|
|
|
main(void) {
|
2018-10-24 00:43:33 -07:00
|
|
|
const struct CMUnitTest tests[] = {
|
2020-02-12 13:59:18 +01:00
|
|
|
cmocka_unit_test_setup_teardown(isc_buffer_reserve_test, _setup,
|
|
|
|
_teardown),
|
|
|
|
cmocka_unit_test_setup_teardown(isc_buffer_dynamic_test, _setup,
|
|
|
|
_teardown),
|
2018-10-24 00:43:33 -07:00
|
|
|
cmocka_unit_test_setup_teardown(isc_buffer_copyregion_test,
|
|
|
|
_setup, _teardown),
|
2020-02-12 13:59:18 +01:00
|
|
|
cmocka_unit_test_setup_teardown(isc_buffer_printf_test, _setup,
|
|
|
|
_teardown),
|
2018-10-24 00:43:33 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
return (cmocka_run_group_tests(tests, NULL, NULL));
|
2017-10-09 11:43:07 +02:00
|
|
|
}
|
|
|
|
|
2018-10-24 00:43:33 -07:00
|
|
|
#else /* HAVE_CMOCKA */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int
|
2020-02-13 14:44:37 -08:00
|
|
|
main(void) {
|
2018-10-24 00:43:33 -07:00
|
|
|
printf("1..0 # Skipped: cmocka not available\n");
|
2021-01-18 19:15:44 +01:00
|
|
|
return (SKIPPED_TEST_EXIT_CODE);
|
2014-11-14 15:58:54 -08:00
|
|
|
}
|
2018-10-24 00:43:33 -07:00
|
|
|
|
2020-02-13 21:48:23 +01:00
|
|
|
#endif /* if HAVE_CMOCKA */
|