summaryrefslogtreecommitdiffstats
path: root/tests/unit/sysutil_test.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-05-01Implement FuseBlockDataProviderxunchang1-1/+1
Adds a fuse data provider that parses the metadata from a block map, reads the data from the given ranges of the block device; and provides the data to the fuse. Bug: 127071893 Test: unit tests pass, install a package from block map Change-Id: Ie9925ee9144e98642505b3f5e1a4a186d2b21ed0
2019-03-26Move out the code to parse block map in MemMapxunchang1-0/+61
We will reuse them to implement the fuse provider from block maps. Test: unit tests pass, sideload an OTA Change-Id: Iaa409d19569c4ccc0bb24e12518044fcddb45c69
2018-11-15switch to using android-base/file.h instead of android-base/test_utils.hMark Salyzyn1-1/+0
Test: compile Bug: 119313545 Change-Id: I664fb32522d01909c603d7b903475c4e9aea9223
2018-07-17Fix the arguments passed to getopt_long(3).Tao Bao1-0/+10
The getopt_long(3) implementation in Android (upstream freebsd) expects a null-terminated array while parsing long options with required args. if (long_options[match].has_arg == required_argument) { optarg = nargv[optind++]; } ... if (long_options[match].has_arg == required_argument && optarg == NULL) { return (BADARG); } This seems to make sense in practice, as getopt(3) takes the first two arguments of argc and argv that are "as passed to the main() function on program invocation", and both of C and C++ spec say "the value of argv[argc] shall be 0". Prior to the CL, we may run into undefined behavior on malformed input command line (e.g. missing arg for an option that requires one). This CL fixes the issue by always appending a nullptr to the argument list (but without counting that into argc). Test: Build and boot into recovery with commands. Change-Id: Ic6c37548f4db2f30aeabd40f387ca916eeca5392
2018-05-04otautil: Rename dir/sys/thermal utils.Tao Bao1-3/+2
Test: mmma -j bootable/recovery Change-Id: I32ab98549e91f993364306e4a88dc654221b3869
2017-05-02Move sysMapFile and sysReleaseMap into MemMapping class.Tao Bao1-35/+25
Test: recovery_component_test Test: recovery_unit_test Test: Apply an OTA on angler. Change-Id: I7170f03e4ce1fe06184ca1d7bcce0a695f33ac4d
2016-11-08otautil: Clean up SysUtil.cpp.Tao Bao1-0/+140
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 (cherry picked from commit c3292f3fcbb3cd608cc19b7459751fa5bb64ab84)
2016-11-07otautil: Clean up SysUtil.cpp.Tao Bao1-0/+140
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