diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-10-17 09:11:55 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-10-19 14:34:44 +0200 |
| commit | bf3d40aa7e6a1d95536a406b3fd4743a26cdc758 (patch) | |
| tree | dc16b80f8c761d7bce654767b37ee10aa523b0a4 /src/libarena | |
| parent | 54eb222c40321af6ec2d8dcc961366b1f68302a9 (diff) | |
| download | rust-bf3d40aa7e6a1d95536a406b3fd4743a26cdc758.tar.gz rust-bf3d40aa7e6a1d95536a406b3fd4743a26cdc758.zip | |
Update TypedArena tests
Diffstat (limited to 'src/libarena')
| -rw-r--r-- | src/libarena/lib.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index a7b34b6dc40..dae05a368fa 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -500,7 +500,7 @@ mod tests { #[test] pub fn test_unused() { - let arena: TypedArena<Point> = TypedArena::new(); + let arena: TypedArena<Point> = TypedArena::default(); assert!(arena.chunks.borrow().is_empty()); } @@ -538,7 +538,7 @@ mod tests { } } - let arena = Wrap(TypedArena::new()); + let arena = Wrap(TypedArena::default()); let result = arena.alloc_outer(|| Outer { inner: arena.alloc_inner(|| Inner { value: 10 }), @@ -549,7 +549,7 @@ mod tests { #[test] pub fn test_copy() { - let arena = TypedArena::new(); + let arena = TypedArena::default(); for _ in 0..100000 { arena.alloc(Point { x: 1, y: 2, z: 3 }); } @@ -557,7 +557,7 @@ mod tests { #[bench] pub fn bench_copy(b: &mut Bencher) { - let arena = TypedArena::new(); + let arena = TypedArena::default(); b.iter(|| arena.alloc(Point { x: 1, y: 2, z: 3 })) } @@ -576,7 +576,7 @@ mod tests { #[test] pub fn test_noncopy() { - let arena = TypedArena::new(); + let arena = TypedArena::default(); for _ in 0..100000 { arena.alloc(Noncopy { string: "hello world".to_string(), @@ -587,7 +587,7 @@ mod tests { #[test] pub fn test_typed_arena_zero_sized() { - let arena = TypedArena::new(); + let arena = TypedArena::default(); for _ in 0..100000 { arena.alloc(()); } @@ -595,7 +595,7 @@ mod tests { #[test] pub fn test_typed_arena_clear() { - let mut arena = TypedArena::new(); + let mut arena = TypedArena::default(); for _ in 0..10 { arena.clear(); for _ in 0..10000 { @@ -620,7 +620,7 @@ mod tests { fn test_typed_arena_drop_count() { let counter = Cell::new(0); { - let arena: TypedArena<DropCounter> = TypedArena::new(); + let arena: TypedArena<DropCounter> = TypedArena::default(); for _ in 0..100 { // Allocate something with drop glue to make sure it doesn't leak. arena.alloc(DropCounter { count: &counter }); @@ -632,7 +632,7 @@ mod tests { #[test] fn test_typed_arena_drop_on_clear() { let counter = Cell::new(0); - let mut arena: TypedArena<DropCounter> = TypedArena::new(); + let mut arena: TypedArena<DropCounter> = TypedArena::default(); for i in 0..10 { for _ in 0..100 { // Allocate something with drop glue to make sure it doesn't leak. @@ -659,7 +659,7 @@ mod tests { fn test_typed_arena_drop_small_count() { DROP_COUNTER.with(|c| c.set(0)); { - let arena: TypedArena<SmallDroppable> = TypedArena::new(); + let arena: TypedArena<SmallDroppable> = TypedArena::default(); for _ in 0..100 { // Allocate something with drop glue to make sure it doesn't leak. arena.alloc(SmallDroppable); @@ -671,7 +671,7 @@ mod tests { #[bench] pub fn bench_noncopy(b: &mut Bencher) { - let arena = TypedArena::new(); + let arena = TypedArena::default(); b.iter(|| { arena.alloc(Noncopy { string: "hello world".to_string(), |
