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>
check_expected(filename);
check_expected(pem);
- return mock();
+ return mock_type(bool);
}
struct buffer
{
check_expected(filename);
- const char *pem_str = (const char *) mock();
+ const char *pem_str = mock_ptr_type(const char *);
struct buffer ret = alloc_buf_gc(strlen(pem_str) + 1, gc);
buf_write(&ret, pem_str, strlen(pem_str) + 1);