From 4769cd1b041ec7b566fac57e1ba199cf18ee7afa Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Sat, 21 Oct 2023 16:47:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AF=BB=E5=8F=96=E5=86=85?= =?UTF-8?q?=E5=AD=98=E5=92=8C=E7=A1=AC=E7=9B=98=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/HGProductionTool/HGProductionTool.pro | 2 +- code/base/test_base.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/HGProductionTool/HGProductionTool.pro b/app/HGProductionTool/HGProductionTool.pro index 72547e9..c0caadd 100644 --- a/app/HGProductionTool/HGProductionTool.pro +++ b/app/HGProductionTool/HGProductionTool.pro @@ -40,7 +40,7 @@ win32 { } LIBS += -L$$PWD/../../../code_app/build2/build/$${MY_OS}/$${OEM_NAME}/$${MY_ARCH}/$${MY_CONFIGURE} -l$${OEM_PREFIX}Base -l$${OEM_PREFIX}ImgFmt -l$${OEM_PREFIX}ImgProc - LIBS += -L$$PWD/../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsane + LIBS += -L$$PWD/../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsanexy # sane.dll LIBS += -L$$PWD/../../../release/win/$${MY_ARCH}/OEM/$${OEM_NAME} diff --git a/code/base/test_base.cpp b/code/base/test_base.cpp index 3e2fee8..a8f4970 100644 --- a/code/base/test_base.cpp +++ b/code/base/test_base.cpp @@ -1,4 +1,4 @@ -#include"test_base.h" +#include"test_base.h" #include #include #include @@ -1482,25 +1482,26 @@ public: std::string cpu; unsigned len = 0; std::wstring wstr; - size_t l = 0; + size_t size = 0; int ret = helper_->io_control(IO_CTRL_CODE_GET_DEVS_CPU, &cpu[0], &len); - ret = str_to_wchar(cpu.c_str(), (wchar_t*)wstr.c_str(), &l); + ret = str_to_wchar(cpu.c_str(), (wchar_t*)wstr.c_str(), &size); if (ret == ERROR_INSUFFICIENT_BUFFER) { - wstr.resize(l); - ret = str_to_wchar(cpu.c_str(), (wchar_t*)wstr.c_str(), &l); + wstr.resize(size); + ret = str_to_wchar(cpu.c_str(), (wchar_t*)wstr.c_str(), &size); } helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_DEVS_CPU, (void*)wstr.c_str(), true); std::string disk; unsigned len2 = 0; std::wstring wstr2; + size_t size2 = 0; ret = helper_->io_control(IO_CTRL_CODE_GET_DEVS_DISK, &disk[0], &len2); - ret = str_to_wchar(disk.c_str(), (wchar_t*)wstr2.c_str(), &l); + ret = str_to_wchar(disk.c_str(), (wchar_t*)wstr2.c_str(), &size2); if (ret == ERROR_INSUFFICIENT_BUFFER) { - wstr2.resize(l); - ret = str_to_wchar(disk.c_str(), (wchar_t*)wstr2.c_str(), &l); + wstr2.resize(size2); + ret = str_to_wchar(disk.c_str(), (wchar_t*)wstr2.c_str(), &size2); } helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVEB_GET_DEVICE_DEVS_CPU, (void*)wstr2.c_str(), true); @@ -1511,7 +1512,6 @@ public: helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)(L"获取失败"), false); return -1; } - else { helper_->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)(L"获取完成"), true);