调整压力测试

This commit is contained in:
13038267101 2023-01-06 15:34:35 +08:00
parent 2b5be77410
commit ae04876dc7
1 changed files with 16 additions and 11 deletions

View File

@ -300,19 +300,24 @@ public:
size_t l = 0; size_t l = 0;
bool type = true; bool type = true;
wchar_t buf[128] =L""; wchar_t buf[128] =L"";
int ret = str_to_wchar((char*)data, (wchar_t*)wstr.c_str(), &l); int ret = SCANNER_ERR_OK;
if (ret == ERROR_INSUFFICIENT_BUFFER) if (code != SANE_EVENT_IMAGE_OK)
{
wstr.resize(l);
ret = str_to_wchar((char*)data, (wchar_t*)wstr.c_str(), &l);
}
if (ret == ERROR_INSUFFICIENT_BUFFER)
{ {
type = false; ret = str_to_wchar((char*)data, (wchar_t*)wstr.c_str(), &l);
if (ret == ERROR_INSUFFICIENT_BUFFER)
h->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)wstr.c_str(), type); {
return -1; wstr.resize(l);
ret = str_to_wchar((char*)data, (wchar_t*)wstr.c_str(), &l);
}
if (ret == ERROR_INSUFFICIENT_BUFFER)
{
type = false;
h->test_callback(set_test_name_.c_str(), ui_helper::TEST_EVENT_RESULT, (void*)wstr.c_str(), type);
return -1;
}
} }
//std::string str = StringToUtf((char*)data); //std::string str = StringToUtf((char*)data);
switch (code) switch (code)
{ {