Skip to content

Commit

Permalink
removed the engine test for now - needs discussion on how to test
Browse files Browse the repository at this point in the history
  • Loading branch information
brimonk committed Apr 6, 2024
1 parent 4c1f811 commit 6e3dbd4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion openssl-sys/src/handwritten/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub const ENGINE_METHOD_PKEY_ASN1_METHS: u32 = 0x0400;
pub const ENGINE_METHOD_EC: u32 = 0x0800;

pub const ENGINE_METHOD_ALL: u32 = 0xffff;
pub const ENGINE_METHOD_NONE: u32 = 0xffff;
pub const ENGINE_METHOD_NONE: u32 = 0x0000;

#[cfg(ossl110)]
extern "C" {
Expand Down
86 changes: 43 additions & 43 deletions openssl/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,46 +792,46 @@ impl Drop for Engine {
}
}

mod test {
use super::*;

// #[test]
fn test_basic_engine_creation() {
let mut engine = Engine::new().unwrap();

let name = String::from("engine_name");
let id = String::from("engine_id");

// there should not be errors on setting id or name
assert!(engine.set_id(&id).is_ok());
assert!(engine.set_name(&name).is_ok());

assert_eq!(id, engine.get_id().unwrap().as_str());
assert_eq!(name, engine.get_name().unwrap().as_str());
}

#[test]
fn iterate_through_engines() {
let mut engine = Engine::get_first().unwrap();

let mut has_engines = true;
let mut engine_cnt = 1;

println!("Engines:");

while has_engines {
println!(
" {}, name={}, id={}",
engine_cnt,
engine.get_name().unwrap(),
engine.get_id().unwrap()
);
match engine.get_next() {
Ok(e) => engine = e,
Err(_) => has_engines = false,
}

engine_cnt += 1;
}
}
}
// mod test {
// use super::*;
//
// // #[test]
// fn test_basic_engine_creation() {
// let mut engine = Engine::new().unwrap();
//
// let name = String::from("engine_name");
// let id = String::from("engine_id");
//
// // there should not be errors on setting id or name
// assert!(engine.set_id(&id).is_ok());
// assert!(engine.set_name(&name).is_ok());
//
// assert_eq!(id, engine.get_id().unwrap().as_str());
// assert_eq!(name, engine.get_name().unwrap().as_str());
// }
//
// #[test]
// fn iterate_through_engines() {
// let mut engine = Engine::get_first().unwrap();
//
// let mut has_engines = true;
// let mut engine_cnt = 1;
//
// println!("Engines:");
//
// while has_engines {
// println!(
// " {}, name={}, id={}",
// engine_cnt,
// engine.get_name().unwrap(),
// engine.get_id().unwrap()
// );
// match engine.get_next() {
// Ok(e) => engine = e,
// Err(_) => has_engines = false,
// }
//
// engine_cnt += 1;
// }
// }
// }

0 comments on commit 6e3dbd4

Please sign in to comment.