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

randombit / botan / 11844561993

14 Nov 2024 07:58PM UTC coverage: 91.178% (+0.1%) from 91.072%
11844561993

Pull #4435

github

web-flow
Merge 81dcb29da into e430f157a
Pull Request #4435: Test duration values ​​are now presented in seconds with six digits of precision. Tests without time measurements have been edited.

91856 of 100744 relevant lines covered (91.18%)

9311006.71 hits per line

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

96.97
/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(CHECK(s.to_string().c_str(), [&](auto& result) {
18✔
27
         result.start_timer();
9✔
28
         result.confirm("is_set handles all cases", s.is_set());
18✔
29
         result.confirm("is_available handles all cases", s.is_available());
18✔
30

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

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

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

49
      result.confirm("to_string deals with bogus schemes", !not_unknown(bogus.to_string()));
2✔
50
      result.confirm("hash_function_name deals with bogus schemes", !not_unknown(bogus.hash_function_name()));
2✔
51
      result.confirm("padding_string deals with bogus schemes", !not_unknown(bogus.padding_string()));
2✔
52
      result.confirm("algorithm_name deals with bogus schemes", !not_unknown(bogus.algorithm_name()));
2✔
53

54
      result.confirm("format deals with bogus schemes", !bogus.format().has_value());
2✔
55
      result.confirm("algorithm_identifier deals with bogus schemes",
2✔
56
                     Botan::AlgorithmIdentifier() == bogus.key_algorithm_identifier());
2✔
57
      result.end_timer();
1✔
58
   }));
1✔
59

60
   return results;
1✔
61
}
×
62

63
}  // namespace
64

65
BOTAN_REGISTER_TEST_FN("tls", "tls_signature_scheme", test_signature_scheme);
66

67
}  // namespace Botan_Tests
68

69
#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