diff options
author | lloyd <[email protected]> | 2008-06-12 14:47:25 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-12 14:47:25 +0000 |
commit | b730ba19274f5422adb70df6d3328c46af35142f (patch) | |
tree | 4eb96b82b4489215587ee4b01ddafff9d9962f14 /checks | |
parent | 1164b265ebecfb2132b07c9492e71881c69b2be4 (diff) |
Fix some -Wmissing-declarations warnings
Diffstat (limited to 'checks')
-rw-r--r-- | checks/bench.cpp | 5 | ||||
-rw-r--r-- | checks/bench.h | 9 | ||||
-rw-r--r-- | checks/bigint.cpp | 5 | ||||
-rw-r--r-- | checks/check.cpp | 8 | ||||
-rw-r--r-- | checks/clock.cpp | 6 | ||||
-rw-r--r-- | checks/validate.cpp | 6 | ||||
-rw-r--r-- | checks/validate.h | 9 | ||||
-rw-r--r-- | checks/x509.cpp | 4 |
8 files changed, 43 insertions, 9 deletions
diff --git a/checks/bench.cpp b/checks/bench.cpp index b9a50f4ab..6345b7e2b 100644 --- a/checks/bench.cpp +++ b/checks/bench.cpp @@ -11,6 +11,7 @@ using Botan::byte; using Botan::u64bit; #include "common.h" +#include "bench.h" /* Discard output to reduce overhead */ struct BitBucket : public Botan::Filter @@ -22,6 +23,8 @@ Botan::Filter* lookup(const std::string&, const std::vector<std::string>&, const std::string& = "All"); +namespace { + double bench_filter(std::string name, Botan::Filter* filter, bool html, double seconds) { @@ -89,6 +92,8 @@ double bench(const std::string& name, const std::string& filtername, bool html, return 0; } +} + void benchmark(const std::string& what, bool html, double seconds) { try { diff --git a/checks/bench.h b/checks/bench.h new file mode 100644 index 000000000..40d3cab8a --- /dev/null +++ b/checks/bench.h @@ -0,0 +1,9 @@ + +#ifndef BOTAN_BENCHMARCH_H__ +#define BOTAN_BENCHMARCH_H__ + +void benchmark(const std::string&, bool html, double seconds); +void bench_pk(const std::string&, bool html, double seconds); +u32bit bench_algo(const std::string&, double); + +#endif diff --git a/checks/bigint.cpp b/checks/bigint.cpp index 5853e8a73..84bee4eaa 100644 --- a/checks/bigint.cpp +++ b/checks/bigint.cpp @@ -11,6 +11,7 @@ using namespace Botan; #include "common.h" +#include "validate.h" #define DEBUG 0 @@ -122,6 +123,8 @@ u32bit do_bigint_tests(const std::string& filename) return errors; } +namespace { + // c==expected, d==a op b, e==a op= b u32bit results(std::string op, const BigInt& a, const BigInt& b, @@ -154,6 +157,8 @@ u32bit results(std::string op, } } +} + u32bit check_add(const std::vector<std::string>& args) { BigInt a(args[0]); diff --git a/checks/check.cpp b/checks/check.cpp index d76e91f0b..64b7c0a01 100644 --- a/checks/check.cpp +++ b/checks/check.cpp @@ -17,15 +17,14 @@ using namespace Botan; #include "getopt.h" +#include "bench.h" +#include "validate.h" const std::string VALIDATION_FILE = "checks/validate.dat"; const std::string BIGINT_VALIDATION_FILE = "checks/mp_valid.dat"; const std::string PK_VALIDATION_FILE = "checks/pk_valid.dat"; const std::string EXPECTED_FAIL_FILE = "checks/fail.dat"; -void benchmark(const std::string&, bool html, double seconds); -void bench_pk(const std::string&, bool html, double seconds); -u32bit bench_algo(const std::string&, double); int validate(); int main(int argc, char* argv[]) @@ -131,9 +130,6 @@ int main(int argc, char* argv[]) int validate() { void test_types(); - u32bit do_validation_tests(const std::string&, bool = true); - u32bit do_bigint_tests(const std::string&); - u32bit do_pk_validation_tests(const std::string&); std::cout << "Beginning validation tests..." << std::endl; diff --git a/checks/clock.cpp b/checks/clock.cpp index cf95f5d2f..73f2c0e39 100644 --- a/checks/clock.cpp +++ b/checks/clock.cpp @@ -10,13 +10,13 @@ using namespace Botan; benchmarks and such take forever. */ -#define USE_CLOCK 1 +#define USE_CLOCK 0 #define USE_TIMES 0 #define USE_POSIX_GETTIME 0 -#define USE_RDTSC 0 +#define USE_RDTSC 1 /* If using USE_RDTSC, set to your CPU's Mhz */ -#define CPU_MHZ 1866 +#define CPU_MHZ 2400 #if USE_CLOCK diff --git a/checks/validate.cpp b/checks/validate.cpp index d6ad90cc2..2910f0b37 100644 --- a/checks/validate.cpp +++ b/checks/validate.cpp @@ -13,9 +13,13 @@ #include <botan/libstate.h> using namespace Botan; +#include "validate.h" + #define EXTRA_TESTS 0 #define DEBUG 0 +namespace { + u32bit random_word(u32bit max) { #if DEBUG @@ -36,6 +40,8 @@ u32bit random_word(u32bit max) #endif } +} + Botan::Filter* lookup(const std::string&, const std::vector<std::string>&, const std::string& = "All"); diff --git a/checks/validate.h b/checks/validate.h new file mode 100644 index 000000000..c14fc56d9 --- /dev/null +++ b/checks/validate.h @@ -0,0 +1,9 @@ + +#ifndef BOTAN_TEST_VALIDATE_H__ +#define BOTAN_TEST_VALIDATE_H__ + +u32bit do_validation_tests(const std::string&, bool = true); +u32bit do_bigint_tests(const std::string&); +u32bit do_pk_validation_tests(const std::string&); + +#endif diff --git a/checks/x509.cpp b/checks/x509.cpp index 7fa605411..a544e907b 100644 --- a/checks/x509.cpp +++ b/checks/x509.cpp @@ -17,6 +17,8 @@ X509_Cert_Options ca_opts(); X509_Cert_Options req_opts1(); X509_Cert_Options req_opts2(); +namespace { + u64bit key_id(const Public_Key* key) { std::auto_ptr<X509_Encoder> encoder(key->x509_encoder()); @@ -67,6 +69,8 @@ u32bit check_against_copy(const Private_Key& orig) return 0; } +} + void do_x509_tests() { RandomNumberGenerator& rng = global_state().prng_reference(); |