summaryrefslogtreecommitdiffstats
path: root/tests/unit/sysutil_test.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Implement FuseBlockDataProviderxunchang2019-05-011-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
* Move out the code to parse block map in MemMapxunchang2019-03-261-0/+61
| | | | | | | We will reuse them to implement the fuse provider from block maps. Test: unit tests pass, sideload an OTA Change-Id: Iaa409d19569c4ccc0bb24e12518044fcddb45c69
* switch to using android-base/file.h instead of android-base/test_utils.hMark Salyzyn2018-11-151-1/+0
| | | | | | Test: compile Bug: 119313545 Change-Id: I664fb32522d01909c603d7b903475c4e9aea9223
* Fix the arguments passed to getopt_long(3).Tao Bao2018-07-171-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
* otautil: Rename dir/sys/thermal utils.Tao Bao2018-05-041-3/+2
| | | | | Test: mmma -j bootable/recovery Change-Id: I32ab98549e91f993364306e4a88dc654221b3869
* Move sysMapFile and sysReleaseMap into MemMapping class.Tao Bao2017-05-021-35/+25
| | | | | | | Test: recovery_component_test Test: recovery_unit_test Test: Apply an OTA on angler. Change-Id: I7170f03e4ce1fe06184ca1d7bcce0a695f33ac4d
* otautil: Clean up SysUtil.cpp.Tao Bao2016-11-071-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