Blame


1 ac25a292 2018-01-26 stsp /*
2 ac25a292 2018-01-26 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 ac25a292 2018-01-26 stsp *
4 ac25a292 2018-01-26 stsp * Permission to use, copy, modify, and distribute this software for any
5 ac25a292 2018-01-26 stsp * purpose with or without fee is hereby granted, provided that the above
6 ac25a292 2018-01-26 stsp * copyright notice and this permission notice appear in all copies.
7 ac25a292 2018-01-26 stsp *
8 ac25a292 2018-01-26 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 ac25a292 2018-01-26 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 ac25a292 2018-01-26 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ac25a292 2018-01-26 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 ac25a292 2018-01-26 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ac25a292 2018-01-26 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 ac25a292 2018-01-26 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 ac25a292 2018-01-26 stsp */
16 ac25a292 2018-01-26 stsp
17 ac25a292 2018-01-26 stsp #include <sys/queue.h>
18 ac25a292 2018-01-26 stsp
19 ac25a292 2018-01-26 stsp #include <stdio.h>
20 ac25a292 2018-01-26 stsp #include <stdlib.h>
21 ac25a292 2018-01-26 stsp
22 ac25a292 2018-01-26 stsp #include "got_error.h"
23 ac25a292 2018-01-26 stsp
24 ac25a292 2018-01-26 stsp #include "delta.h"
25 ac25a292 2018-01-26 stsp
26 ac25a292 2018-01-26 stsp static int
27 ac25a292 2018-01-26 stsp delta_combine()
28 ac25a292 2018-01-26 stsp {
29 ac25a292 2018-01-26 stsp return 1;
30 ac25a292 2018-01-26 stsp }
31 ac25a292 2018-01-26 stsp
32 b08fe7be 2018-01-26 stsp #define RUN_TEST(expr, name) \
33 b08fe7be 2018-01-26 stsp { test_ok = (expr); \
34 b08fe7be 2018-01-26 stsp printf("test %s %s\n", (name), test_ok ? "ok" : "failed"); \
35 b08fe7be 2018-01-26 stsp failure = (failure || !test_ok); }
36 b08fe7be 2018-01-26 stsp
37 ac25a292 2018-01-26 stsp int
38 ac25a292 2018-01-26 stsp main(int argc, const char *argv[])
39 ac25a292 2018-01-26 stsp {
40 b08fe7be 2018-01-26 stsp int test_ok;
41 ac25a292 2018-01-26 stsp int failure = 0;
42 ac25a292 2018-01-26 stsp
43 ac25a292 2018-01-26 stsp if (argc != 1) {
44 ac25a292 2018-01-26 stsp fprintf(stderr, "usage: delta_test [REPO_PATH]\n");
45 ac25a292 2018-01-26 stsp return 1;
46 ac25a292 2018-01-26 stsp }
47 ac25a292 2018-01-26 stsp
48 ac25a292 2018-01-26 stsp RUN_TEST(delta_combine(), "delta_combine");
49 ac25a292 2018-01-26 stsp
50 ac25a292 2018-01-26 stsp return failure ? 1 : 0;
51 ac25a292 2018-01-26 stsp }