Add more tests

This commit is contained in:
Gabriel Majeri 2017-06-19 21:58:20 +03:00
parent 09d86603a9
commit d0a75c1430
2 changed files with 21 additions and 0 deletions

View File

@ -434,3 +434,17 @@ impl<'a, T: ?Sized + 'a> DerefMut for WriteLock<'a, T> {
self.inner.deref_mut()
}
}
#[cfg(test)]
mod tests {
use buffer::{CpuAccessibleBuffer, BufferUsage};
#[test]
fn create_empty_buffer() {
let (device, queue) = gfx_dev_and_queue!();
const EMPTY: [i32; 0] = [];
CpuAccessibleBuffer::from_data(device, BufferUsage::all(), Some(queue.family()), EMPTY.iter());
}
}

View File

@ -655,6 +655,13 @@ mod tests {
.then_signal_fence_and_flush().unwrap();
}
#[test]
fn create_buffer_zero_size_data() {
let (device, queue) = gfx_dev_and_queue!();
ImmutableBuffer::from_data((), BufferUsage::all(), Some(queue.family()), queue.clone());
}
// TODO: write tons of tests that try to exploit loopholes
// this isn't possible yet because checks aren't correctly implemented yet
}