From d835d348b3d2ba5e790855dde2d7824234e3c531 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Wed, 19 Jan 2022 13:52:51 -0600 Subject: convert: Minor cleanup This commit implements some minor cleanup of various converter- and convert test-related code: * Improves the log messages regarding which converter was returned for a request. * Modifies the result checking code in the converter tests to only report an out-of-range sample error once, rather than reporting every out-of-range sample encountered during the test. This vastly cuts down on the output when a conversion has failed. * Adds a function `reverse_converter()` which, given a `convert::id_type` describing a conversion from C1 to C2, returns a `convert::id_type` describing the reverse conversion (C2 to C1). * Removes two redundant test cases from the converter test. --- host/lib/convert/convert_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib/convert/convert_impl.cpp') diff --git a/host/lib/convert/convert_impl.cpp b/host/lib/convert/convert_impl.cpp index 228f15552..491b8ba1d 100644 --- a/host/lib/convert/convert_impl.cpp +++ b/host/lib/convert/convert_impl.cpp @@ -83,7 +83,7 @@ convert::function_type convert::get_converter(const id_type& id, const priority_ //----------------------------------------------------------------// UHD_LOGGER_DEBUG("CONVERT") << "get_converter: For converter ID: " << id.to_pp_string() - << " Using prio: " << prio; + << " Found exact match for prio: " << prio; ; //----------------------------------------------------------------// return get_table()[id][prio]; @@ -99,7 +99,7 @@ convert::function_type convert::get_converter(const id_type& id, const priority_ //----------------------------------------------------------------// UHD_LOGGER_DEBUG("CONVERT") << "get_converter: For converter ID: " << id.to_pp_string() - << " Using prio: " << best_prio; + << " Using best available prio: " << best_prio; //----------------------------------------------------------------// // otherwise, return best prio -- cgit v1.2.3