From 510d41ff7d12c8a8ba230d3b3f732b19a20f15e3 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 31 10月 2020 10:28:34 +0800 Subject: [PATCH] doc & miscellaneous changes --- test/functional/hw_identifier_it_test.cpp | 25 +++++++------------------ 1 files changed, 7 insertions(+), 18 deletions(-) diff --git a/test/functional/hw_identifier_it_test.cpp b/test/functional/hw_identifier_it_test.cpp index e1ae99a..ae92cb5 100644 --- a/test/functional/hw_identifier_it_test.cpp +++ b/test/functional/hw_identifier_it_test.cpp @@ -28,7 +28,7 @@ * is OK */ -static void generate_and_verify_license(LCC_API_IDENTIFICATION_STRATEGY strategy, const string& lic_fname) { +static void generate_and_verify_license(LCC_API_HW_IDENTIFICATION_STRATEGY strategy, const string& lic_fname) { BOOST_TEST_CHECKPOINT("Before generate"); const string identifier_out = HwIdentifierFacade::generate_user_pc_signature(strategy); BOOST_TEST_CHECKPOINT("After generate signature"); @@ -49,23 +49,12 @@ BOOST_AUTO_TEST_CASE(volid_lic_file) { HwIdentifier identifier_out; - size_t disk_num; - FUNCTION_RETURN result_diskinfos = getDiskInfos(nullptr, &disk_num); - if ((result_diskinfos == FUNC_RET_BUFFER_TOO_SMALL || result_diskinfos == FUNC_RET_OK) && disk_num > 0) { - generate_and_verify_license(LCC_API_IDENTIFICATION_STRATEGY::STRATEGY_DISK_NUM, "volid_lic_file"); + vector<DiskInfo> diskInfos; + FUNCTION_RETURN result_diskinfos = getDiskInfos(diskInfos); + if ((result_diskinfos == FUNC_RET_BUFFER_TOO_SMALL || result_diskinfos == FUNC_RET_OK) && diskInfos.size() > 0) { + generate_and_verify_license(LCC_API_HW_IDENTIFICATION_STRATEGY::STRATEGY_DISK, "volid_lic_file"); } else { BOOST_TEST_MESSAGE("No disk found skipping testing disk hardware identifier"); - } -} - -BOOST_AUTO_TEST_CASE(volume_name_lic_file) { - HwIdentifier identifier_out; - size_t disk_num; - FUNCTION_RETURN result_diskinfos = getDiskInfos(nullptr, &disk_num); - if ((result_diskinfos == FUNC_RET_BUFFER_TOO_SMALL || result_diskinfos == FUNC_RET_OK) && disk_num > 0) { - generate_and_verify_license(LCC_API_IDENTIFICATION_STRATEGY::STRATEGY_DISK_LABEL, "volume_name_lic_file"); - } else { - BOOST_TEST_MESSAGE("No disk found skipping testing volume name disk hardware identifier"); } } @@ -74,7 +63,7 @@ FUNCTION_RETURN result_adapterInfos = os::getAdapterInfos(adapters); if ((result_adapterInfos == FUNC_RET_BUFFER_TOO_SMALL || result_adapterInfos == FUNC_RET_OK) && adapters.size() > 0) { - generate_and_verify_license(LCC_API_IDENTIFICATION_STRATEGY::STRATEGY_ETHERNET, "strategy_mac_address"); + generate_and_verify_license(LCC_API_HW_IDENTIFICATION_STRATEGY::STRATEGY_ETHERNET, "strategy_mac_address"); } else { BOOST_TEST_MESSAGE("No ethernet adapter found skipping testing mac address hardware identifier"); } @@ -85,7 +74,7 @@ FUNCTION_RETURN result_adapterInfos = os::getAdapterInfos(adapters); if ((result_adapterInfos == FUNC_RET_BUFFER_TOO_SMALL || result_adapterInfos == FUNC_RET_OK) && adapters.size() > 0) { - generate_and_verify_license(LCC_API_IDENTIFICATION_STRATEGY::STRATEGY_IP_ADDRESS, "strategy_ip_address"); + generate_and_verify_license(LCC_API_HW_IDENTIFICATION_STRATEGY::STRATEGY_IP_ADDRESS, "strategy_ip_address"); } else { BOOST_TEST_MESSAGE("No ethernet adapter found skipping testing ip hardware identifier"); } -- Gitblit v1.9.1