summaryrefslogtreecommitdiffstats
path: root/liblog
diff options
context:
space:
mode:
authorMark Salyzyn2018-06-05 09:33:35 -0500
committerMark Salyzyn2018-06-05 09:43:15 -0500
commit42fb2821ccdb8461239cab4e2203bade07b65ce4 (patch)
treec44247f895a82dc2b0656573258198663885af84 /liblog
parent2be430aceb28508b5eddce16778ddb9f2900426b (diff)
downloadplatform-system-core-42fb2821ccdb8461239cab4e2203bade07b65ce4.tar.gz
platform-system-core-42fb2821ccdb8461239cab4e2203bade07b65ce4.tar.xz
platform-system-core-42fb2821ccdb8461239cab4e2203bade07b65ce4.zip
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
Diffstat (limited to 'liblog')
-rw-r--r--liblog/tests/log_read_test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/liblog/tests/log_read_test.cpp b/liblog/tests/log_read_test.cpp
index 444a5ac64..443c3ea58 100644
--- a/liblog/tests/log_read_test.cpp
+++ b/liblog/tests/log_read_test.cpp
@@ -27,6 +27,7 @@
27// Test the APIs in this standalone include file 27// Test the APIs in this standalone include file
28#include <log/log_read.h> 28#include <log/log_read.h>
29// Do not use anything in log/log_time.h despite side effects of the above. 29// Do not use anything in log/log_time.h despite side effects of the above.
30#include <private/android_logger.h>
30 31
31TEST(liblog, __android_log_write__android_logger_list_read) { 32TEST(liblog, __android_log_write__android_logger_list_read) {
32#ifdef __ANDROID__ 33#ifdef __ANDROID__
@@ -105,7 +106,10 @@ TEST(liblog, android_logger_get_) {
105 // framework (b/68266385). 106 // framework (b/68266385).
106 EXPECT_LE( // boolean 1 or 0 depending on expected content or empty 107 EXPECT_LE( // boolean 1 or 0 depending on expected content or empty
107 !!((strcmp("crash", name) != 0) && 108 !!((strcmp("crash", name) != 0) &&
108 ((strcmp("kernel", name) != 0) || __android_log_is_debuggable()) && 109 ((strcmp("kernel", name) != 0) ||
110 __android_logger_property_get_bool(
111 "ro.logd.kernel", BOOL_DEFAULT_TRUE | BOOL_DEFAULT_FLAG_ENG |
112 BOOL_DEFAULT_FLAG_SVELTE)) &&
109 (strcmp("stats", name) != 0)), 113 (strcmp("stats", name) != 0)),
110 android_logger_get_log_readable_size(logger)); 114 android_logger_get_log_readable_size(logger));
111 } else { 115 } else {