diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-11-02 18:42:17 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-11-02 22:27:03 +0000 |
commit | eb416708b152456ab583349b3afb5bb44f11d259 (patch) | |
tree | adb1821f64a617c6dd6b43d68a1e4fc82f035b2d /src/vpp-api | |
parent | 064b77c742ec63d2d9cf09b9cf310350b50d101a (diff) |
tests: change code to avoid gcc-11 warning
For some reason gcc-11 doesn't like memcpy in a particular location,
change memcpy to assignment.
Type: refactor
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Iddf4b788cdca8e55221b121e74cf50b1e6bdf2d5
Diffstat (limited to 'src/vpp-api')
-rw-r--r-- | src/vpp-api/vapi/vapi_c_test.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vpp-api/vapi/vapi_c_test.c b/src/vpp-api/vapi/vapi_c_test.c index 85fc8b3504c..7c7e8611731 100644 --- a/src/vpp-api/vapi/vapi_c_test.c +++ b/src/vpp-api/vapi/vapi_c_test.c @@ -503,8 +503,11 @@ START_TEST (test_loopbacks_1) for (i = 0; i < num_ifs; ++i) { vapi_msg_create_loopback *cl = vapi_alloc_create_loopback (ctx); - memcpy (cl->payload.mac_address, mac_addresses[i], - sizeof (cl->payload.mac_address)); + int j; + for (j = 0; j < 6; ++j) + { + cl->payload.mac_address[j] = mac_addresses[i][j]; + } vapi_error_e rv = vapi_create_loopback (ctx, cl, loopback_create_cb, &clcs[i]); ck_assert_int_eq (VAPI_OK, rv); @@ -656,8 +659,11 @@ START_TEST (test_loopbacks_2) for (i = 0; i < num_ifs; ++i) { vapi_msg_create_loopback *cl = vapi_alloc_create_loopback (ctx); - memcpy (cl->payload.mac_address, mac_addresses[i], - sizeof (cl->payload.mac_address)); + int j; + for (j = 0; j < 6; ++j) + { + cl->payload.mac_address[j] = mac_addresses[i][j]; + } while (VAPI_EAGAIN == (rv = vapi_create_loopback (ctx, cl, loopback_create_cb, &clcs[i]))) |