mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
add failing test for dc_get_filemeta()
This commit is contained in:
@@ -916,4 +916,22 @@ mod tests {
|
|||||||
"3h 1m 0s"
|
"3h 1m 0s"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_get_filemeta() {
|
||||||
|
let data = include_bytes!("../test-data/image/avatar900x900.png");
|
||||||
|
let (w, h) = dc_get_filemeta(data).unwrap();
|
||||||
|
assert_eq!(w, 900);
|
||||||
|
assert_eq!(h, 900);
|
||||||
|
|
||||||
|
let data = include_bytes!("../test-data/image/avatar1000x1000.jpg");
|
||||||
|
let (w, h) = dc_get_filemeta(data).unwrap();
|
||||||
|
assert_eq!(w, 1000);
|
||||||
|
assert_eq!(h, 1000);
|
||||||
|
|
||||||
|
let data = include_bytes!("../test-data/image/image100x50.gif");
|
||||||
|
let (w, h) = dc_get_filemeta(data).unwrap();
|
||||||
|
assert_eq!(w, 100);
|
||||||
|
assert_eq!(h, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
test-data/image/image100x50.gif
Normal file
BIN
test-data/image/image100x50.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 274 B |
Reference in New Issue
Block a user