| | |
| | | #include <fstream> |
| | | #include <stdio.h> |
| | | #include <cstring> |
| | | #include "../../../src/tools/license-generator/license-generator.h" |
| | | #include "../../../src/library/api/license++.h" |
| | | #include "../../src/tools/license-generator/license-generator.h" |
| | | #include "../../src/library/api/license++.h" |
| | | #include <build_properties.h> |
| | | #include <boost/filesystem.hpp> |
| | | #include "../../src/library/ini/SimpleIni.h" |
| | |
| | | PcSignature identifier_out; |
| | | |
| | | IDENTIFICATION_STRATEGY strategy = IDENTIFICATION_STRATEGY::ETHERNET; |
| | | BOOST_CHECKPOINT("Before generate"); |
| | | BOOST_TEST_CHECKPOINT("Before generate"); |
| | | FUNCTION_RETURN generate_ok = generate_user_pc_signature(identifier_out, |
| | | strategy); |
| | | BOOST_ASSERT(generate_ok == FUNCTION_RETURN::FUNC_RET_OK); |
| | |
| | | BOOST_ASSERT(tries > 0); |
| | | |
| | | PcSignature generated_identifier; |
| | | BOOST_CHECKPOINT("Generating current signatures and comparing with past"); |
| | | BOOST_TEST_CHECKPOINT("Generating current signatures and comparing with past"); |
| | | for (int i = 0; i < num_strategies; i++) { |
| | | FUNCTION_RETURN generate_ok = generate_user_pc_signature( |
| | | generated_identifier, strategies[i]); |
| | |
| | | } |
| | | } |
| | | |
| | | BOOST_CHECKPOINT("Verifying signatures"); |
| | | BOOST_TEST_CHECKPOINT("Verifying signatures"); |
| | | for (int j = 0; j < 100; j++) { |
| | | for (unsigned int i = 0; i < reference_signatures.size(); i++) { |
| | | PcSignature pcsig; |
| | |
| | | string message = string("pc signature verification strategy:") |
| | | + to_string(i) + " generated: [" + generated_identifier |
| | | + "] reference: [" + reference_signatures[i] + "]"; |
| | | BOOST_CHECKPOINT("Verifying signature: "); |
| | | BOOST_TEST_CHECKPOINT("Verifying signature: "); |
| | | BOOST_CHECK_EQUAL(val_result, LICENSE_OK); |
| | | } |
| | | } |