aboutsummaryrefslogtreecommitdiff
path: root/tests/test_base64.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_base64.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_base64.cpp')
-rw-r--r--tests/test_base64.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_base64.cpp b/tests/test_base64.cpp
index c95e3c9..6f80acf 100644
--- a/tests/test_base64.cpp
+++ b/tests/test_base64.cpp
@@ -14,7 +14,7 @@ std::size_t input_length = sizeof(input) - 1;
std::size_t output_length = olm::encode_base64_length(input_length);
assert_equals(std::size_t(15), output_length);
-std::uint8_t output[output_length];
+std::uint8_t output[15];
olm::encode_base64(input, input_length, output);
assert_equals(expected_output, output, output_length);
}
@@ -29,7 +29,7 @@ std::size_t input_length = sizeof(input) - 1;
std::size_t output_length = ::_olm_encode_base64_length(input_length);
assert_equals(std::size_t(15), output_length);
-std::uint8_t output[output_length];
+std::uint8_t output[15];
output_length = ::_olm_encode_base64(input, input_length, output);
assert_equals(std::size_t(15), output_length);
assert_equals(expected_output, output, output_length);
@@ -45,7 +45,7 @@ std::size_t input_length = sizeof(input) - 1;
std::size_t output_length = olm::decode_base64_length(input_length);
assert_equals(std::size_t(11), output_length);
-std::uint8_t output[output_length];
+std::uint8_t output[11];
olm::decode_base64(input, input_length, output);
assert_equals(expected_output, output, output_length);
}
@@ -60,7 +60,7 @@ std::size_t input_length = sizeof(input) - 1;
std::size_t output_length = ::_olm_decode_base64_length(input_length);
assert_equals(std::size_t(11), output_length);
-std::uint8_t output[output_length];
+std::uint8_t output[11];
output_length = ::_olm_decode_base64(input, input_length, output);
assert_equals(std::size_t(11), output_length);
assert_equals(expected_output, output, output_length);