aboutsummaryrefslogtreecommitdiff
path: root/tests/test_olm_sha256.cpp
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2019-04-22 10:12:42 -0400
committerHubert Chathi <hubert@uhoreg.ca>2019-04-22 10:12:42 -0400
commitea13edcae00cc4ab1805e85322e73b7aa2faba7a (patch)
tree1960e726574ebcb8ce52230c0cc86ecce4833f91 /tests/test_olm_sha256.cpp
parent157c0fa67e1ccdaac5a66983004dab8e978f2b4f (diff)
don't use variable length or zero-length arrays in test files
as some compilers don't handle that
Diffstat (limited to 'tests/test_olm_sha256.cpp')
-rw-r--r--tests/test_olm_sha256.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_olm_sha256.cpp b/tests/test_olm_sha256.cpp
index c6d0242..d76e592 100644
--- a/tests/test_olm_sha256.cpp
+++ b/tests/test_olm_sha256.cpp
@@ -1,13 +1,15 @@
#include "olm/olm.h"
#include "unittest.hh"
+#include <vector>
+
int main() {
{
TestCase("Olm sha256 test");
-std::uint8_t utility_buffer[::olm_utility_size()];
-::OlmUtility * utility = ::olm_utility(utility_buffer);
+std::vector<std::uint8_t> utility_buffer(::olm_utility_size());
+::OlmUtility * utility = ::olm_utility(utility_buffer.data());
assert_equals(std::size_t(43), ::olm_sha256_length(utility));
std::uint8_t output[43];