aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-02 23:55:55 -0400
committerJack Lloyd <[email protected]>2017-10-02 23:55:55 -0400
commit8c700bcf093b82a29e93f79932e4f1542818186a (patch)
tree1ac3548255490fc01fd6d6ee366b2029b16b18f4 /src/tests
parenta0a27808005346ef151ea7b07550dc03434b9e84 (diff)
Remove various unused variables
Sonar finds
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_bigint.cpp3
-rw-r--r--src/tests/test_c25519.cpp6
-rw-r--r--src/tests/test_cryptobox.cpp2
-rw-r--r--src/tests/test_tpm.cpp1
-rw-r--r--src/tests/unit_ecc.cpp4
5 files changed, 7 insertions, 9 deletions
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp
index 80d95a8ee..6ee802408 100644
--- a/src/tests/test_bigint.cpp
+++ b/src/tests/test_bigint.cpp
@@ -269,7 +269,6 @@ class BigInt_Add_Test final : public Text_Based_Test
const BigInt a = get_req_bn(vars, "In1");
const BigInt b = get_req_bn(vars, "In2");
const BigInt c = get_req_bn(vars, "Output");
- BigInt d = a + b;
result.test_eq("a + b", a + b, c);
result.test_eq("b + a", b + a, c);
@@ -302,8 +301,6 @@ class BigInt_Sub_Test final : public Text_Based_Test
const BigInt b = get_req_bn(vars, "In2");
const BigInt c = get_req_bn(vars, "Output");
- BigInt d = a - b;
-
result.test_eq("a - b", a - b, c);
BigInt e = a;
diff --git a/src/tests/test_c25519.cpp b/src/tests/test_c25519.cpp
index e7c3cff8a..8c8129a18 100644
--- a/src/tests/test_c25519.cpp
+++ b/src/tests/test_c25519.cpp
@@ -55,11 +55,11 @@ class Curve25519_Roundtrip_Test final : public Test
Botan::Curve25519_PrivateKey a_priv_gen(Test::rng());
Botan::Curve25519_PrivateKey b_priv_gen(Test::rng());
+#if defined(BOTAN_HAS_AES) && defined(BOTAN_HAS_AEAD_GCM)
+ // Then serialize to encrypted storage
+
const std::string a_pass = "alice pass";
const std::string b_pass = "bob pass";
-
- // Then serialize to encrypted storage
-#if defined(BOTAN_HAS_AES) && defined(BOTAN_HAS_GCM)
const auto pbe_time = std::chrono::milliseconds(10);
const std::string a_priv_pem = Botan::PKCS8::PEM_encode(a_priv_gen, Test::rng(), a_pass, pbe_time);
const std::string b_priv_pem = Botan::PKCS8::PEM_encode(b_priv_gen, Test::rng(), b_pass, pbe_time);
diff --git a/src/tests/test_cryptobox.cpp b/src/tests/test_cryptobox.cpp
index 927c5c379..6d1d22314 100644
--- a/src/tests/test_cryptobox.cpp
+++ b/src/tests/test_cryptobox.cpp
@@ -49,7 +49,7 @@ class Cryptobox_Tests final : public Test
{
std::string corrupted = ciphertext;
corrupted[corrupted.size()/2]++;
- const std::string decrypted = Botan::CryptoBox::decrypt(corrupted, password);
+ Botan::CryptoBox::decrypt(corrupted, password);
result.test_failure("Decrypted corrupted cryptobox message");
}
catch(Botan::Decoding_Error)
diff --git a/src/tests/test_tpm.cpp b/src/tests/test_tpm.cpp
index c29c642a1..4117b8086 100644
--- a/src/tests/test_tpm.cpp
+++ b/src/tests/test_tpm.cpp
@@ -99,6 +99,7 @@ class UUID_Tests final : public Test
result.confirm("UUID copied by binary equals original", random_uuid == binary_copy);
std::string uuid_str = random_uuid.to_string();
+ result.test_eq("UUID string in expected format", uuid_str.size(), 36);
const Botan::UUID string_copy(random_uuid.to_string());
result.confirm("UUID copied by string equals original", random_uuid == string_copy);
diff --git a/src/tests/unit_ecc.cpp b/src/tests/unit_ecc.cpp
index f78f6bfd6..74592d0a8 100644
--- a/src/tests/unit_ecc.cpp
+++ b/src/tests/unit_ecc.cpp
@@ -279,11 +279,11 @@ Test::Result test_coordinates()
const Botan::EC_Group secp160r1(Botan::OIDS::lookup("secp160r1"));
const Botan::CurveGFp& curve = secp160r1.get_curve();
const Botan::PointGFp& p_G = secp160r1.get_base_point();
- const Botan::PointGFp p0 = p_G;
- const Botan::PointGFp p1 = p_G * 2;
+
const Botan::PointGFp point_exp(curve, exp_affine_x, exp_affine_y);
result.confirm("Point is on the curve", point_exp.on_the_curve());
+ const Botan::PointGFp p1 = p_G * 2;
result.test_eq("Point affine x", p1.get_affine_x(), exp_affine_x);
result.test_eq("Point affine y", p1.get_affine_y(), exp_affine_y);
return result;