Skip to content
Snippets Groups Projects
Commit ea03e1f8 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Greg Kaiser
Browse files

liblog: expect content only if ro.logd.kernel is enabled

On svelte devices, CTS test liblog#android_logger_get_ fails on the
missing kernel buffer because it is not enabled to save space.

Test: gTest liblog_unit_tests
Bug: 109669791
Change-Id: Iaf46fe9713d3462a56885515a67db640544345ab
parent 9bd3ee1c
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
// Test the APIs in this standalone include file // Test the APIs in this standalone include file
#include <log/log_read.h> #include <log/log_read.h>
// Do not use anything in log/log_time.h despite side effects of the above. // Do not use anything in log/log_time.h despite side effects of the above.
#include <private/android_logger.h>
TEST(liblog, __android_log_write__android_logger_list_read) { TEST(liblog, __android_log_write__android_logger_list_read) {
#ifdef __ANDROID__ #ifdef __ANDROID__
...@@ -105,7 +106,10 @@ TEST(liblog, android_logger_get_) { ...@@ -105,7 +106,10 @@ TEST(liblog, android_logger_get_) {
// framework (b/68266385). // framework (b/68266385).
EXPECT_LE( // boolean 1 or 0 depending on expected content or empty EXPECT_LE( // boolean 1 or 0 depending on expected content or empty
!!((strcmp("crash", name) != 0) && !!((strcmp("crash", name) != 0) &&
((strcmp("kernel", name) != 0) || __android_log_is_debuggable()) && ((strcmp("kernel", name) != 0) ||
__android_logger_property_get_bool(
"ro.logd.kernel", BOOL_DEFAULT_TRUE | BOOL_DEFAULT_FLAG_ENG |
BOOL_DEFAULT_FLAG_SVELTE)) &&
(strcmp("stats", name) != 0)), (strcmp("stats", name) != 0)),
android_logger_get_log_readable_size(logger)); android_logger_get_log_readable_size(logger));
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment