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

randombit / botan / 23114513202

15 Mar 2026 04:32PM UTC coverage: 91.99% (+2.3%) from 89.738%
23114513202

push

github

web-flow
Merge pull request #5446 from randombit/jack/fix-clang-tidy-22-warnings

Address (or silence) various new warnings from clang-tidy 22

106961 of 116275 relevant lines covered (91.99%)

11215912.22 hits per line

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

85.71
/src/tests/test_workfactor.cpp
1
/*
2
* (C) 2016 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6

7
#include "tests.h"
8

9
#if defined(BOTAN_HAS_PUBLIC_KEY_CRYPTO)
10
   #include <botan/internal/workfactor.h>
11
#endif
12

13
namespace Botan_Tests {
14

15
namespace {
16

17
#if defined(BOTAN_HAS_PUBLIC_KEY_CRYPTO)
18
class PK_Workfactor_Tests final : public Text_Based_Test {
×
19
   public:
20
      PK_Workfactor_Tests() : Text_Based_Test("pubkey/workfactor.vec", "ParamSize,Workfactor") {}
2✔
21

22
      Test::Result run_one_test(const std::string& type, const VarMap& vars) override {
21✔
23
         const size_t param_size = vars.get_req_sz("ParamSize");
21✔
24
         const size_t exp_output = vars.get_req_sz("Workfactor");
21✔
25

26
         size_t output = 0;
21✔
27

28
         // TODO: test McEliece strength tests also
29

30
         if(type == "RSA_Strength") {
21✔
31
            output = Botan::if_work_factor(param_size);
8✔
32
         } else if(type == "DL_Exponent_Size") {
13✔
33
            output = Botan::dl_exponent_size(param_size);
13✔
34
         }
35

36
         Test::Result result(type + " work factor calculation");
21✔
37
         result.test_sz_eq("Calculated workfactor for " + std::to_string(param_size), output, exp_output);
63✔
38
         return result;
21✔
39
      }
×
40
};
41

42
BOTAN_REGISTER_TEST("pubkey", "pk_workfactor", PK_Workfactor_Tests);
43
#endif
44

45
}  // namespace
46

47
}  // namespace Botan_Tests
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