Bernd Edlinger 35f6fe7ac4 Fix BIO_printf format warnings il y a 5 ans
..
certs bc42bd6298 Support SM2 certificate signing il y a 5 ans
ct 8c6afbc55c Verify SCT signatures il y a 8 ans
d2i-tests a378a46985 add test for CVE-2016-7053 il y a 7 ans
ocsp-tests 121738d1cb Fix OCSP_basic_verify() cert chain construction in case bs->certs is NULL il y a 7 ans
ossl_shim ac6bba6f6e Build: Change all _NO_INST to use attributes instead. il y a 5 ans
recipes e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
smime-certs 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
ssl-tests dbc6268f68 Allow TLSv1.3 in a no-ec build il y a 5 ans
testutil e9a5932d04 Add weak platform independent PRNG to test framework. il y a 5 ans
CAss.cnf a7be5759cf RT3809: basicConstraints is critical il y a 8 ans
CAssdh.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
CAssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
CAssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
CAtsa.cnf f0ef20bf38 Added support for ESSCertIDv2 il y a 7 ans
P1ss.cnf fec669388c Use 2K RSA and SHA256 in tests il y a 9 ans
P2ss.cnf fec669388c Use 2K RSA and SHA256 in tests il y a 9 ans
README 7a5f5fd32a Update test/README il y a 5 ans
README.external df4439186f Remove unnecessary trailing whitespace il y a 5 ans
README.ssltest.md a84e5c9aa8 Session resume broken switching contexts il y a 7 ans
Sssdsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
Sssrsa.cnf 58964a4922 Import of old SSLeay release: SSLeay 0.9.0b il y a 26 ans
Uss.cnf cb0585c2cb Create DSA and ECDSA certificates. il y a 9 ans
aborttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
aesgcmtest.c bcf082d130 FIPS AES_GCM IV gen changes il y a 5 ans
afalgtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
asn1_decode_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
asn1_dsa_internal_test.c 54846b7c6e Add simple ASN.1 utils for DSA signature DER. il y a 5 ans
asn1_encode_test.c 98f29466dc fix truncation of integers on 32bit AIX il y a 5 ans
asn1_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
asn1_string_table_test.c 275a7b9e5e typo ANS1 -> ASN1 il y a 5 ans
asn1_time_test.c c2969ff6e7 Fix Typos il y a 5 ans
asynciotest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
asynctest.c 9f5a87fd66 add an additional async notification communication method based on callback il y a 5 ans
bad_dtls_test.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
bftest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
bio_callback_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
bio_enc_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
bio_memleak_test.c 8b7b32921e Fix and document BIO_FLAGS_NONCLEAR_RST behavior on memory BIO il y a 5 ans
bioprinttest.c 98f29466dc fix truncation of integers on 32bit AIX il y a 5 ans
bn_internal_test.c a12864a5de removed BN_clear NULL checks il y a 5 ans
bn_rand_range.h 5d2f3e4a6c Test of uniformity of BN_rand_range output. il y a 5 ans
bntest.c dd6b270618 Remove tab characters from C source files. il y a 5 ans
bntests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
build.info e9a5932d04 Add weak platform independent PRNG to test framework. il y a 5 ans
casttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
chacha_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
cipher_overhead_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
cipherbytes_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
cipherlist_test.c 3c83c5ba4f Ignore cipher suites when setting cipher list il y a 5 ans
ciphername_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
clienthellotest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
cms-examples.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
cmsapitest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
conf_include_test.c 68756b12f5 Fix Typos il y a 5 ans
constant_time_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
context_internal_test.c 1aedc35fd6 Instead of global data store it in an OPENSSL_CTX il y a 5 ans
crltest.c a727627922 Fix a memory leak with di2_X509_CRL reuse il y a 5 ans
ct_test.c 98f29466dc fix truncation of integers on 32bit AIX il y a 5 ans
ctype_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
curve448_internal_test.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
d2i_test.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
danetest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
danetest.in 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
danetest.pem 170b735820 DANE support for X509_verify_cert() il y a 8 ans
default-and-legacy.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
default.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
destest.c 4b6ae3c3c2 add missing const il y a 5 ans
dhtest.c 6de1fe9086 Enforce a minimum DH modulus size of 512 bits il y a 5 ans
drbg_cavs_data.h 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
drbg_cavs_data_ctr.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
drbg_cavs_data_hash.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
drbg_cavs_data_hmac.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
drbg_cavs_test.c dd6b270618 Remove tab characters from C source files. il y a 5 ans
drbgtest.c c2969ff6e7 Fix Typos il y a 5 ans
drbgtest.h 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
dsa_no_digest_size_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
dsatest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
dtls_mtu_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
dtlstest.c c2969ff6e7 Fix Typos il y a 5 ans
dtlsv1listentest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
ec_internal_test.c 8f58ede095 [test] unit test for field_inv function pointer in EC_METHOD il y a 5 ans
ecdsatest.c 10c25644e3 EC only uses approved curves in FIPS mode. il y a 5 ans
ecdsatest.h 1a31d8017e [test] modernize ecdsatest and extend ECDSA sign KATs il y a 5 ans
ecstresstest.c dd6b270618 Remove tab characters from C source files. il y a 5 ans
ectest.c 10c25644e3 EC only uses approved curves in FIPS mode. il y a 5 ans
enginetest.c 5800ba7610 test/enginetest.c: Make sure no config file is loaded il y a 5 ans
errtest.c 56c3a135b2 Add ERR_put_func_error, and use it. il y a 5 ans
evp_extra_test.c c2969ff6e7 Fix Typos il y a 5 ans
evp_kdf_test.c 1aec7716c1 Add X9.42 KDF. il y a 5 ans
evp_pkey_dparams_test.c 10c25644e3 EC only uses approved curves in FIPS mode. il y a 5 ans
evp_test.c 3b5d61f472 test/evp_test.c: modify to use OSSL_PROVIDER_available() il y a 5 ans
evp_test.h 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
exdatatest.c e17f5b6a6b Add CRYPTO_alloc_ex_data() il y a 5 ans
exptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
fatalerrtest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
fips.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
generate_buildtest.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
generate_ssl_tests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
gmdifftest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
gosttest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
handshake_helper.c 09d62b336d Fix end-point shared secret for DTLS/SCTP il y a 5 ans
handshake_helper.h 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
hmactest.c 1057c2c39f Cleaner disposal of ephemeral engine ids and names il y a 5 ans
ideatest.c 9b34028187 Eliminate NOP cast il y a 5 ans
igetest.c fd367b4ce3 Deprecate AES_ige_encrypt() and AES_bi_ige_encrypt() il y a 5 ans
legacy.cnf e2f72313cc test/recipes/30-test_evp.t: Modify to test with different providers il y a 5 ans
lhash_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
md2test.c d030892312 Add a legacy provider and put MD2 in it il y a 5 ans
mdc2_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
mdc2test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. il y a 5 ans
memleaktest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
modes_internal_test.c 459b15d451 Add Common shared code needed to move aes ciphers to providers il y a 5 ans
namemap_internal_test.c a9550b74d3 OSSL_NAMEMAP: make names case insensitive il y a 5 ans
ocspapitest.c 5b3accde60 OCSP: fix memory leak in OCSP_url_svcloc_new method. il y a 5 ans
ossl_test_endian.h a9e34e9ef1 Fix test builds. il y a 5 ans
p_test.c 2617501348 Replace OSSL_ITEM with OSSL_PARAM as parameter descriptor, everywhere il y a 5 ans
packettest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
param_build_test.c 7312ef3fc4 Add param builder free function. il y a 5 ans
params_api_test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. il y a 5 ans
params_conversion_test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. il y a 5 ans
params_test.c c2969ff6e7 Fix Typos il y a 5 ans
pbelutest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
pemtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
pkcs7-1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
pkcs7.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
pkey_meth_kdf_test.c 5a285addbf Added new EVP/KDF API. il y a 5 ans
pkey_meth_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
pkits-test.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
poly1305_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
property_test.c da89ac0b25 Optional property query support. il y a 5 ans
provider_internal_test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. il y a 5 ans
provider_internal_test.conf.in 6d872a838d Add test for the provider configuration module il y a 5 ans
provider_test.c 4e7991b497 Change OSSL_PARAM return size to not be a pointer. il y a 5 ans
rc2test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
rc4test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
rc5test.c 9a131ad747 Change RC5_32_set_key to return an int type il y a 5 ans
rdrand_sanitytest.c df4439186f Remove unnecessary trailing whitespace il y a 5 ans
recordlentest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
rsa_complex.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
rsa_mp_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
rsa_sp800_56b_test.c a12864a5de removed BN_clear NULL checks il y a 5 ans
rsa_test.c 8240d5fa65 FIPS 186-4 RSA Generation & Validation il y a 5 ans
run_tests.pl 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
sanitytest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
secmemtest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
serverinfo.pem c655f40ed2 Require ServerInfo PEMs to be named "BEGIN SERVERINFO FOR"... il y a 11 ans
serverinfo2.pem b878afae4b Add a SERVERINFOV2 format test file il y a 7 ans
servername_test.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
session.pem 6cf2dbd9fa Don't store the ticket nonce in the session il y a 6 ans
shibboleth.pfx 70bf33d182 Add PKCS#12 UTF-8 interoperability test. il y a 8 ans
shlibloadtest.c 41999e7d35 Introduce a no-pinshared option il y a 5 ans
siphash_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
sm2_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
sm4_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
smcont.txt 382bb0b294 test/smcont.txt: trigger assertion in bio_enc.c. il y a 8 ans
sparse_array_test.c 35f6fe7ac4 Fix BIO_printf format warnings il y a 5 ans
srptest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
ssl_cert_table_internal_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
ssl_test.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
ssl_test.tmpl f4941736a9 test/ssl_test.tmpl: make it work with elderly perl. il y a 8 ans
ssl_test_ctx.c 09d62b336d Fix end-point shared secret for DTLS/SCTP il y a 5 ans
ssl_test_ctx.h 09d62b336d Fix end-point shared secret for DTLS/SCTP il y a 5 ans
ssl_test_ctx_test.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
ssl_test_ctx_test.conf cf72c75792 Implement Maximum Fragment Length TLS extension. il y a 6 ans
sslapitest.c aac96e2797 Remove function name from errors il y a 5 ans
sslbuffertest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
sslcorrupttest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
ssltest_old.c 6b10d29c1a Remove NextStep support il y a 5 ans
ssltestlib.c c2969ff6e7 Fix Typos il y a 5 ans
ssltestlib.h a77b4dba23 Write a test for receiving a KeyUpdate (update requested) while writing il y a 5 ans
stack_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
sysdefault.cnf 8a5ed9dce8 Apply system_default configuration on SSL_CTX_new(). il y a 6 ans
sysdefaulttest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
test.cnf fec669388c Use 2K RSA and SHA256 in tests il y a 9 ans
test_test.c c5f7a99645 Test skip option. il y a 5 ans
testcrl.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
testdsa.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testdsapub.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testec-p256.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testecpub-p256.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testp7.pem dcb1ef5c22 Change PKCS#7 test data to take account of removal of il y a 24 ans
testreq2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
testrsa.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
testrsapub.pem 79a578b902 Add private/public key conversion tests il y a 9 ans
testsid.pem 45f55f6a5b Remove SSLv2 support il y a 9 ans
testutil.h e9a5932d04 Add weak platform independent PRNG to test framework. il y a 5 ans
testx509.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
threadstest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
time_offset_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
tls13ccstest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
tls13encryptiontest.c 555cbb328e Collapse ssl3_state_st (s3) into ssl_st il y a 5 ans
tls13secretstest.c c2969ff6e7 Fix Typos il y a 5 ans
uitest.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
v3-cert1.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
v3-cert2.pem d02b48c63a Import of old SSLeay release: SSLeay 0.8.1b il y a 26 ans
v3ext.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
v3nametest.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
verify_extra_test.c bc42bd6298 Support SM2 certificate signing il y a 5 ans
versions.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
wpackettest.c 0d345f0e10 Make the PACKET/WPACKET code available to both libcrypto and libssl il y a 5 ans
x509_check_cert_pkey_test.c 4b931252be Fix incorrect usage of a test case il y a 5 ans
x509_dup_cert_test.c a43ce58f55 Updated test command line parsing to support commmon commands il y a 5 ans
x509_internal_test.c 878dc8dd95 Join the x509 and x509v3 directories il y a 5 ans
x509_time_test.c 909f1a2e51 Following the license change, modify the boilerplates in test/ il y a 5 ans
x509aux.c 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION il y a 5 ans

