aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorrumcajs <[email protected]>2018-10-14 11:41:00 +0200
committerrumcajs <[email protected]>2018-10-14 11:41:00 +0200
commit2f53c434f88e1c39e86c978f3523ebc1051996a9 (patch)
treea2628a317cd5dd105c3ba8a9c7820bef2f0b5450 /src/tests
parent9249da3c4e87bfbdbe88882e65ae01d1f90e31eb (diff)
move instead of copy
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_compression.cpp10
-rw-r--r--src/tests/test_ecies.cpp4
-rw-r--r--src/tests/test_name_constraint.cpp2
-rw-r--r--src/tests/test_oid.cpp8
4 files changed, 12 insertions, 12 deletions
diff --git a/src/tests/test_compression.cpp b/src/tests/test_compression.cpp
index bd2a6386b..709013d75 100644
--- a/src/tests/test_compression.cpp
+++ b/src/tests/test_compression.cpp
@@ -108,11 +108,11 @@ class Compression_Tests final : public Test
result.test_lt("Zeros compresses much better than text", c1_z / 8, c1_t);
result.test_lt("Text compresses much better than random", c1_t / 2, c1_r);
- results.push_back(result);
+ results.emplace_back(result);
}
catch(std::exception& e)
{
- results.push_back(Test::Result::Failure("testing " + algo, e.what()));
+ results.emplace_back(Test::Result::Failure("testing " + algo, e.what()));
}
}
@@ -206,11 +206,11 @@ class CompressionCreate_Tests final : public Test
}
result.test_ne("Not the same name after create_or_throw", c2->name(), d2->name());
- results.push_back(result);
+ results.emplace_back(result);
}
catch(std::exception& e)
{
- results.push_back(Test::Result::Failure("testing " + algo, e.what()));
+ results.emplace_back(Test::Result::Failure("testing " + algo, e.what()));
}
}
@@ -222,7 +222,7 @@ class CompressionCreate_Tests final : public Test
result.test_throws("lookup error",
"Unavailable Decompression bogocompress",
[&]() { Botan::Decompression_Algorithm::create_or_throw("bogocompress"); });
- results.push_back(result);
+ results.emplace_back(result);
}
return results;
diff --git a/src/tests/test_ecies.cpp b/src/tests/test_ecies.cpp
index 3648450af..5c95e9a0c 100644
--- a/src/tests/test_ecies.cpp
+++ b/src/tests/test_ecies.cpp
@@ -425,11 +425,11 @@ class ECIES_Unit_Tests final : public Test
{
try
{
- results.push_back(fns[ i ]());
+ results.emplace_back(fns[ i ]());
}
catch(std::exception& e)
{
- results.push_back(Test::Result::Failure("ECIES unit tests " + std::to_string(i), e.what()));
+ results.emplace_back(Test::Result::Failure("ECIES unit tests " + std::to_string(i), e.what()));
}
}
diff --git a/src/tests/test_name_constraint.cpp b/src/tests/test_name_constraint.cpp
index f0abda710..5d05fba0c 100644
--- a/src/tests/test_name_constraint.cpp
+++ b/src/tests/test_name_constraint.cpp
@@ -81,7 +81,7 @@ class Name_Constraint_Tests final : public Test
}
result.test_eq("validation result", path_result.result_string(), std::get<3>(t));
- results.push_back(result);
+ results.emplace_back(result);
}
return results;
diff --git a/src/tests/test_oid.cpp b/src/tests/test_oid.cpp
index 3431f6f31..131966c2a 100644
--- a/src/tests/test_oid.cpp
+++ b/src/tests/test_oid.cpp
@@ -88,11 +88,11 @@ class OID_Tests final : public Test
{
try
{
- results.push_back(fns[ i ]());
+ results.emplace_back(fns[ i ]());
}
- catch(std::exception& e)
+ catch(const std::exception& e)
{
- results.push_back(Test::Result::Failure("OID tests " + std::to_string(i), e.what()));
+ results.emplace_back(Test::Result::Failure("OID tests " + std::to_string(i), e.what()));
}
}
@@ -106,4 +106,4 @@ BOTAN_REGISTER_TEST("oid", OID_Tests);
}
-} \ No newline at end of file
+}