Loading liblog/tests/Android.mk +35 −0 Original line number Diff line number Diff line Loading @@ -74,3 +74,38 @@ LOCAL_CFLAGS += $(test_c_flags) LOCAL_SHARED_LIBRARIES := liblog libcutils libbase LOCAL_SRC_FILES := $(test_src_files) include $(BUILD_NATIVE_TEST) cts_executable := CtsLiblogTestCases include $(CLEAR_VARS) LOCAL_MODULE := $(cts_executable) LOCAL_MODULE_TAGS := tests LOCAL_CFLAGS += $(test_c_flags) LOCAL_SRC_FILES := $(test_src_files) LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest LOCAL_MULTILIB := both LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 LOCAL_SHARED_LIBRARIES := liblog libcutils libbase LOCAL_STATIC_LIBRARIES := libgtest libgtest_main LOCAL_COMPATIBILITY_SUITE := cts LOCAL_CTS_TEST_PACKAGE := android.core.liblog include $(BUILD_CTS_EXECUTABLE) ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64)) include $(CLEAR_VARS) LOCAL_MODULE := $(cts_executable)_list LOCAL_MODULE_TAGS := optional LOCAL_CFLAGS := $(test_c_flags) -DHOST LOCAL_C_INCLUDES := external/gtest/include LOCAL_SRC_FILES := $(test_src_files) LOCAL_MULTILIB := both LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE) LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 LOCAL_CXX_STL := libc++ LOCAL_SHARED_LIBRARIES := liblog libcutils libbase LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk include $(BUILD_HOST_NATIVE_TEST) endif # ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64)) liblog/tests/AndroidTest.xml 0 → 100644 +27 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <configuration description="Config for CTS Logging Library test cases"> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> <option name="cleanup" value="true" /> <option name="push" value="CtsLiblogTestCases->/data/local/tmp/CtsLiblogTestCases" /> <option name="append-bitness" value="true" /> </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="CtsLiblogTestCases" /> <option name="runtime-hint" value="65s" /> </test> </configuration> liblog/tests/libc_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <stdio.h> TEST(libc, __pstore_append) { #ifdef __ANDROID__ FILE *fp; ASSERT_TRUE(NULL != (fp = fopen("/dev/pmsg0", "a"))); static const char message[] = "libc.__pstore_append\n"; Loading @@ -42,4 +43,7 @@ TEST(libc, __pstore_append) { "Reboot, ensure string libc.__pstore_append is in /sys/fs/pstore/pmsg-ramoops-0\n" ); } #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } liblog/tests/liblog_test.cpp +182 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,9 @@ #include <android-base/file.h> #include <android-base/stringprintf.h> #ifdef __ANDROID__ // includes sys/properties.h which does not exist outside #include <cutils/properties.h> #endif #include <gtest/gtest.h> #include <log/logprint.h> #include <log/log_event_list.h> Loading @@ -53,6 +55,7 @@ _rc; }) TEST(liblog, __android_log_buf_print) { #ifdef __ANDROID__ EXPECT_LT(0, __android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, "TEST__android_log_buf_print", "radio")); Loading @@ -65,9 +68,13 @@ TEST(liblog, __android_log_buf_print) { "TEST__android_log_buf_print", "main")); usleep(1000); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_buf_write) { #ifdef __ANDROID__ EXPECT_LT(0, __android_log_buf_write(LOG_ID_RADIO, ANDROID_LOG_INFO, "TEST__android_log_buf_write", "radio")); Loading @@ -80,9 +87,13 @@ TEST(liblog, __android_log_buf_write) { "TEST__android_log_buf_write", "main")); usleep(1000); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_btwrite) { #ifdef __ANDROID__ int intBuf = 0xDEADBEEF; EXPECT_LT(0, __android_log_btwrite(0, EVENT_TYPE_INT, Loading @@ -97,20 +108,26 @@ TEST(liblog, __android_log_btwrite) { EVENT_TYPE_STRING, Buf, sizeof(Buf) - 1)); usleep(1000); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static void* ConcurrentPrintFn(void *arg) { int ret = __android_log_buf_print(LOG_ID_MAIN, ANDROID_LOG_INFO, "TEST__android_log_print", "Concurrent %" PRIuPTR, reinterpret_cast<uintptr_t>(arg)); return reinterpret_cast<void*>(ret); } #endif #define NUM_CONCURRENT 64 #define _concurrent_name(a,n) a##__concurrent##n #define concurrent_name(a,n) _concurrent_name(a,n) TEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) { #ifdef __ANDROID__ pthread_t t[NUM_CONCURRENT]; int i; for (i=0; i < NUM_CONCURRENT; i++) { Loading @@ -128,8 +145,12 @@ TEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) { } } ASSERT_LT(0, ret); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ std::string popenToString(std::string command) { std::string ret; Loading Loading @@ -193,8 +214,10 @@ static bool isLogdwActive() { } return false; } #endif TEST(liblog, __android_log_btwrite__android_logger_list_read) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -257,14 +280,20 @@ TEST(liblog, __android_log_btwrite__android_logger_list_read) { EXPECT_EQ(1, second_count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static inline int32_t get4LE(const char* src) { return src[0] | (src[1] << 8) | (src[2] << 16) | (src[3] << 24); } #endif static void bswrite_test(const char *message) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -347,6 +376,10 @@ static void bswrite_test(const char *message) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else message = NULL; GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_bswrite_and_print) { Loading @@ -370,6 +403,7 @@ TEST(liblog, __android_log_bswrite_and_print__multiple_newline) { } static void buf_write_test(const char *message) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -436,6 +470,10 @@ static void buf_write_test(const char *message) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else message = NULL; GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_buf_write_and_print__empty) { Loading @@ -451,6 +489,7 @@ TEST(liblog, __android_log_buf_write_and_print__newline_space_prefix) { } TEST(liblog, __security) { #ifdef __ANDROID__ static const char persist_key[] = "persist.logd.security"; static const char readonly_key[] = "ro.device_owner"; static const char nothing_val[] = "_NOTHING_TO_SEE_HERE_"; Loading Loading @@ -485,9 +524,13 @@ TEST(liblog, __security) { property_set(persist_key, ""); EXPECT_FALSE(__android_log_security()); property_set(persist_key, persist); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __security_buffer) { #ifdef __ANDROID__ struct logger_list *logger_list; android_event_long_t buffer; Loading Loading @@ -621,9 +664,12 @@ TEST(liblog, __security_buffer) { "not system, content submitted but can not check end-to-end\n"); } EXPECT_EQ(clientHasSecurityCredentials ? 1 : 0, count); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static unsigned signaled; static log_time signal_time; Loading Loading @@ -682,8 +728,10 @@ static void get_ticks(unsigned long long *uticks, unsigned long long *sticks) *uticks = *sticks = 0; } } #endif TEST(liblog, android_logger_list_read__cpu_signal) { #ifdef __ANDROID__ struct logger_list *logger_list; unsigned long long v = 0xDEADBEEFA55A0000ULL; Loading Loading @@ -768,8 +816,12 @@ TEST(liblog, android_logger_list_read__cpu_signal) { EXPECT_GT(one_percent_ticks, user_ticks); EXPECT_GT(one_percent_ticks, system_ticks); EXPECT_GT(one_percent_ticks, user_ticks + system_ticks); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ /* * Strictly, we are not allowed to log messages in a signal context, the * correct way to handle this is to ensure the messages are constructed in Loading Loading @@ -832,8 +884,10 @@ int start_thread() pthread_attr_destroy(&attr); return 0; } #endif TEST(liblog, android_logger_list_read__cpu_thread) { #ifdef __ANDROID__ struct logger_list *logger_list; unsigned long long v = 0xDEADBEAFA55A0000ULL; Loading Loading @@ -919,11 +973,16 @@ TEST(liblog, android_logger_list_read__cpu_thread) { EXPECT_GT(one_percent_ticks, user_ticks); EXPECT_GT(one_percent_ticks, system_ticks); EXPECT_GT(one_percent_ticks, user_ticks + system_ticks); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static const char max_payload_tag[] = "TEST_max_payload_and_longish_tag_XXXX"; #define SIZEOF_MAX_PAYLOAD_BUF (LOGGER_ENTRY_MAX_PAYLOAD - \ sizeof(max_payload_tag) - 1) #endif static const char max_payload_buf[] = "LEONATO\n\ I learn in this letter that Don Peter of Arragon\n\ comes this night to Messina\n\ Loading Loading @@ -1056,6 +1115,7 @@ when you depart from me, sorrow abides and happiness\n\ takes his leave."; TEST(liblog, max_payload) { #ifdef __ANDROID__ pid_t pid = getpid(); char tag[sizeof(max_payload_tag)]; memcpy(tag, max_payload_tag, sizeof(tag)); Loading Loading @@ -1113,9 +1173,13 @@ TEST(liblog, max_payload) { EXPECT_EQ(true, matches); EXPECT_LE(SIZEOF_MAX_PAYLOAD_BUF, static_cast<size_t>(max_len)); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_buf_print__maxtag) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -1169,9 +1233,13 @@ TEST(liblog, __android_log_buf_print__maxtag) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, too_big_payload) { #ifdef __ANDROID__ pid_t pid = getpid(); static const char big_payload_tag[] = "TEST_big_payload_XXXX"; char tag[sizeof(big_payload_tag)]; Loading Loading @@ -1226,9 +1294,13 @@ TEST(liblog, too_big_payload) { static_cast<size_t>(max_len)); EXPECT_EQ(ret, max_len + static_cast<ssize_t>(sizeof(big_payload_tag))); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, dual_reader) { #ifdef __ANDROID__ struct logger_list *logger_list1; // >25 messages due to liblog.__android_log_buf_print__concurrentXX above. Loading Loading @@ -1273,9 +1345,13 @@ TEST(liblog, dual_reader) { EXPECT_EQ(25, count1); EXPECT_EQ(15, count2); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_logger_get_) { #ifdef __ANDROID__ struct logger_list * logger_list = android_logger_list_alloc(ANDROID_LOG_WRONLY, 0, 0); for(int i = LOG_ID_MIN; i < LOG_ID_MAX; ++i) { Loading Loading @@ -1307,14 +1383,20 @@ TEST(liblog, android_logger_get_) { } android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static bool checkPriForTag(AndroidLogFormat *p_format, const char *tag, android_LogPriority pri) { return android_log_shouldPrintLine(p_format, tag, pri) && !android_log_shouldPrintLine(p_format, tag, (android_LogPriority)(pri - 1)); } #endif TEST(liblog, filterRule) { #ifdef __ANDROID__ static const char tag[] = "random"; AndroidLogFormat *p_format = android_log_format_new(); Loading Loading @@ -1376,9 +1458,13 @@ TEST(liblog, filterRule) { #endif android_log_format_free(p_format); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, is_loggable) { #ifdef __ANDROID__ static const char tag[] = "is_loggable"; static const char log_namespace[] = "persist.log.tag."; static const size_t base_offset = 8; /* skip "persist." */ Loading Loading @@ -1671,9 +1757,13 @@ TEST(liblog, is_loggable) { key[sizeof(log_namespace) - 2] = '\0'; property_set(key, hold[2]); property_set(key + base_offset, hold[3]); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__typical) { #ifdef __ANDROID__ const int TAG = 123456781; const char SUBTAG[] = "test-subtag"; const int UID = -1; Loading Loading @@ -1755,9 +1845,13 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__typical) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__data_too_large) { #ifdef __ANDROID__ const int TAG = 123456782; const char SUBTAG[] = "test-subtag"; const int UID = -1; Loading Loading @@ -1846,9 +1940,13 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__data_too_l EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__null_data) { #ifdef __ANDROID__ const int TAG = 123456783; const char SUBTAG[] = "test-subtag"; const int UID = -1; Loading Loading @@ -1892,9 +1990,13 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__null_data) EXPECT_EQ(0, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__subtag_too_long) { #ifdef __ANDROID__ const int TAG = 123456784; const char SUBTAG[] = "abcdefghijklmnopqrstuvwxyz now i know my abc"; const int UID = -1; Loading Loading @@ -1977,6 +2079,9 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__subtag_too EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_bswrite_and_print___max) { Loading @@ -1988,6 +2093,7 @@ TEST(liblog, __android_log_buf_write_and_print__max) { } TEST(liblog, android_errorWriteLog__android_logger_list_read__success) { #ifdef __ANDROID__ const int TAG = 123456785; const char SUBTAG[] = "test-subtag"; struct logger_list *logger_list; Loading Loading @@ -2046,9 +2152,13 @@ TEST(liblog, android_errorWriteLog__android_logger_list_read__success) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteLog__android_logger_list_read__null_subtag) { #ifdef __ANDROID__ const int TAG = 123456786; struct logger_list *logger_list; Loading Loading @@ -2088,8 +2198,12 @@ TEST(liblog, android_errorWriteLog__android_logger_list_read__null_subtag) { EXPECT_EQ(0, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static int is_real_element(int type) { return ((type == EVENT_TYPE_INT) || (type == EVENT_TYPE_LONG) || Loading Loading @@ -2583,48 +2697,90 @@ static void create_android_logger(const char *(*fn)(uint32_t tag, size_t &expect android_logger_list_close(logger_list); } #endif TEST(liblog, create_android_logger_int32) { #ifdef __ANDROID__ create_android_logger(event_test_int32); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_int64) { #ifdef __ANDROID__ create_android_logger(event_test_int64); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_list_int64) { #ifdef __ANDROID__ create_android_logger(event_test_list_int64); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_simple_automagic_list) { #ifdef __ANDROID__ create_android_logger(event_test_simple_automagic_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_list_empty) { #ifdef __ANDROID__ create_android_logger(event_test_list_empty); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_complex_nested_list) { #ifdef __ANDROID__ create_android_logger(event_test_complex_nested_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_7_level_prefix) { #ifdef __ANDROID__ create_android_logger(event_test_7_level_prefix); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_7_level_suffix) { #ifdef __ANDROID__ create_android_logger(event_test_7_level_suffix); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_android_log_error_write) { #ifdef __ANDROID__ create_android_logger(event_test_android_log_error_write); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_android_log_error_write_null) { #ifdef __ANDROID__ create_android_logger(event_test_android_log_error_write_null); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_overflow) { #ifdef __ANDROID__ android_log_context ctx; EXPECT_TRUE(NULL != (ctx = create_android_logger(1005))); Loading @@ -2649,9 +2805,13 @@ TEST(liblog, create_android_logger_overflow) { EXPECT_GT(0, android_log_write_list_begin(ctx)); EXPECT_LE(0, android_log_destroy(&ctx)); ASSERT_TRUE(NULL == ctx); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_log_write_list_buffer) { #ifdef __ANDROID__ __android_log_event_list ctx(1005); ctx << 1005 << "tag_def" << "(tag|1),(name|3),(format|3)"; std::string buffer(ctx); Loading @@ -2662,12 +2822,18 @@ TEST(liblog, android_log_write_list_buffer) { EXPECT_EQ(android_log_buffer_to_string(buffer.data(), buffer.length(), msgBuf, sizeof(msgBuf)), 0); EXPECT_STREQ(msgBuf, "[1005,tag_def,(tag|1),(name|3),(format|3)]"); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static const char __pmsg_file[] = "/data/william-shakespeare/MuchAdoAboutNothing.txt"; #endif TEST(liblog, __android_log_pmsg_file_write) { #ifdef __ANDROID__ __android_log_close(); bool pmsgActiveAfter__android_log_close = isPmsgActive(); bool logdwActiveAfter__android_log_close = isLogdwActive(); Loading Loading @@ -2704,8 +2870,12 @@ TEST(liblog, __android_log_pmsg_file_write) { logdwActiveAfter__android_pmsg_file_write = isLogdwActive(); EXPECT_TRUE(pmsgActiveAfter__android_pmsg_file_write); EXPECT_TRUE(logdwActiveAfter__android_pmsg_file_write); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ ssize_t __pmsg_fn(log_id_t logId, char prio, const char *filename, const char *buf, size_t len, void *arg) { EXPECT_TRUE(NULL == arg); Loading @@ -2727,8 +2897,10 @@ ssize_t __pmsg_fn(log_id_t logId, char prio, const char *filename, (len != sizeof(max_payload_buf)) || !!strcmp(max_payload_buf, buf) ? -ENOEXEC : 1; } #endif TEST(liblog, __android_log_pmsg_file_read) { #ifdef __ANDROID__ signaled = 0; __android_log_close(); Loading Loading @@ -2756,8 +2928,12 @@ TEST(liblog, __android_log_pmsg_file_read) { EXPECT_LT(0, ret); EXPECT_EQ(1U, signaled); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ // meant to be handed to ASSERT_TRUE / EXPECT_TRUE only to expand the message static testing::AssertionResult IsOk(bool ok, std::string &message) { return ok ? Loading Loading @@ -2821,8 +2997,10 @@ static void event_log_tags_test_smap(pid_t pid) { EXPECT_TRUE(IsOk(shared_ok, content)); EXPECT_TRUE(IsOk(anonymous_ok, content)); } #endif TEST(liblog, event_log_tags) { #ifdef __ANDROID__ std::unique_ptr<DIR, int(*)(DIR*)> proc_dir(opendir("/proc"), closedir); ASSERT_FALSE(!proc_dir); Loading @@ -2836,4 +3014,7 @@ TEST(liblog, event_log_tags) { if (id != pid) continue; event_log_tags_test_smap(pid); } #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } Loading
liblog/tests/Android.mk +35 −0 Original line number Diff line number Diff line Loading @@ -74,3 +74,38 @@ LOCAL_CFLAGS += $(test_c_flags) LOCAL_SHARED_LIBRARIES := liblog libcutils libbase LOCAL_SRC_FILES := $(test_src_files) include $(BUILD_NATIVE_TEST) cts_executable := CtsLiblogTestCases include $(CLEAR_VARS) LOCAL_MODULE := $(cts_executable) LOCAL_MODULE_TAGS := tests LOCAL_CFLAGS += $(test_c_flags) LOCAL_SRC_FILES := $(test_src_files) LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest LOCAL_MULTILIB := both LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 LOCAL_SHARED_LIBRARIES := liblog libcutils libbase LOCAL_STATIC_LIBRARIES := libgtest libgtest_main LOCAL_COMPATIBILITY_SUITE := cts LOCAL_CTS_TEST_PACKAGE := android.core.liblog include $(BUILD_CTS_EXECUTABLE) ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64)) include $(CLEAR_VARS) LOCAL_MODULE := $(cts_executable)_list LOCAL_MODULE_TAGS := optional LOCAL_CFLAGS := $(test_c_flags) -DHOST LOCAL_C_INCLUDES := external/gtest/include LOCAL_SRC_FILES := $(test_src_files) LOCAL_MULTILIB := both LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE) LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 LOCAL_CXX_STL := libc++ LOCAL_SHARED_LIBRARIES := liblog libcutils libbase LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk include $(BUILD_HOST_NATIVE_TEST) endif # ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
liblog/tests/AndroidTest.xml 0 → 100644 +27 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <configuration description="Config for CTS Logging Library test cases"> <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher"> <option name="cleanup" value="true" /> <option name="push" value="CtsLiblogTestCases->/data/local/tmp/CtsLiblogTestCases" /> <option name="append-bitness" value="true" /> </target_preparer> <test class="com.android.tradefed.testtype.GTest" > <option name="native-test-device-path" value="/data/local/tmp" /> <option name="module-name" value="CtsLiblogTestCases" /> <option name="runtime-hint" value="65s" /> </test> </configuration>
liblog/tests/libc_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <stdio.h> TEST(libc, __pstore_append) { #ifdef __ANDROID__ FILE *fp; ASSERT_TRUE(NULL != (fp = fopen("/dev/pmsg0", "a"))); static const char message[] = "libc.__pstore_append\n"; Loading @@ -42,4 +43,7 @@ TEST(libc, __pstore_append) { "Reboot, ensure string libc.__pstore_append is in /sys/fs/pstore/pmsg-ramoops-0\n" ); } #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif }
liblog/tests/liblog_test.cpp +182 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,9 @@ #include <android-base/file.h> #include <android-base/stringprintf.h> #ifdef __ANDROID__ // includes sys/properties.h which does not exist outside #include <cutils/properties.h> #endif #include <gtest/gtest.h> #include <log/logprint.h> #include <log/log_event_list.h> Loading @@ -53,6 +55,7 @@ _rc; }) TEST(liblog, __android_log_buf_print) { #ifdef __ANDROID__ EXPECT_LT(0, __android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, "TEST__android_log_buf_print", "radio")); Loading @@ -65,9 +68,13 @@ TEST(liblog, __android_log_buf_print) { "TEST__android_log_buf_print", "main")); usleep(1000); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_buf_write) { #ifdef __ANDROID__ EXPECT_LT(0, __android_log_buf_write(LOG_ID_RADIO, ANDROID_LOG_INFO, "TEST__android_log_buf_write", "radio")); Loading @@ -80,9 +87,13 @@ TEST(liblog, __android_log_buf_write) { "TEST__android_log_buf_write", "main")); usleep(1000); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_btwrite) { #ifdef __ANDROID__ int intBuf = 0xDEADBEEF; EXPECT_LT(0, __android_log_btwrite(0, EVENT_TYPE_INT, Loading @@ -97,20 +108,26 @@ TEST(liblog, __android_log_btwrite) { EVENT_TYPE_STRING, Buf, sizeof(Buf) - 1)); usleep(1000); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static void* ConcurrentPrintFn(void *arg) { int ret = __android_log_buf_print(LOG_ID_MAIN, ANDROID_LOG_INFO, "TEST__android_log_print", "Concurrent %" PRIuPTR, reinterpret_cast<uintptr_t>(arg)); return reinterpret_cast<void*>(ret); } #endif #define NUM_CONCURRENT 64 #define _concurrent_name(a,n) a##__concurrent##n #define concurrent_name(a,n) _concurrent_name(a,n) TEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) { #ifdef __ANDROID__ pthread_t t[NUM_CONCURRENT]; int i; for (i=0; i < NUM_CONCURRENT; i++) { Loading @@ -128,8 +145,12 @@ TEST(liblog, concurrent_name(__android_log_buf_print, NUM_CONCURRENT)) { } } ASSERT_LT(0, ret); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ std::string popenToString(std::string command) { std::string ret; Loading Loading @@ -193,8 +214,10 @@ static bool isLogdwActive() { } return false; } #endif TEST(liblog, __android_log_btwrite__android_logger_list_read) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -257,14 +280,20 @@ TEST(liblog, __android_log_btwrite__android_logger_list_read) { EXPECT_EQ(1, second_count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static inline int32_t get4LE(const char* src) { return src[0] | (src[1] << 8) | (src[2] << 16) | (src[3] << 24); } #endif static void bswrite_test(const char *message) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -347,6 +376,10 @@ static void bswrite_test(const char *message) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else message = NULL; GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_bswrite_and_print) { Loading @@ -370,6 +403,7 @@ TEST(liblog, __android_log_bswrite_and_print__multiple_newline) { } static void buf_write_test(const char *message) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -436,6 +470,10 @@ static void buf_write_test(const char *message) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else message = NULL; GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_buf_write_and_print__empty) { Loading @@ -451,6 +489,7 @@ TEST(liblog, __android_log_buf_write_and_print__newline_space_prefix) { } TEST(liblog, __security) { #ifdef __ANDROID__ static const char persist_key[] = "persist.logd.security"; static const char readonly_key[] = "ro.device_owner"; static const char nothing_val[] = "_NOTHING_TO_SEE_HERE_"; Loading Loading @@ -485,9 +524,13 @@ TEST(liblog, __security) { property_set(persist_key, ""); EXPECT_FALSE(__android_log_security()); property_set(persist_key, persist); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __security_buffer) { #ifdef __ANDROID__ struct logger_list *logger_list; android_event_long_t buffer; Loading Loading @@ -621,9 +664,12 @@ TEST(liblog, __security_buffer) { "not system, content submitted but can not check end-to-end\n"); } EXPECT_EQ(clientHasSecurityCredentials ? 1 : 0, count); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static unsigned signaled; static log_time signal_time; Loading Loading @@ -682,8 +728,10 @@ static void get_ticks(unsigned long long *uticks, unsigned long long *sticks) *uticks = *sticks = 0; } } #endif TEST(liblog, android_logger_list_read__cpu_signal) { #ifdef __ANDROID__ struct logger_list *logger_list; unsigned long long v = 0xDEADBEEFA55A0000ULL; Loading Loading @@ -768,8 +816,12 @@ TEST(liblog, android_logger_list_read__cpu_signal) { EXPECT_GT(one_percent_ticks, user_ticks); EXPECT_GT(one_percent_ticks, system_ticks); EXPECT_GT(one_percent_ticks, user_ticks + system_ticks); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ /* * Strictly, we are not allowed to log messages in a signal context, the * correct way to handle this is to ensure the messages are constructed in Loading Loading @@ -832,8 +884,10 @@ int start_thread() pthread_attr_destroy(&attr); return 0; } #endif TEST(liblog, android_logger_list_read__cpu_thread) { #ifdef __ANDROID__ struct logger_list *logger_list; unsigned long long v = 0xDEADBEAFA55A0000ULL; Loading Loading @@ -919,11 +973,16 @@ TEST(liblog, android_logger_list_read__cpu_thread) { EXPECT_GT(one_percent_ticks, user_ticks); EXPECT_GT(one_percent_ticks, system_ticks); EXPECT_GT(one_percent_ticks, user_ticks + system_ticks); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static const char max_payload_tag[] = "TEST_max_payload_and_longish_tag_XXXX"; #define SIZEOF_MAX_PAYLOAD_BUF (LOGGER_ENTRY_MAX_PAYLOAD - \ sizeof(max_payload_tag) - 1) #endif static const char max_payload_buf[] = "LEONATO\n\ I learn in this letter that Don Peter of Arragon\n\ comes this night to Messina\n\ Loading Loading @@ -1056,6 +1115,7 @@ when you depart from me, sorrow abides and happiness\n\ takes his leave."; TEST(liblog, max_payload) { #ifdef __ANDROID__ pid_t pid = getpid(); char tag[sizeof(max_payload_tag)]; memcpy(tag, max_payload_tag, sizeof(tag)); Loading Loading @@ -1113,9 +1173,13 @@ TEST(liblog, max_payload) { EXPECT_EQ(true, matches); EXPECT_LE(SIZEOF_MAX_PAYLOAD_BUF, static_cast<size_t>(max_len)); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_buf_print__maxtag) { #ifdef __ANDROID__ struct logger_list *logger_list; pid_t pid = getpid(); Loading Loading @@ -1169,9 +1233,13 @@ TEST(liblog, __android_log_buf_print__maxtag) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, too_big_payload) { #ifdef __ANDROID__ pid_t pid = getpid(); static const char big_payload_tag[] = "TEST_big_payload_XXXX"; char tag[sizeof(big_payload_tag)]; Loading Loading @@ -1226,9 +1294,13 @@ TEST(liblog, too_big_payload) { static_cast<size_t>(max_len)); EXPECT_EQ(ret, max_len + static_cast<ssize_t>(sizeof(big_payload_tag))); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, dual_reader) { #ifdef __ANDROID__ struct logger_list *logger_list1; // >25 messages due to liblog.__android_log_buf_print__concurrentXX above. Loading Loading @@ -1273,9 +1345,13 @@ TEST(liblog, dual_reader) { EXPECT_EQ(25, count1); EXPECT_EQ(15, count2); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_logger_get_) { #ifdef __ANDROID__ struct logger_list * logger_list = android_logger_list_alloc(ANDROID_LOG_WRONLY, 0, 0); for(int i = LOG_ID_MIN; i < LOG_ID_MAX; ++i) { Loading Loading @@ -1307,14 +1383,20 @@ TEST(liblog, android_logger_get_) { } android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static bool checkPriForTag(AndroidLogFormat *p_format, const char *tag, android_LogPriority pri) { return android_log_shouldPrintLine(p_format, tag, pri) && !android_log_shouldPrintLine(p_format, tag, (android_LogPriority)(pri - 1)); } #endif TEST(liblog, filterRule) { #ifdef __ANDROID__ static const char tag[] = "random"; AndroidLogFormat *p_format = android_log_format_new(); Loading Loading @@ -1376,9 +1458,13 @@ TEST(liblog, filterRule) { #endif android_log_format_free(p_format); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, is_loggable) { #ifdef __ANDROID__ static const char tag[] = "is_loggable"; static const char log_namespace[] = "persist.log.tag."; static const size_t base_offset = 8; /* skip "persist." */ Loading Loading @@ -1671,9 +1757,13 @@ TEST(liblog, is_loggable) { key[sizeof(log_namespace) - 2] = '\0'; property_set(key, hold[2]); property_set(key + base_offset, hold[3]); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__typical) { #ifdef __ANDROID__ const int TAG = 123456781; const char SUBTAG[] = "test-subtag"; const int UID = -1; Loading Loading @@ -1755,9 +1845,13 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__typical) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__data_too_large) { #ifdef __ANDROID__ const int TAG = 123456782; const char SUBTAG[] = "test-subtag"; const int UID = -1; Loading Loading @@ -1846,9 +1940,13 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__data_too_l EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__null_data) { #ifdef __ANDROID__ const int TAG = 123456783; const char SUBTAG[] = "test-subtag"; const int UID = -1; Loading Loading @@ -1892,9 +1990,13 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__null_data) EXPECT_EQ(0, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__subtag_too_long) { #ifdef __ANDROID__ const int TAG = 123456784; const char SUBTAG[] = "abcdefghijklmnopqrstuvwxyz now i know my abc"; const int UID = -1; Loading Loading @@ -1977,6 +2079,9 @@ TEST(liblog, android_errorWriteWithInfoLog__android_logger_list_read__subtag_too EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, __android_log_bswrite_and_print___max) { Loading @@ -1988,6 +2093,7 @@ TEST(liblog, __android_log_buf_write_and_print__max) { } TEST(liblog, android_errorWriteLog__android_logger_list_read__success) { #ifdef __ANDROID__ const int TAG = 123456785; const char SUBTAG[] = "test-subtag"; struct logger_list *logger_list; Loading Loading @@ -2046,9 +2152,13 @@ TEST(liblog, android_errorWriteLog__android_logger_list_read__success) { EXPECT_EQ(1, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_errorWriteLog__android_logger_list_read__null_subtag) { #ifdef __ANDROID__ const int TAG = 123456786; struct logger_list *logger_list; Loading Loading @@ -2088,8 +2198,12 @@ TEST(liblog, android_errorWriteLog__android_logger_list_read__null_subtag) { EXPECT_EQ(0, count); android_logger_list_close(logger_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static int is_real_element(int type) { return ((type == EVENT_TYPE_INT) || (type == EVENT_TYPE_LONG) || Loading Loading @@ -2583,48 +2697,90 @@ static void create_android_logger(const char *(*fn)(uint32_t tag, size_t &expect android_logger_list_close(logger_list); } #endif TEST(liblog, create_android_logger_int32) { #ifdef __ANDROID__ create_android_logger(event_test_int32); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_int64) { #ifdef __ANDROID__ create_android_logger(event_test_int64); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_list_int64) { #ifdef __ANDROID__ create_android_logger(event_test_list_int64); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_simple_automagic_list) { #ifdef __ANDROID__ create_android_logger(event_test_simple_automagic_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_list_empty) { #ifdef __ANDROID__ create_android_logger(event_test_list_empty); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_complex_nested_list) { #ifdef __ANDROID__ create_android_logger(event_test_complex_nested_list); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_7_level_prefix) { #ifdef __ANDROID__ create_android_logger(event_test_7_level_prefix); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_7_level_suffix) { #ifdef __ANDROID__ create_android_logger(event_test_7_level_suffix); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_android_log_error_write) { #ifdef __ANDROID__ create_android_logger(event_test_android_log_error_write); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_android_log_error_write_null) { #ifdef __ANDROID__ create_android_logger(event_test_android_log_error_write_null); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, create_android_logger_overflow) { #ifdef __ANDROID__ android_log_context ctx; EXPECT_TRUE(NULL != (ctx = create_android_logger(1005))); Loading @@ -2649,9 +2805,13 @@ TEST(liblog, create_android_logger_overflow) { EXPECT_GT(0, android_log_write_list_begin(ctx)); EXPECT_LE(0, android_log_destroy(&ctx)); ASSERT_TRUE(NULL == ctx); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } TEST(liblog, android_log_write_list_buffer) { #ifdef __ANDROID__ __android_log_event_list ctx(1005); ctx << 1005 << "tag_def" << "(tag|1),(name|3),(format|3)"; std::string buffer(ctx); Loading @@ -2662,12 +2822,18 @@ TEST(liblog, android_log_write_list_buffer) { EXPECT_EQ(android_log_buffer_to_string(buffer.data(), buffer.length(), msgBuf, sizeof(msgBuf)), 0); EXPECT_STREQ(msgBuf, "[1005,tag_def,(tag|1),(name|3),(format|3)]"); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ static const char __pmsg_file[] = "/data/william-shakespeare/MuchAdoAboutNothing.txt"; #endif TEST(liblog, __android_log_pmsg_file_write) { #ifdef __ANDROID__ __android_log_close(); bool pmsgActiveAfter__android_log_close = isPmsgActive(); bool logdwActiveAfter__android_log_close = isLogdwActive(); Loading Loading @@ -2704,8 +2870,12 @@ TEST(liblog, __android_log_pmsg_file_write) { logdwActiveAfter__android_pmsg_file_write = isLogdwActive(); EXPECT_TRUE(pmsgActiveAfter__android_pmsg_file_write); EXPECT_TRUE(logdwActiveAfter__android_pmsg_file_write); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ ssize_t __pmsg_fn(log_id_t logId, char prio, const char *filename, const char *buf, size_t len, void *arg) { EXPECT_TRUE(NULL == arg); Loading @@ -2727,8 +2897,10 @@ ssize_t __pmsg_fn(log_id_t logId, char prio, const char *filename, (len != sizeof(max_payload_buf)) || !!strcmp(max_payload_buf, buf) ? -ENOEXEC : 1; } #endif TEST(liblog, __android_log_pmsg_file_read) { #ifdef __ANDROID__ signaled = 0; __android_log_close(); Loading Loading @@ -2756,8 +2928,12 @@ TEST(liblog, __android_log_pmsg_file_read) { EXPECT_LT(0, ret); EXPECT_EQ(1U, signaled); #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif } #ifdef __ANDROID__ // meant to be handed to ASSERT_TRUE / EXPECT_TRUE only to expand the message static testing::AssertionResult IsOk(bool ok, std::string &message) { return ok ? Loading Loading @@ -2821,8 +2997,10 @@ static void event_log_tags_test_smap(pid_t pid) { EXPECT_TRUE(IsOk(shared_ok, content)); EXPECT_TRUE(IsOk(anonymous_ok, content)); } #endif TEST(liblog, event_log_tags) { #ifdef __ANDROID__ std::unique_ptr<DIR, int(*)(DIR*)> proc_dir(opendir("/proc"), closedir); ASSERT_FALSE(!proc_dir); Loading @@ -2836,4 +3014,7 @@ TEST(liblog, event_log_tags) { if (id != pid) continue; event_log_tags_test_smap(pid); } #else GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif }