Skip to content

Commit 27b207f

Browse files
committed
Fix broken benchmarks
1 parent 8c517e0 commit 27b207f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ script:
4141
- cargo run --example sign_verify_recovery --features=recovery
4242
- cargo run --example generate_keys --features=rand
4343
- if [ ${TRAVIS_RUST_VERSION} == "stable" ]; then cargo doc --verbose --features="rand,serde,recovery,endomorphism"; fi
44-
- if [ ${TRAVIS_RUST_VERSION} == "nightly" ]; then cargo test --verbose --benches --features=unstable; fi
44+
- if [ ${TRAVIS_RUST_VERSION} == "nightly" ]; then cargo test --verbose --benches --features="unstable,recovery,rand"; fi
4545
- if [ ${TRAVIS_RUST_VERSION} == "nightly" -a "$TRAVIS_OS_NAME" = "linux" ]; then
4646
cd no_std_test &&
4747
cargo run --release | grep -q "Verified Successfully";

src/ecdh.rs

-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ mod benches {
304304
let s = Secp256k1::signing_only();
305305
let (sk, pk) = s.generate_keypair(&mut thread_rng());
306306

307-
let s = Secp256k1::new();
308307
bh.iter( || {
309308
let res = SharedSecret::new(&pk, &sk);
310309
black_box(res);

src/recovery.rs

+4
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ mod tests {
363363

364364
#[cfg(all(test, feature = "unstable"))]
365365
mod benches {
366+
use rand::{thread_rng, RngCore};
367+
use test::{Bencher, black_box};
368+
use super::{Message, Secp256k1};
369+
366370
#[bench]
367371
pub fn bench_recover(bh: &mut Bencher) {
368372
let s = Secp256k1::new();

0 commit comments

Comments
 (0)