Add tests for imgdiff.

Factor out libimgdiff static library for testing purpose.

This CL adds the imgdiff tests on host and on target both (similar to
libimgpatch). In practice, we only need imgdiff binary on host, and
libimgpatch on target. But they should build and pass tests on both
platforms.

Test: recovery_host_test passes; recovery_component_test passes.
Change-Id: I0eafb7faf727cdf70066310e845af6ee245d4f60
This commit is contained in:
Tao Bao
2016-12-15 10:15:06 -08:00
parent e81719dde3
commit 97555da4a6
8 changed files with 813 additions and 267 deletions
+6 -4
View File
@@ -14,13 +14,15 @@
* limitations under the License.
*/
#ifndef _IMGPATCH_H
#define _IMGPATCH_H
#ifndef _APPLYPATCH_IMGPATCH_H
#define _APPLYPATCH_IMGPATCH_H
typedef ssize_t (*SinkFn)(const unsigned char*, ssize_t, void*);
#include <sys/types.h>
using SinkFn = ssize_t (*)(const unsigned char*, ssize_t, void*);
int ApplyImagePatch(const unsigned char* old_data, ssize_t old_size,
const unsigned char* patch_data, ssize_t patch_size,
SinkFn sink, void* token);
#endif //_IMGPATCH_H
#endif // _APPLYPATCH_IMGPATCH_H