From 1566b7105e33bc68865665822bfec0e32a1ef865 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Sat, 8 Aug 2020 12:59:31 +0200 Subject: [PATCH] test that msg width/height are smaller than some reasonable maximum --- src/message.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/message.rs b/src/message.rs index 5a62810a7..5004ba40f 100644 --- a/src/message.rs +++ b/src/message.rs @@ -1884,8 +1884,11 @@ mod tests { if let Ok(msg) = Message::load_from_db(&t.ctx, msg_id.clone()).await { if msg.get_viewtype() == Viewtype::Image { has_image = true; + // just check that width/height are inside some reasonable ranges assert!(msg.get_width() > 100); assert!(msg.get_height() > 100); + assert!(msg.get_width() < 4000); + assert!(msg.get_height() < 4000); } } }