From 722e944323c387f607d580ddfa2c5d9d2a1a76cc Mon Sep 17 00:00:00 2001 From: mattprost Date: Wed, 8 Apr 2020 16:39:14 -0500 Subject: fixup! uhd: Add fuzzy serial number checking --- host/tests/serial_number_test.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'host/tests') diff --git a/host/tests/serial_number_test.cpp b/host/tests/serial_number_test.cpp index 11c7f5372..f2dc4bb42 100644 --- a/host/tests/serial_number_test.cpp +++ b/host/tests/serial_number_test.cpp @@ -9,14 +9,14 @@ BOOST_AUTO_TEST_CASE(test_serial_numbers_match) { - BOOST_CHECK_EQUAL(true, uhd::serial_numbers_match("abcd123", "abcd123")); - BOOST_CHECK_EQUAL(true, uhd::serial_numbers_match("0abcd123", "0abcd123")); - BOOST_CHECK_EQUAL(false, uhd::serial_numbers_match("0abcd123", "abcd1230")); - BOOST_CHECK_EQUAL(false, uhd::serial_numbers_match("abcd123", "abcd124")); - BOOST_CHECK_EQUAL(false, uhd::serial_numbers_match("abcd123", "321dcba")); - BOOST_CHECK_EQUAL(true, uhd::serial_numbers_match("abcd123", "0abcd123")); - BOOST_CHECK_EQUAL(true, uhd::serial_numbers_match("0abcd123", "abcd123")); + BOOST_CHECK_EQUAL(true, uhd::utils::serial_numbers_match("abcd123", "abcd123")); + BOOST_CHECK_EQUAL(true, uhd::utils::serial_numbers_match("0abcd123", "0abcd123")); + BOOST_CHECK_EQUAL(false, uhd::utils::serial_numbers_match("0abcd123", "abcd1230")); + BOOST_CHECK_EQUAL(false, uhd::utils::serial_numbers_match("abcd123", "abcd124")); + BOOST_CHECK_EQUAL(false, uhd::utils::serial_numbers_match("abcd123", "321dcba")); + BOOST_CHECK_EQUAL(true, uhd::utils::serial_numbers_match("abcd123", "0abcd123")); + BOOST_CHECK_EQUAL(true, uhd::utils::serial_numbers_match("0abcd123", "abcd123")); // Out of range - BOOST_CHECK_EQUAL(false, uhd::serial_numbers_match("aaaaaaaaaaaaaa", "abcd123")); + BOOST_CHECK_EQUAL(false, uhd::utils::serial_numbers_match("aaaaaaaaaaaaaa", "abcd123")); } -- cgit v1.2.3