Skip to content

Commit

Permalink
[rs] add test case for empty buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Jun 15, 2020
1 parent ee7e1c7 commit 4b05349
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wgpu/examples/hello-compute/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
let slice_size = numbers.len() * std::mem::size_of::<u32>();
let size = slice_size as wgpu::BufferAddress;

let instace = wgpu::Instance::new();
let adapter = instace
let instance = wgpu::Instance::new();
let adapter = instance
.request_adapter(
&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::Default,
Expand Down Expand Up @@ -154,6 +154,12 @@ fn main() {
mod tests {
use super::*;

#[test]
fn test_compute_0() {
let input = vec![];
futures::executor::block_on(assert_execute_gpu(input, vec![]));
}

#[test]
fn test_compute_1() {
let input = vec![1, 2, 3, 4];
Expand Down

0 comments on commit 4b05349

Please sign in to comment.