]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
unit tests: include an OpenSSL header before including cmocka.h
authorAram Sargsyan <aram@isc.org>
Thu, 6 Apr 2023 13:18:04 +0000 (13:18 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Fri, 14 Apr 2023 12:11:52 +0000 (12:11 +0000)
OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a redefined
malloc in cmocka.h.

As a workaround, include an OpenSSL header file before including
cmocka.h in the unit tests where OpenSSL is used.

tests/dns/dst_test.c
tests/dns/rsa_test.c
tests/isc/doh_test.c
tests/isc/hmac_test.c
tests/isc/netmgr_common.c
tests/isc/tcp_test.c
tests/isc/tcpdns_test.c
tests/isc/tls_test.c
tests/isc/tlsdns_test.c
tests/isc/udp_test.c

index 570c19c876cb1a444de14415b0c79ba35610a094..15b89d9d4ac40885ea649cf0a95ee52cf9656205 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index 587dc4ea3e25d2f74fae541c586411f584e1812e..f19105fb015c3898c10a344e7268a51df83b2f2d 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index bb19298df90982fe3d8fd505560594af1a659927..112b827257d94362be23d409a4a973443eb69020 100644 (file)
 #include <time.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index b4438a2853ca38412b63275931567c5760ae43d7..9984cc7208ddc230c2f0a51c1967360697fc5ae5 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index b8988b9154bf5484fe227c80880ea75ca4f8031e..fa8faedbbf5550b40e6fa01874415769a7a57ebe 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index 1095fb66e0a38534969ec6547614176fa0633fbd..4239e1789925fcc7decd45926ddf352f7d43b3d2 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index 7006add141b78e6aa8e1624ddae87c56e64a2954..8005f537b2e4a2fbda771acc308cbee799b934c8 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index 6ba6269336259237b90031e2a41611aea9e3096c..e6c76aa07a01f270e0c13d4691ff25389748eaf5 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index e42be5e6bba00ebf204f7c4cedda056f0b177d9b..7c000687e2086774659def65fbddfe931d3c43a4 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>
 
index ab6742d77b93d439c979e0c38105d245ee656ea5..e88d7d4f2fb7521470ac3a2c887c621e0fd24469 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
+/*
+ * As a workaround, include an OpenSSL header file before including cmocka.h,
+ * because OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a
+ * redefined malloc in cmocka.h.
+ */
+#include <openssl/err.h>
+
 #define UNIT_TESTING
 #include <cmocka.h>