From cdac7c7bec3d1983b3a635a49d1b69cf07d0bdb7 Mon Sep 17 00:00:00 2001
From: Pierre-Emmanuel Viel
Date: Sun, 28 Jun 2020 16:55:50 +0200
Subject: [PATCH] Add test checking we don't throw when creating GenericIndex
with LshIndexParams()
---
modules/flann/test/test_lshtable_badarg.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/flann/test/test_lshtable_badarg.cpp b/modules/flann/test/test_lshtable_badarg.cpp
index 8fb25b44cb..f75925f659 100644
--- a/modules/flann/test/test_lshtable_badarg.cpp
+++ b/modules/flann/test/test_lshtable_badarg.cpp
@@ -90,4 +90,10 @@ void CV_LshTableBadArgTest::run( int /* start_from */ )
TEST(Flann_LshTable, badarg) { CV_LshTableBadArgTest test; test.safe_run(); }
+TEST(Flann_LshTable, bad_any_cast) {
+ Mat features = Mat::ones(1, 64, CV_8U);
+ EXPECT_NO_THROW(flann::GenericIndex >(
+ features, cvflann::LshIndexParams()));
+}
+
}} // namespace