File: apply.c

package info (click to toggle)
libgit2 0.27.7%2Bdfsg.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 31,400 kB
  • sloc: ansic: 157,824; sh: 406; python: 182; php: 65; makefile: 61
file content (21 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "clar_libgit2.h"

#include "delta.h"

void test_delta_apply__read_at_off(void)
{
	unsigned char base[16] = { 0 }, delta[] = { 0x10, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00 };
	void *out;
	size_t outlen;

	cl_git_fail(git_delta_apply(&out, &outlen, base, sizeof(base), delta, sizeof(delta)));
}

void test_delta_apply__read_after_limit(void)
{
	unsigned char base[16] = { 0 }, delta[] = { 0x10, 0x70, 0xff };
	void *out;
	size_t outlen;

	cl_git_fail(git_delta_apply(&out, &outlen, base, sizeof(base), delta, sizeof(delta)));
}