aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-06-20 20:13:31 +0100
committerMark Haines <mark.haines@matrix.org>2015-06-20 20:13:31 +0100
commit9cd53394e73c51efdf690d02bcee69a7a283681a (patch)
treec3705df3a7218e65aedbebc34542407ad038026b
parent499f680f5bbf1d8582983dfc29c4d50ceb3e4b3e (diff)
Fix a few valgrind warnings in the tests
-rw-r--r--tests/test_axolotl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_axolotl.cpp b/tests/test_axolotl.cpp
index 7b55a36..578a43b 100644
--- a/tests/test_axolotl.cpp
+++ b/tests/test_axolotl.cpp
@@ -57,7 +57,7 @@ std::uint8_t b_ot_keys[::axolotl_account_one_time_keys_length(b_account)];
std::uint8_t a_session_buffer[::axolotl_session_size()];
::AxolotlSession *a_session = ::axolotl_session(a_session_buffer);
std::uint8_t a_rand[::axolotl_create_outbound_session_random_length(a_session)];
-std::memset(b_random, 6, sizeof(a_rand)); /* http://xkcd.com/221/ */
+std::memset(a_rand, 6, sizeof(a_rand)); /* http://xkcd.com/221/ */
assert_not_equals(std::size_t(-1), ::axolotl_create_outbound_session(
a_session, a_account,
b_id_keys + 14, 43,
@@ -68,6 +68,7 @@ assert_not_equals(std::size_t(-1), ::axolotl_create_outbound_session(
std::uint8_t plaintext[] = "Hello, World";
std::uint8_t message_1[::axolotl_encrypt_message_length(a_session, 12)];
std::uint8_t a_message_random[::axolotl_encrypt_random_length(a_session)];
+std::memset(a_message_random, 1, sizeof(a_message_random)); /* http://xkcd.com/221/ */
assert_equals(std::size_t(0), ::axolotl_encrypt_message_type(a_session));
assert_not_equals(std::size_t(-1), ::axolotl_encrypt(
a_session,
@@ -100,6 +101,7 @@ assert_equals(plaintext, plaintext_1, 12);
std::uint8_t message_2[::axolotl_encrypt_message_length(b_session, 12)];
std::uint8_t b_message_random[::axolotl_encrypt_random_length(b_session)];
+std::memset(b_message_random, 2, sizeof(b_message_random)); /* http://xkcd.com/221/ */
assert_equals(std::size_t(1), ::axolotl_encrypt_message_type(b_session));
assert_not_equals(std::size_t(-1), ::axolotl_encrypt(
b_session,