summaryrefslogtreecommitdiff
path: root/liblog/tests/liblog_test.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2016-11-03 20:53:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-11-03 20:53:09 +0000
commit11f8b2006827a70faf9eafabdc34b80f8237a855 (patch)
tree8157056bf5b92a6e0f673d51e41fb7810eb61f69 /liblog/tests/liblog_test.cpp
parent3a724a8f5d7876b97e4e7f39a0cfc2f0fdc87fd3 (diff)
parent5febc5131899402e983c319af9c38596ee9a56a2 (diff)
Merge changes Ifb1b550c,Ic7377efc
* changes: liblog: test report pmsg not configured if ENOMEM return logd: clear DUMPABLE
Diffstat (limited to 'liblog/tests/liblog_test.cpp')
-rw-r--r--liblog/tests/liblog_test.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/liblog/tests/liblog_test.cpp b/liblog/tests/liblog_test.cpp
index fd38849e6f..9c095234f2 100644
--- a/liblog/tests/liblog_test.cpp
+++ b/liblog/tests/liblog_test.cpp
@@ -16,6 +16,7 @@
#include <ctype.h>
#include <dirent.h>
+#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <semaphore.h>
@@ -2655,12 +2656,19 @@ TEST(liblog, __android_log_pmsg_file_write) {
bool logdwActiveAfter__android_log_close = isLogdwActive();
EXPECT_FALSE(pmsgActiveAfter__android_log_close);
EXPECT_FALSE(logdwActiveAfter__android_log_close);
- EXPECT_LT(0, __android_log_pmsg_file_write(
+ int return__android_log_pmsg_file_write = __android_log_pmsg_file_write(
LOG_ID_CRASH, ANDROID_LOG_VERBOSE,
- __pmsg_file, max_payload_buf, sizeof(max_payload_buf)));
- fprintf(stderr, "Reboot, ensure file %s matches\n"
- "with liblog.__android_log_msg_file_read test\n",
- __pmsg_file);
+ __pmsg_file, max_payload_buf, sizeof(max_payload_buf));
+ EXPECT_LT(0, return__android_log_pmsg_file_write);
+ if (return__android_log_pmsg_file_write == -ENOMEM) {
+ fprintf(stderr,
+ "Kernel does not have space allocated to pmsg pstore driver configured\n"
+ );
+ } else if (!return__android_log_pmsg_file_write) {
+ fprintf(stderr, "Reboot, ensure file %s matches\n"
+ "with liblog.__android_log_msg_file_read test\n",
+ __pmsg_file);
+ }
bool pmsgActiveAfter__android_pmsg_file_write = isPmsgActive();
bool logdwActiveAfter__android_pmsg_file_write = isLogdwActive();
EXPECT_FALSE(pmsgActiveAfter__android_pmsg_file_write);