2 * This file is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2,
4 * as published by the Free Software Foundation.
6 * In addition to the permissions in the GNU General Public License,
7 * the authors give you unlimited permission to link the compiled
8 * version of this file into combinations with other programs,
9 * and to distribute those combinations without any restriction
10 * coming from the use of this file. (The General Public License
11 * restrictions do apply in other respects; for example, they cover
12 * modification of the file, and distribution when not linked into
13 * a combined executable.)
15 * This file is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; see the file COPYING. If not, write to
22 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
26 #ifndef INCLUDE_test_helpers_h__
27 #define INCLUDE_test_helpers_h__
33 typedef struct object_data
{
34 unsigned char *bytes
; /* (compressed) bytes stored in object store */
35 size_t blen
; /* length of data in object store */
36 char *id
; /* object id (sha1) */
37 char *type
; /* object type */
38 char *dir
; /* object store (fan-out) directory name */
39 char *file
; /* object store filename */
40 unsigned char *data
; /* (uncompressed) object data */
41 size_t dlen
; /* length of (uncompressed) object data */
44 extern int write_object_data(char *file
, void *data
, size_t len
);
46 extern int write_object_files(const char *odb_dir
, object_data
*d
);
48 extern int remove_object_files(const char *odb_dir
, object_data
*d
);
50 extern int cmp_objects(git_obj
*o
, object_data
*d
);
53 /* INCLUDE_test_helpers_h__ */