mirror of
				https://github.com/bspeice/qadapt
				synced 2025-10-31 09:30:37 -04:00 
			
		
		
		
	Fix conditional compilation guards
This commit is contained in:
		| @ -17,7 +17,7 @@ fn test_copy() { | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| #[should_panic] | ||||
| #[cfg_attr(debug_assertions, should_panic)] | ||||
| fn test_allocate() { | ||||
|     enter_protected(); | ||||
|     let _x = Box::new(12); | ||||
| @ -90,7 +90,7 @@ fn vec_with_one() { | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| #[should_panic] | ||||
| #[cfg_attr(debug_assertions, should_panic)] | ||||
| fn exit_too_often() { | ||||
|     enter_protected(); | ||||
|     exit_protected(); | ||||
| @ -98,7 +98,7 @@ fn exit_too_often() { | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| #[should_panic] | ||||
| #[cfg_attr(debug_assertions, should_panic)] | ||||
| fn intentional_drop() { | ||||
|     let v: Vec<()> = Vec::new(); | ||||
|     let v = Box::new(v); | ||||
|  | ||||
| @ -9,11 +9,6 @@ static Q: QADAPT = QADAPT; | ||||
|  | ||||
| #[allocate_panic] | ||||
| fn no_allocate() { | ||||
|     #[cfg(not(release))] | ||||
|     { | ||||
|         let _v = 0; | ||||
|     } | ||||
|     assert_eq!(::qadapt::protection_level(), 1); | ||||
|     let _v: Vec<()> = Vec::with_capacity(0); | ||||
| } | ||||
|  | ||||
| @ -149,3 +144,16 @@ fn example_closure() { | ||||
| fn macro_closure() { | ||||
|     example_closure() | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| #[allocate_panic] | ||||
| fn macro_release_safe() { | ||||
|     #[cfg(debug_assertions)] | ||||
|     { | ||||
|         assert_eq!(1, ::qadapt::protection_level()); | ||||
|     } | ||||
|     #[cfg(not(debug_assertions))] | ||||
|     { | ||||
|         assert_eq!(0, ::qadapt::protection_level()); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user