Skip to content

Commit

Permalink
commented out some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDan64 committed Jul 13, 2024
1 parent 66be5e9 commit 8dddce0
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions tests/all/test_values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,52 +504,52 @@ use std::convert::TryFrom;
// assert!(ppc_f128_poison.is_poison());
// }

// #[test]
// fn test_consecutive_fns() {
// let context = Context::create();
// let module = context.create_module("fns");
#[test]
fn test_consecutive_fns() {
let context = Context::create();
let module = context.create_module("fns");

// let void_type = context.void_type();
// let fn_type = void_type.fn_type(&[], false);
let void_type = context.void_type();
let fn_type = void_type.fn_type(&[], false);

// let function = module.add_function("fn", fn_type, None);
let function = module.add_function("fn", fn_type, None);

// assert!(function.get_previous_function().is_none());
// assert!(function.get_next_function().is_none());
assert!(function.get_previous_function().is_none());
assert!(function.get_next_function().is_none());

// let function2 = module.add_function("fn2", fn_type, None);
let function2 = module.add_function("fn2", fn_type, None);

// assert_ne!(function, function2);
assert_ne!(function, function2);

// assert!(function.get_previous_function().is_none());
// assert_eq!(function.get_next_function().unwrap(), function2);
assert!(function.get_previous_function().is_none());
assert_eq!(function.get_next_function().unwrap(), function2);

// assert_eq!(function2.get_previous_function().unwrap(), function);
// assert!(function2.get_next_function().is_none());
// }
assert_eq!(function2.get_previous_function().unwrap(), function);
assert!(function2.get_next_function().is_none());
}

#[test]
fn test_verify_fn() {
let context = Context::create();
let builder = context.create_builder();
let module = context.create_module("fns");
// #[test]
// fn test_verify_fn() {
// let context = Context::create();
// let builder = context.create_builder();
// let module = context.create_module("fns");

let void_type = context.void_type();
let fn_type = void_type.fn_type(&[], false);
// let void_type = context.void_type();
// let fn_type = void_type.fn_type(&[], false);

let function = module.add_function("fn", fn_type, None);
// let function = module.add_function("fn", fn_type, None);

assert!(function.verify(false));
// assert!(function.verify(false));

let basic_block = context.append_basic_block(function, "entry");
// let basic_block = context.append_basic_block(function, "entry");

builder.position_at_end(basic_block);
builder.build_return(None).unwrap();
// builder.position_at_end(basic_block);
// builder.build_return(None).unwrap();

assert!(function.verify(false));
// assert!(function.verify(false));

// TODO: Verify other verify modes
}
// // TODO: Verify other verify modes
// }

// #[test]
// fn test_metadata() {
Expand Down

0 comments on commit 8dddce0

Please sign in to comment.