README

How to add recipes
==================

For any test that you want to perform, you write a script located in
test/recipes/, named {nn}-test_{name}.t, where {nn} is a two digit number and
{name} is a unique name of your choice.

Please note that if a test involves a new testing executable, you will need to
do some additions in test/build.info. Please refer to the section "Changes to
test/build.info" below.


Naming conventions
=================

A test executable is named test/{name}test.c

A test recipe is named test/recipes/{nn}-test_{name}.t, where {nn} is a two
digit number and {name} is a unique name of your choice.

The number {nn} is (somewhat loosely) grouped as follows:

00-04 sanity, internal and essential API tests
05-09 individual symmetric cipher algorithms
10-14 math (bignum)
15-19 individual asymmetric cipher algorithms
20-24 openssl commands (some otherwise not tested)
25-29 certificate forms, generation and verification
30-35 engine and evp
60-79 APIs
70 PACKET layer
80-89 "larger" protocols (CA, CMS, OCSP, SSL, TSA)
90-98 misc
99 most time consuming tests [such as test_fuzz]


A recipe that just runs a test executable
=========================================

A script that just runs a program looks like this:

#! /usr/bin/perl

use OpenSSL::Test::Simple;

simple_test("test_{name}", "{name}test", "{name}");

{name} is the unique name you have chosen for your test.

