From c04af770906649dc9a23dab85f08059ab3da5e16 Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Mon, 6 Mar 2023 15:35:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/base/test_base.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index bf5c0e6..4fdef73 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -592,15 +592,13 @@ public: auto it = test_map_.find(name); - if (it != test_map_.end()) - { - ret = (this->*test_map_[name])((void *)oper); - } - else + if (it == test_map_.end()) { helper_->test_callback(name, ui_helper::TEST_EVENT_NOT_FIND_TEST, NULL, false); return ret; } + ret = (this->*test_map_[name])((void*)oper); + if (ret == SCANNER_ERR_DEVICE_NOT_SUPPORT || ret == SCANNER_ERR_IO || ret == SCANNER_ERR_TIMEOUT @@ -1165,7 +1163,10 @@ public: unsigned int len = sizeof(SANE_Int); int ret = helper_->io_control(IO_CTRL_CODE_SET_CLEAR_HISTORY_COUNT, NULL, NULL); ret = helper_->io_control(IO_CTRL_CODE_GET_HISTORY_SCAN_NUM, &num, &len); - + if (ret != SCANNER_ERR_OK) + { + return ret; + } if ((num == 0 && num != -1)) { type = true; @@ -1174,7 +1175,7 @@ public: else { type = false; - info = L"清除历史计数失败"; + info = L"清除历史计数失败"; } helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)info, type); @@ -1353,13 +1354,9 @@ DECL_API(int) func_test_go(const wchar_t* NAME, const wchar_t* oper, ui_helper* SANE_Bool type = false; unsigned int len = sizeof(SANE_Bool); test ts(helper); - ret = ts.set_test(NAME, oper); - if (ret != SCANNER_ERR_OK) - { - return ret; - } + //ret = helper->io_control(IO_CTRL_CODE_RESTORE_SETTINGS, NULL, NULL);//结束恢复默认 - return ret; + return ts.set_test(NAME, oper); } DECL_API(int) func_test_uninit(void* uninit) {