liblog: test: security buffer is allowed to be denied

am: 53263ff

* commit '53263ffa00b291de92dd4cb399b1cb5218d363f6':
  liblog: test: security buffer is allowed to be denied
This commit is contained in:
Mark Salyzyn 2016-03-16 16:50:08 +00:00 committed by android-build-merger
commit 2581a3e762

View file

@ -1190,11 +1190,20 @@ TEST(liblog, android_logger_get_) {
struct logger * logger;
EXPECT_TRUE(NULL != (logger = android_logger_open(logger_list, id)));
EXPECT_EQ(id, android_logger_get_id(logger));
EXPECT_LT(0, android_logger_get_log_size(logger));
/* crash buffer is allowed to be empty, that is actually healthy! */
if (android_logger_get_log_readable_size(logger) ||
(strcmp("crash", name) && strcmp("security", name))) {
EXPECT_LT(0, android_logger_get_log_readable_size(logger));
ssize_t get_log_size = android_logger_get_log_size(logger);
/* security buffer is allowed to be denied */
if (strcmp("security", name)) {
EXPECT_LT(0, get_log_size);
/* crash buffer is allowed to be empty, that is actually healthy! */
EXPECT_LE((strcmp("crash", name)) != 0,
android_logger_get_log_readable_size(logger));
} else {
EXPECT_NE(0, get_log_size);
if (get_log_size < 0) {
EXPECT_GT(0, android_logger_get_log_readable_size(logger));
} else {
EXPECT_LE(0, android_logger_get_log_readable_size(logger));
}
}
EXPECT_LT(0, android_logger_get_log_version(logger));
}