• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

saitoha / libsixel / 19934796867

04 Dec 2025 03:42PM UTC coverage: 43.522% (+2.3%) from 41.258%
19934796867

push

github

saitoha
python: update shared api.py

10714 of 38654 branches covered (27.72%)

14673 of 33714 relevant lines covered (43.52%)

2910517.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/tests.c
1
/*
2
 * SPDX-License-Identifier: MIT
3
 *
4
 * Copyright (c) 2025 libsixel developers. See `AUTHORS`.
5
 * Copyright (c) 2014-2016 Hayaki Saito
6
 *
7
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8
 * this software and associated documentation files (the "Software"), to deal in
9
 * the Software without restriction, including without limitation the rights to
10
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11
 * the Software, and to permit persons to whom the Software is furnished to do so,
12
 * subject to the following conditions:
13
 *
14
 * The above copyright notice and this permission notice shall be included in all
15
 * copies or substantial portions of the Software.
16
 *
17
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
 */
24

25
#include "config.h"
26

27
/* STDC_HEADERS */
28
#include <stdlib.h>
29
#include <stdio.h>
30

31
#if HAVE_STDRING_H
32
# include <string.h>
33
#endif  /* HAVE_STRING_H */
34
#if HAVE_MATH_H
35
# include <math.h>
36
#endif  /* HAVE_MATH_H */
37
#if HAVE_LIMITS_H
38
# include <limits.h>
39
#endif  /* HAVE_LIMITS_H */
40
#if HAVE_INTTYPES_H
41
# include <inttypes.h>
42
#endif  /* HAVE_INTTYPES_H */
43

44
#include <sixel.h>
45
#include "dither.h"
46
#include "palette.h"
47
#include "frame.h"
48
#include "pixelformat.h"
49
#include "writer.h"
50
#include "encoder.h"
51
#include "decoder.h"
52
#include "status.h"
53
#include "loader.h"
54
#include "fromgif.h"
55
#include "chunk.h"
56
#include "allocator.h"
57
#include "scale.h"
58

59
#if HAVE_TESTS
60

61
int sixel_tosixel_tests_main(void);
62

63
#endif
64

65
#if HAVE_TESTS
66

67
int
68
main(int argc, char *argv[])
×
69
{
70
    int nret = EXIT_FAILURE;
×
71
    int dirty = 0;
×
72

73
    (void) argc;
×
74
    (void) argv;
×
75

76
    nret = sixel_fromgif_tests_main();
×
77
    if (nret != EXIT_SUCCESS) {
×
78
        puts("fromgif ng.");
×
79
        dirty = 1;
×
80
    } else {
81
        puts("fromgif ok.");
×
82
    }
83

84
    nret = sixel_loader_tests_main();
×
85
    if (nret != EXIT_SUCCESS) {
×
86
        puts("loader ng.");
×
87
        dirty = 1;
×
88
    } else {
89
        puts("loader ok.");
×
90
    }
91

92
    nret = sixel_dither_tests_main();
×
93
    if (nret != EXIT_SUCCESS) {
×
94
        puts("dither ng.");
×
95
        dirty = 1;
×
96
    } else {
97
        puts("dither ok.");
×
98
    }
99

100
    nret = sixel_pixelformat_tests_main();
×
101
    if (nret != EXIT_SUCCESS) {
×
102
        puts("pixelformat ng.");
×
103
        dirty = 1;
×
104
    } else {
105
        puts("pixelformat ok.");
×
106
    }
107

108
    nret = sixel_frame_tests_main();
×
109
    if (nret != EXIT_SUCCESS) {
×
110
        puts("frame ng.");
×
111
        dirty = 1;
×
112
    } else {
113
        puts("frame ok.");
×
114
    }
115

116
    nret = sixel_writer_tests_main();
×
117
    if (nret != EXIT_SUCCESS) {
×
118
        puts("writer ng.");
×
119
        dirty = 1;
×
120
    } else {
121
        puts("writer ok.");
×
122
    }
123

124
    nret = sixel_palette_tests_main();
×
125
    if (nret != EXIT_SUCCESS) {
×
126
        puts("quant ng.");
×
127
        dirty = 1;
×
128
    } else {
129
        puts("quant ok.");
×
130
    }
131

132
    nret = sixel_tosixel_tests_main();
×
133
    if (nret != EXIT_SUCCESS) {
×
134
        puts("tosixel ng.");
×
135
        dirty = 1;
×
136
    } else {
137
        puts("tosixel ok.");
×
138
    }
139

140
    nret = sixel_encoder_tests_main();
×
141
    if (nret != EXIT_SUCCESS) {
×
142
        puts("encoder ng.");
×
143
        dirty = 1;
×
144
    } else {
145
        puts("encoder ok.");
×
146
    }
147

148
    nret = sixel_decoder_tests_main();
×
149
    if (nret != EXIT_SUCCESS) {
×
150
        puts("decoder ng.");
×
151
        dirty = 1;
×
152
    } else {
153
        puts("decoder ok.");
×
154
    }
155

156
    nret = sixel_status_tests_main();
×
157
    if (nret != EXIT_SUCCESS) {
×
158
        puts("status ng.");
×
159
        dirty = 1;
×
160
    } else {
161
        puts("status ok.");
×
162
    }
163

164
    nret = sixel_chunk_tests_main();
×
165
    if (nret != EXIT_SUCCESS) {
×
166
        puts("chunk ng.");
×
167
        dirty = 1;
×
168
    } else {
169
        puts("chunk ok.");
×
170
    }
171

172
    nret = sixel_allocator_tests_main();
×
173
    if (nret != EXIT_SUCCESS) {
×
174
        puts("allocator ng.");
×
175
        dirty = 1;
×
176
    } else {
177
        puts("allocator ok.");
×
178
    }
179

180
    nret = sixel_scale_tests_main();
×
181
    if (nret != EXIT_SUCCESS) {
×
182
        puts("scale ng.");
×
183
        dirty = 1;
×
184
    } else {
185
        puts("scale ok.");
×
186
    }
187

188
    fflush(stdout);
×
189

190
    if (dirty) {
×
191
        return (127);
×
192
    }
193
    return (0);
194
}
195

196
#endif
197

198
/* emacs Local Variables:      */
199
/* emacs mode: c               */
200
/* emacs tab-width: 4          */
201
/* emacs indent-tabs-mode: nil */
202
/* emacs c-basic-offset: 4     */
203
/* emacs End:                  */
204
/* vim: set expandtab ts=4 sts=4 sw=4 : */
205
/* EOF */
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc