test: don't try to log for LOG_LEVEL_NONE

We can only log for a level below our current one if we are two above
NONE. And by the same instance, we don't expect NONE messages to show
up.
This commit is contained in:
Peter Hutterer 2021-09-16 17:26:54 +10:00
parent b00bc81929
commit 48cff597a6

View file

@ -156,10 +156,10 @@ test_log_levels(enum spa_log_level level)
* with our level, one with a level above (should never show up)
* and one with a level below (should show up).
*/
if (level > SPA_LOG_LEVEL_NONE) {
if (level > SPA_LOG_LEVEL_NONE)
pw_log(level, "CURRENT");
if (level > SPA_LOG_LEVEL_ERROR)
pw_log(level - 1, "BELOW");
}
if (level < SPA_LOG_LEVEL_TRACE)
pw_log(level + 1, "ABOVE");
@ -180,6 +180,9 @@ test_log_levels(enum spa_log_level level)
if (level == SPA_LOG_LEVEL_NONE) {
pwtest_bool_false(current_level_found);
pwtest_bool_false(below_level_found);
} else if (level == SPA_LOG_LEVEL_ERROR) {
pwtest_bool_true(current_level_found);
pwtest_bool_false(below_level_found);
} else {
pwtest_bool_true(current_level_found);
pwtest_bool_true(below_level_found);