/freebsd/crypto/openssl/test/ |
H A D | test_test.c | 2 * Copyright 2017-2022 The OpenSSL Project Authors. All Rights Reserved. 22 #define TEST(expected, test) test_case((expected), #test, (test)) argument 24 static int test_case(int expected, const char *test, int result) in test_case() argument 27 fprintf(stderr, "# FATAL: %s != %d\n", test, expected); in test_case() 33 static int test_int(void) in test_int() 35 if (!TEST(1, TEST_int_eq(1, 1)) in test_int() 36 || !TEST(0, TEST_int_eq(1, -1)) in test_int() 37 || !TEST(1, TEST_int_ne(1, 2)) in test_int() 38 || !TEST(0, TEST_int_ne(3, 3)) in test_int() 39 || !TEST(1, TEST_int_lt(4, 9)) in test_int() [all …]
|
H A D | hmactest.c | 2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. 35 static struct test_st { 41 } test[8] = { variable 43 "", 0, "More text test vectors to stuff up EBCDIC machines :-)", 54, 66 "", 0, "My test data", 12, 70 "", 0, "My test data", 12, 74 "123456", 6, "My test data", 12, 78 "12345", 5, "My test data again", 18, 84 static char *pt(unsigned char *md, unsigned int len); 88 static int test_hmac_md5(int idx) in test_hmac_md5() [all …]
|
H A D | hexstr_test.c | 2 * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved. 27 static const unsigned char test_1[] = { 0xAB, 0xCD, 0xEF, 0xF1 }; 28 static const unsigned char test_2[] = { 0xAB, 0xCD, 0xEF, 0x76, 0x00 }; 30 static struct testdata tbl_testdata[] = { 63 static int test_hexstr_sep_to_from(int test_index) in test_hexstr_sep_to_from() 69 struct testdata *test = &tbl_testdata[test_index]; in test_hexstr_sep_to_from() local 71 if (!TEST_ptr(buf = ossl_hexstr2buf_sep(test->in, &len, test->sep)) in test_hexstr_sep_to_from() 72 || !TEST_mem_eq(buf, len, test->expected, test->expected_len) in test_hexstr_sep_to_from() 73 || !TEST_ptr(out = ossl_buf2hexstr_sep(buf, len, test->sep)) in test_hexstr_sep_to_from() 74 || !TEST_str_eq(out, test->in)) in test_hexstr_sep_to_from() [all …]
|
/freebsd/sys/dev/ioat/ |
H A D | ioat_test.c | 1 /*- 54 #define time_after(a,b) ((long)(b) - (long)(a) < 0) 57 MALLOC_DEFINE(M_IOAT_TEST, "ioat_test", "ioat test allocations"); 66 struct ioat_test *test; member 73 static struct mtx ioat_test_lk; 74 MTX_SYSINIT(ioat_test_lk, &ioat_test_lk, "test coordination mtx", MTX_DEF); 76 static int g_thread_index = 1; 77 static struct cdev *g_ioat_cdev = NULL; 80 static void _ioat_test_log(int verbosity, const char *fmt, ...); 82 static void [all …]
|
/freebsd/tools/regression/sockets/unix_gc/ |
H A D | unix_gc.c | 1 /*- 28 * A few regression tests for UNIX domain sockets. Run from single-user mode 51 static int forcegc = 1; 52 static char dpath[PATH_MAX]; 53 static const char *test; variable 55 static int 63 err(-1, "%s", name); in getsysctl() 67 static int 74 static int 81 static int [all …]
|
/freebsd/contrib/ofed/librdmacm/examples/ |
H A D | cmatose.c | 2 * Copyright (c) 2005-2006,2011-2012 Intel Corporation. All rights reserved. 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 72 static struct cmatest test; variable 73 static int connections = 1; 74 static int message_size = 100; 75 static int message_count = 10; 76 static const char *port = "7471"; 77 static uint8_t set_tos = 0; 78 static uint8_t tos; [all …]
|
H A D | mckey.c | 2 * Copyright (c) 2005-2007 Intel Corporation. All rights reserved. 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 75 static struct cmatest test; variable 76 static int connections = 1; 77 static int message_size = 100; 78 static int message_count = 10; 79 static int is_sender; 80 static int unmapped_addr; 81 static char *dst_addr; [all …]
|
H A D | udaddy.c | 2 * Copyright (c) 2005-2006 Intel Corporation. All rights reserved. 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 69 static struct cmatest test; variable 70 static int connections = 1; 71 static int message_size = 100; 72 static int message_count = 10; 73 static const char *port = "7174"; 74 static uint8_t set_tos = 0; 75 static uint8_t tos; [all …]
|
/freebsd/crypto/krb5/src/kdc/ |
H A D | t_replay.c | 1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 /* kdc/t_replay.c - tests for replay.c */ 39 #include "k5-cmocka.h" 42 #include "k5-int.h" 49 static krb5_error_code 70 static void 81 static int 95 static int 102 static int 122 static int [all …]
|
/freebsd/tools/regression/priv/ |
H A D | priv_netinet_ipsec.c | 1 /*- 45 static char policy_bypass[] = "in bypass"; 46 static char policy_entrust[] = "in entrust"; 47 static char *bypassbuf = NULL; 48 static char *entrustbuf = NULL; 49 static int sd = -1; 52 static int 54 struct test *test, int af) in priv_netinet_ipsec_policy_bypass_setup_af() argument 57 bypassbuf = ipsec_set_policy(policy_bypass, sizeof(policy_bypass) - 1); in priv_netinet_ipsec_policy_bypass_setup_af() 60 return (-1); in priv_netinet_ipsec_policy_bypass_setup_af() [all …]
|
/freebsd/crypto/heimdal/lib/hx509/ |
H A D | test_cms.in | 40 stat="--statistic-file=${objdir}/statfile" 55 ${hxtool} cms-create-sd \ 56 --certificate=FILE:$srcdir/data/secp160r2TestClient.pem \ 61 ${hxtool} cms-verify-sd \ 62 --missing-revoke \ 63 --anchors=FILE:$srcdir/data/secp160r1TestCA.cert.pem \ 69 ${hxtool} cms-create-sd \ 70 --certificate=FILE:$srcdir/data/test.crt,$srcdir/data/test.key \ 75 ${hxtool} cms-verify-sd \ 76 --missing-revoke \ [all …]
|
/freebsd/tools/regression/netinet/ipdivert/ |
H A D | ipdivert.c | 1 /*- 2 * Copyright (c) 2010-2011 Juniper Networks, Inc. 31 * This is a test tool for IP divert sockets. For the time being, it just 33 * behaviour. It would be highly desirable to broaden this test tool to 49 static void 50 ok(const char *test) in ok() argument 53 fprintf(stderr, "%s: OK\n", test); in ok() 56 static void 57 fail(const char *test, const char *note) in fail() argument 60 fprintf(stderr, "%s - %s: FAIL (%s)\n", test, note, strerror(errno)); in fail() [all …]
|
/freebsd/tools/regression/posixsem/ |
H A D | posixsem.c | 1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 16 * 3. Neither the name of the author nor the names of any co-contributors 53 #include "test.h" 57 #define ELAPSED(elapsed, limit) (abs((elapsed) - (limit)) < 100) 70 * returns -1 and fails the test. 72 static int 80 return (-1); in child_worker() 85 case -1: in child_worker() 90 return (-1); in child_worker() [all …]
|
/freebsd/contrib/wpa/src/utils/ |
H A D | utils_module_tests.c | 3 * Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi> 30 static const struct printf_test_data printf_tests[] = { 45 static int printf_encode_decode_tests(void) in printf_encode_decode_tests() 57 const struct printf_test_data *test = &printf_tests[i]; in printf_encode_decode_tests() local 58 printf_encode(buf, sizeof(buf), test->data, test->len); in printf_encode_decode_tests() 59 wpa_printf(MSG_INFO, "%d: -> \"%s\"", i, buf); in printf_encode_decode_tests() 62 if (binlen != test->len || in printf_encode_decode_tests() 63 os_memcmp(bin, test->data, binlen) != 0) { in printf_encode_decode_tests() 69 binlen = printf_decode(bin, sizeof(bin), test->encoded); in printf_encode_decode_tests() 70 if (binlen != test->len || in printf_encode_decode_tests() [all …]
|
/freebsd/tools/test/iconv/gnu/ |
H A D | gnu.c | 1 /*- 39 static bool uc_hook = false; 40 static bool wc_hook = false; 41 static bool mb_uc_fb = false; 50 static int 56 cd = iconv_open("ASCII//TRANSLIT", "UTF-8"); in ctl_get_translit1() 57 if (cd == (iconv_t)-1) in ctl_get_translit1() 58 return (-1); in ctl_get_translit1() 60 ret = (arg == 1) ? 0 : -1; in ctl_get_translit1() 62 ret = -1; in ctl_get_translit1() [all …]
|
/freebsd/sys/contrib/openzfs/tests/zfs-tests/cmd/ |
H A D | crypto_test.c | 2 * SPDX-License-Identifier: MIT 26 * This is a userspace test driver for the ICP. It has two modes: 28 * "correctness" (-c <testfile>): 29 * Load a file full of test vectors. For each implementation of the named 34 * "performance" (-p <alg>) 36 * encrypt() on a range of power-2 sizes of input data from 2^10 (1K) to 56 /* valid test algorithms */ 64 * Generally the ICP expects zero-length data to still require a valid 65 * (non-NULL) pointer, even though it will never read from it. This is a 68 static uint8_t val_empty[1] = {0}; [all …]
|
/freebsd/contrib/googletest/googletest/test/ |
H A D | googletest-catch-exceptions-test_.cc | 31 // Tests for Google Test itself. Tests in this file throw C++ or SEH 33 // googletest-catch-exceptions-test.py. 49 using testing::Test; 53 class SehExceptionInConstructorTest : public Test { 60 class SehExceptionInDestructorTest : public Test { 67 class SehExceptionInSetUpTestSuiteTest : public Test { 69 static void SetUpTestSuite() { RaiseException(42, 0, 0, NULL); } in SetUpTestSuite() 74 class SehExceptionInTearDownTestSuiteTest : public Test { 76 static void TearDownTestSuite() { RaiseException(42, 0, 0, NULL); } in TearDownTestSuite() 82 class SehExceptionInSetUpTest : public Test { [all …]
|
H A D | gtest-typed-test_test.cc | 30 #include "test/gtest-typed-test_test.h" 41 using testing::Test; 45 // type-parameterized test. 47 class CommonTest : public Test { 51 static void SetUpTestSuite() { shared_ = new T(5); } in SetUpTestSuite() 53 static void TearDownTestSuite() { in TearDownTestSuite() 81 static T* shared_; 96 // Static members of the fixture class template can be visited via in TYPED_TEST() 108 // Non-static members of the fixture class must be visited via in TYPED_TEST() 110 EXPECT_EQ(2, this->value_); in TYPED_TEST() [all …]
|
/freebsd/tools/regression/sockets/zerosend/ |
H A D | zerosend.c | 1 /*- 46 static void 47 try_0send(const char *test, int fd) in try_0send() argument 55 err(1, "%s: try_0send", test); in try_0send() 57 errx(1, "%s: try_0send: returned %zd", test, len); in try_0send() 60 static void 61 try_0write(const char *test, int fd) in try_0write() argument 69 err(1, "%s: try_0write", test); in try_0write() 71 errx(1, "%s: try_0write: returned %zd", test, len); in try_0write() 74 static void [all …]
|
/freebsd/contrib/netbsd-tests/lib/libc/gen/ |
H A D | t_fpsetmask.c | 3 /*- 31 #include <atf-c.h> 48 atf_tc_set_md_var(tc, "descr", "Dummy test case"); in ATF_TC_HEAD() 54 atf_tc_skip("Test not available on this architecture."); in ATF_TC_BODY() 81 static volatile const float f_one = 1.0; 82 static volatile const float f_zero = 0.0; 83 static volatile const double d_one = 1.0; 84 static volatile const double d_zero = 0.0; 85 static volatile const long double ld_one = 1.0; 86 static volatile const long double ld_zero = 0.0; [all …]
|
/freebsd/contrib/pam-krb5/tests/ |
H A D | runtests.c | 4 * Test suite driver that runs a set of tests implementing a subset of the 5 * Test Anything Protocol (TAP) and reports the results. 8 * should be sent to the e-mail address below. This program is part of C TAP 9 * Harness <https://www.eyrie.org/~eagle/software/c-tap-harness/>. 11 * Copyright 2000-2001, 2004, 2006-2019 Russ Allbery <eagle@eyrie.org> 31 * SPDX-License-Identifier: MIT 37 * runtests [-hv] [-b <build-dir>] [-s <source-dir>] -l <test-list> 38 * runtests [-hv] [-b <build-dir>] [-s <source-dir>] <test> [<test> ...] 39 * runtests -o [-h] [-b <build-dir>] [-s <source-dir>] <test> 42 * one line per executable, possibly followed by a space-separated list of [all …]
|
/freebsd/tools/regression/sockets/sendfile/ |
H A D | sendfile.c | 1 /*- 47 * Simple regression test for sendfile. Creates a file sized at four pages 53 return (-1);} 56 return (-1);} 78 static int file_fd; 79 static char path[PATH_MAX]; 80 static int listen_socket; 81 static int accept_socket; 83 static int test_th(struct test_header *th, uint32_t *header_length, 85 static void signal_alarm(int signum); [all …]
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7615/ |
H A D | testmode.c | 1 // SPDX-License-Identifier: ISC 18 static const u8 tm_change_map[] = { 24 static const u32 reg_backup_list[] = { 37 static const struct { 47 static int 50 struct mt7615_dev *dev = phy->dev; in mt7615_tm_set_tx_power() 51 struct mt76_phy *mphy = phy->mt76; in mt7615_tm_set_tx_power() 52 int i, ret, n_chains = hweight8(mphy->antenna_mask); in mt7615_tm_set_tx_power() 53 struct cfg80211_chan_def *chandef = &mphy->chandef; in mt7615_tm_set_tx_power() 54 int freq = chandef->center_freq1, len, target_chains; in mt7615_tm_set_tx_power() [all …]
|
/freebsd/contrib/kyua/engine/ |
H A D | plain_helpers.cpp | 59 /// Gets the name of the test case to run. 62 /// else the basename of the test program. 66 /// \return A test case name. The name may not be valid. 67 static std::string 79 /// Logs an error message and exits the test with an error code. 82 static void 90 /// A test case that validates the TEST_ENV_* variables. 91 static void 111 /// A test case that crashes. 112 static void [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | YAMLTraits.h | 1 //===- llvm/Support/YAMLTraits.h --------------------------------*- C++ -*-===// 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 //===----------------------------------------------------------------------===// 54 /// static void mapping(IO &io, MyStruct &s) { 63 // static void mapping(IO &io, T &fields); 65 // static std::string validate(IO &io, T &fields); 66 // static void enumInput(IO &io, T &value); 70 // static const bool flow = true; 77 /// static void mapping(IO &io, MyStruct &s, MyContext &c) { 86 // static void mapping(IO &io, T &fields, Context &Ctx); [all …]
|