summaryrefslogtreecommitdiff
path: root/gtests/freebl_gtest
diff options
context:
space:
mode:
authorJ.C. Jones <jjones@mozilla.com>2019-05-02 16:47:01 -0700
committerJ.C. Jones <jjones@mozilla.com>2019-05-02 16:47:01 -0700
commite2f1e34dfc568ee19fd4bc131615a7e1b7915b0c (patch)
tree1dda93921b78e355954eeba9943aaabb94f6d909 /gtests/freebl_gtest
parent7555cf82c524483db1d96da41f58b3e100edfba8 (diff)
downloadnss-hg-e2f1e34dfc568ee19fd4bc131615a7e1b7915b0c.tar.gz
Backed out changeset 5059d47bd423 (bug 1548398) for GCC 4.8 failures in gcm.h
Diffstat (limited to 'gtests/freebl_gtest')
-rw-r--r--gtests/freebl_gtest/mpi_unittest.cc14
-rw-r--r--gtests/freebl_gtest/rsa_unittest.cc1
2 files changed, 6 insertions, 9 deletions
diff --git a/gtests/freebl_gtest/mpi_unittest.cc b/gtests/freebl_gtest/mpi_unittest.cc
index b0944975e..2ccb8c351 100644
--- a/gtests/freebl_gtest/mpi_unittest.cc
+++ b/gtests/freebl_gtest/mpi_unittest.cc
@@ -6,7 +6,6 @@
#include <stdint.h>
#include <string.h>
-#include <memory>
#ifdef __MACH__
#include <mach/clock.h>
@@ -28,7 +27,7 @@ void gettime(struct timespec* tp) {
tp->tv_sec = mts.tv_sec;
tp->tv_nsec = mts.tv_nsec;
#else
- ASSERT_NE(0, timespec_get(tp, TIME_UTC));
+ clock_gettime(CLOCK_MONOTONIC, tp);
#endif
}
@@ -85,9 +84,8 @@ class MPITest : public ::testing::Test {
mp_int a;
ASSERT_EQ(MP_OKAY, mp_init(&a));
ASSERT_EQ(MP_OKAY, mp_read_unsigned_octets(&a, ref.data(), ref.size()));
- std::unique_ptr<uint8_t[]> buf(new uint8_t[len]);
- ASSERT_NE(buf, nullptr);
- ASSERT_EQ(MP_OKAY, mp_to_fixlen_octets(&a, buf.get(), len));
+ uint8_t buf[len];
+ ASSERT_EQ(MP_OKAY, mp_to_fixlen_octets(&a, buf, len));
size_t compare;
if (len > ref.size()) {
for (size_t i = 0; i < len - ref.size(); ++i) {
@@ -98,9 +96,9 @@ class MPITest : public ::testing::Test {
compare = len;
}
dump("value", ref.data(), ref.size());
- dump("output", buf.get(), len);
- ASSERT_EQ(0, memcmp(buf.get() + len - compare,
- ref.data() + ref.size() - compare, compare))
+ dump("output", buf, len);
+ ASSERT_EQ(0, memcmp(buf + len - compare, ref.data() + ref.size() - compare,
+ compare))
<< "comparing " << compare << " octets";
mp_clear(&a);
}
diff --git a/gtests/freebl_gtest/rsa_unittest.cc b/gtests/freebl_gtest/rsa_unittest.cc
index 9a6a9c11f..a1453168f 100644
--- a/gtests/freebl_gtest/rsa_unittest.cc
+++ b/gtests/freebl_gtest/rsa_unittest.cc
@@ -5,7 +5,6 @@
#include "gtest/gtest.h"
#include <stdint.h>
-#include <memory>
#include "blapi.h"
#include "secitem.h"