From ff147255262f9e4da945aeb3820ebad60f0bd2b1 Mon Sep 17 00:00:00 2001 From: ut000593 Date: Fri, 17 Dec 2021 13:44:17 +0800 Subject: [PATCH] =?UTF-8?q?chore(arm):=20arm=20=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 单元测试图片识别超时,修改测试图片 Log: 单元测试超时问题 Change-Id: Ib2b7bf886e4e020e2882a92caf7d309697489290 --- tests/tessocrutils/test_tessocrutils.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/tessocrutils/test_tessocrutils.cpp b/tests/tessocrutils/test_tessocrutils.cpp index 40e490e..9336312 100644 --- a/tests/tessocrutils/test_tessocrutils.cpp +++ b/tests/tessocrutils/test_tessocrutils.cpp @@ -49,6 +49,7 @@ class TessOcrUtilsTest:public testing::Test{ public: Stub stub; + QString testImgPath = "/Wallpapers/marian-kroell-qElMHWePpok-unsplash.jpg"; TessOcrUtils *m_tessOCrUtils = nullptr; virtual void SetUp() override{ m_tessOCrUtils = TessOcrUtils::instance(); @@ -79,7 +80,7 @@ TEST_F(TessOcrUtilsTest, tessOcrUtils) TEST_F(TessOcrUtilsTest, getRecogitionResultImagePathAndResultType) { //QString imagePath = "/media/wangcong/workspace/wangcong/workspace/qt_workspace/project/deepin-ocr/assets/testocr.png"; - QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/Wallpapers/luca-micheli-ruWkmt3nU58-unsplash.jpg"; + QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + testImgPath; ResultType resultType = ResultType::RESULT_STRING; RecognitionResult recognitionResult = m_tessOCrUtils->getRecogitionResult(imagePath,resultType); EXPECT_EQ(true, recognitionResult.flag); @@ -91,7 +92,7 @@ TEST_F(TessOcrUtilsTest, getRecogitionResultImagePathAndResultType) TEST_F(TessOcrUtilsTest, getRecogitionResult2ImagePath) { - QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/Wallpapers/luca-micheli-ruWkmt3nU58-unsplash.jpg"; + QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + testImgPath; RecognitionResult recognitionResult = m_tessOCrUtils->getRecogitionResult(imagePath); recognitionResult = m_tessOCrUtils->getRecogitionResult(imagePath); EXPECT_EQ(true, recognitionResult.flag); @@ -103,7 +104,7 @@ TEST_F(TessOcrUtilsTest, getRecogitionResult2ImagePath) TEST_F(TessOcrUtilsTest, getRecogitionResultImageAndResultType) { - QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/Wallpapers/luca-micheli-ruWkmt3nU58-unsplash.jpg"; + QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + testImgPath; ResultType resultType = ResultType::RESULT_STRING; QImage* t_image = new QImage(imagePath); RecognitionResult recognitionResult = TessOcrUtils::instance()->getRecogitionResult(t_image,resultType); @@ -116,7 +117,7 @@ TEST_F(TessOcrUtilsTest, getRecogitionResultImageAndResultType) TEST_F(TessOcrUtilsTest, getRecogitionResultImage) { - QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/Wallpapers/luca-micheli-ruWkmt3nU58-unsplash.jpg"; + QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + testImgPath; QImage* t_image = new QImage(imagePath); RecognitionResult recognitionResult = TessOcrUtils::instance()->getRecogitionResult(t_image); EXPECT_EQ(true, recognitionResult.flag); @@ -130,7 +131,7 @@ TEST_F(TessOcrUtilsTest, getRecogitionResultImage) TEST_F(TessOcrUtilsTest, isRunning) { EXPECT_EQ(false, m_tessOCrUtils->isRunning()); - QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/Wallpapers/luca-micheli-ruWkmt3nU58-unsplash.jpg"; + QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + testImgPath; ResultType resultType = ResultType::RESULT_STRING; RecognitionResult recognitionResult = m_tessOCrUtils->getRecogitionResult(imagePath,resultType); EXPECT_EQ(false, m_tessOCrUtils->isRunning()); @@ -138,7 +139,7 @@ TEST_F(TessOcrUtilsTest, isRunning) TEST_F(TessOcrUtilsTest, getRecognizeResult) { - QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/Wallpapers/luca-micheli-ruWkmt3nU58-unsplash.jpg"; + QString imagePath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + testImgPath; QImage* image = new QImage(imagePath); ResultType resultType = ResultType::RESULT_STRING; Pix *p_image;