The second argument to `simple_test' is the test executable, and `simple_test'
expects it to be located in test/

For documentation on OpenSSL::Test::Simple, do
`perldoc util/perl/OpenSSL/Test/Simple.pm'.


A recipe that runs a more complex test
======================================

For more complex tests, you will need to read up on Test::More and
OpenSSL::Test. Test::More is normally preinstalled, do `man Test::More' for
documentation. For OpenSSL::Test, do `perldoc util/perl/OpenSSL/Test.pm'.

A script to start from could be this:

#! /usr/bin/perl

use strict;
use warnings;
use OpenSSL::Test;

setup("test_{name}");

plan tests => 2; # The number of tests being performed

ok(test1, "test1");
ok(test2, "test1");

sub test1
{
# test feature 1
}

sub test2
{
# test feature 2
}


Changes to test/build.info
==========================

Whenever a new test involves a new test executable you need to do the
following (at all times, replace {NAME} and {name} with the name of your
test):

* add {name} to the list of programs under PROGRAMS_NO_INST

* create a three line description of how to build the test, you will have
to modify the include paths and source files if you don't want to use the
basic test framework:

SOURCE[{name}]={name}.c
INCLUDE[{name}]=.. ../include ../apps/include
DEPEND[{name}]=../libcrypto libtestutil.a

Generic form of C test executables
==================================

#include "testutil.h"

static int my_test(void)
{
int testresult = 0; /* Assume the test will fail */
int observed;

observed = function(); /* Call the code under test */
if (!TEST_int_eq(observed, 2)) /* Check the result is correct */
goto end; /* Exit on failure - optional */

testresult = 1; /* Mark the test case a success */
end:
cleanup(); /* Any cleanup you require */
return testresult;
}

int setup_tests(void)
{
ADD_TEST(my_test); /* Add each test separately */
return 1; /* Indicate success */
}

You should use the TEST_xxx macros provided by testutil.h to test all failure
conditions. These macros produce an error message in a standard format if the
condition is not met (and nothing if the condition is met). Additional
information can be presented with the TEST_info macro that takes a printf
format string and arguments. TEST_error is useful for complicated conditions,
it also takes a printf format string and argument. In all cases the TEST_xxx
macros are guaranteed to evaluate their arguments exactly once. This means
that expressions with side effects are allowed as parameters. Thus,

if (!TEST_ptr(ptr = OPENSSL_malloc(..)))

works fine and can be used in place of:

ptr = OPENSSL_malloc(..);
if (!TEST_ptr(ptr))

The former produces a more meaningful message on failure than the latter.