• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 5079590438

25 May 2023 12:28PM UTC coverage: 92.228% (+0.5%) from 91.723%
5079590438

Pull #3502

github

Pull Request #3502: Apply clang-format to the codebase

75589 of 81959 relevant lines covered (92.23%)

12139530.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.55
/src/tests/test_tls_signature_scheme.cpp
1
/*
2
* (C) 2022 Jack Lloyd
3
* (C) 2022 Hannes Rantzsch, René Meusel - neXenio
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7

8
#include "tests.h"
9

10
#if defined(BOTAN_HAS_TLS)
11

12
   #include <botan/tls_signature_scheme.h>
13

14
   #include <botan/ec_group.h>
15

16
namespace Botan_Tests {
17

18
namespace {
19

20
std::vector<Test::Result> test_signature_scheme() {
1✔
21
   std::vector<Test::Result> results;
1✔
22

23
   auto not_unknown = [](const std::string& s) { return s.find("Unknown") == std::string::npos; };
41✔
24

25
   for(const auto& s : Botan::TLS::Signature_Scheme::all_available_schemes()) {
10✔
26
      results.push_back(Botan_Tests::CHECK(s.to_string().c_str(), [&](auto& result) {
21✔
27
         result.confirm("is_set handles all cases", s.is_set());
18✔
28
         result.confirm("is_available handles all cases", s.is_available());
18✔
29

30
         result.confirm("to_string handles all cases", not_unknown(s.to_string()));
27✔
31
         result.confirm("hash_function_name handles all cases", not_unknown(s.hash_function_name()));
27✔
32
         result.confirm("padding_string handles all cases", not_unknown(s.padding_string()));
27✔
33
         result.confirm("algorithm_name handles all cases", not_unknown(s.algorithm_name()));
27✔
34

35
         result.confirm("format handles all cases", s.format().has_value());
18✔
36
         result.confirm("algorithm_identifier handles all cases",
18✔
37
                        Botan::AlgorithmIdentifier() != s.key_algorithm_identifier());
18✔
38
      }));
9✔
39
   }
40

41
   Botan::TLS::Signature_Scheme bogus(0x1337);
1✔
42
   results.push_back(Botan_Tests::CHECK("bogus scheme", [&](auto& result) {
2✔
43
      result.confirm("is_set still works", bogus.is_set());
2✔
44
      result.confirm("is not available", !bogus.is_available());
2✔
45

46
      result.confirm("to_string deals with bogus schemes", !not_unknown(bogus.to_string()));
3✔
47
      result.confirm("hash_function_name deals with bogus schemes", !not_unknown(bogus.hash_function_name()));
3✔
48
      result.confirm("padding_string deals with bogus schemes", !not_unknown(bogus.padding_string()));
3✔
49
      result.confirm("algorithm_name deals with bogus schemes", !not_unknown(bogus.algorithm_name()));
3✔
50

51
      result.confirm("format deals with bogus schemes", !bogus.format().has_value());
2✔
52
      result.confirm("algorithm_identifier deals with bogus schemes",
2✔
53
                     Botan::AlgorithmIdentifier() == bogus.key_algorithm_identifier());
2✔
54
   }));
1✔
55

56
   return results;
1✔
57
}
×
58

59
}  // namespace
60

61
BOTAN_REGISTER_TEST_FN("tls", "tls_signature_scheme", test_signature_scheme);
62

63
}  // namespace Botan_Tests
64

65
#endif  // BOTAN_HAS_TLS
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc