mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
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>
This commit is contained in:
parent
66e33ee81d
commit
e87e44f7bc
1 changed files with 2 additions and 2 deletions
|
|
@ -116,7 +116,7 @@ __wrap_buffer_write_file(const char *filename, const struct buffer *buf)
|
|||
check_expected(filename);
|
||||
check_expected(pem);
|
||||
|
||||
return mock();
|
||||
return mock_type(bool);
|
||||
}
|
||||
|
||||
struct buffer
|
||||
|
|
@ -124,7 +124,7 @@ __wrap_buffer_read_from_file(const char *filename, struct gc_arena *gc)
|
|||
{
|
||||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue