]> git.ipfire.org Git - thirdparty/openvpn.git/commit
test_tls_crypt: Improve mock() usage to be more portable
authorFrank Lichtenheld <frank@lichtenheld.com>
Fri, 30 Jun 2023 12:39:08 +0000 (14:39 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 1 Jul 2023 20:08:05 +0000 (22:08 +0200)
commit4f24f71f6a1f491fe404370707cc6a4f549fcab3
tree677f83f5d85fe4c47b0a821ff75f2bcd1cf757fb
parent5eb84eb19749eb7e12f3becb36d6aaae89457b5b
test_tls_crypt: Improve mock() usage to be more portable

Use the casting variants of mock(). Using the mock_ptr_type
fixes an existing bug where test_tls_crypt.c couldn't
build in MinGW 32bit:

test_tls_crypt.c:127:27: error:
cast to pointer from integer of different size
[-Werror=int-to-pointer-cast]
  127 |     const char *pem_str = (const char *) mock();

Change-Id: I6c03313b8677fa07c07e718b1f85f7efd3c4dea8
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230630123908.82588-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26796.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit e87e44f7bcdffc208292cce9d314e2e52a175026)
tests/unit_tests/openvpn/test_tls_crypt.c