otautil: Clean up SysUtil.cpp.

Add unit testcases for sysMapFile().

Test: recovery_unit_test passes.
Test: Build and use the new recovery image to sideload a package.
Test: Build and use the new recovery image to install an update.

Change-Id: I77d8f1ea151ab513865d992c256ba93a1fcb51a4
This commit is contained in:
Tao Bao
2016-11-04 10:52:13 -07:00
parent ba41fba9e4
commit c3292f3fcb
4 changed files with 343 additions and 194 deletions
+7 -6
View File
@@ -18,7 +18,6 @@ LOCAL_PATH := $(call my-dir)
# Unit tests
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_CFLAGS := -Werror
LOCAL_MODULE := recovery_unit_test
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
@@ -32,17 +31,19 @@ LOCAL_STATIC_LIBRARIES := \
libselinux \
libbase
LOCAL_SRC_FILES := unit/asn1_decoder_test.cpp
LOCAL_SRC_FILES += unit/recovery_test.cpp
LOCAL_SRC_FILES += unit/locale_test.cpp
LOCAL_SRC_FILES += unit/zip_test.cpp
LOCAL_SRC_FILES := \
unit/asn1_decoder_test.cpp \
unit/locale_test.cpp \
unit/recovery_test.cpp \
unit/sysutil_test.cpp \
unit/zip_test.cpp
LOCAL_C_INCLUDES := bootable/recovery
LOCAL_SHARED_LIBRARIES := liblog
include $(BUILD_NATIVE_TEST)
# Component tests
include $(CLEAR_VARS)
LOCAL_CLANG := true
LOCAL_CFLAGS := -Werror
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := recovery_component_test