Linux C++ test & render tests on CI (#1033)

Co-authored-by: rpitre-wetdog <129877142+rpitre-wetdog@users.noreply.github.com>
Co-authored-by: Tadej Novak <tadej@tano.si>
Co-authored-by: Robin <boldtrn@users.noreply.github.com>
Co-authored-by: Siarhei Fedartsou <siarhei.fedartsou@gmail.com>
This commit is contained in:
Bart Louwers
2023-04-22 14:24:42 +02:00
committed by GitHub
parent 33791d5379
commit 453af362cb
14 changed files with 173 additions and 71 deletions

View File

@@ -357,6 +357,7 @@ size_t HTTPRequest::headerCallback(char *const buffer, const size_t size, const
baton->response = std::make_unique<Response>();
}
// NOLINTBEGIN(bugprone-assignment-in-if-condition)
const size_t length = size * nmemb;
size_t begin = std::string::npos;
if ((begin = headerMatches("last-modified: ", buffer, length)) != std::string::npos) {
@@ -379,6 +380,7 @@ size_t HTTPRequest::headerCallback(char *const buffer, const size_t size, const
} else if ((begin = headerMatches("x-rate-limit-reset: ", buffer, length)) != std::string::npos) {
baton->xRateLimitReset = std::string(buffer + begin, length - begin - 2); // remove \r\n
}
// NOLINTEND(bugprone-assignment-in-if-condition)
return length;
}

View File

@@ -27,7 +27,7 @@ static void init_source(j_decompress_ptr cinfo) {
static boolean fill_input_buffer(j_decompress_ptr cinfo) {
auto* wrap = reinterpret_cast<jpeg_stream_wrapper*>(cinfo->src);
wrap->stream->read(reinterpret_cast<char*>(&wrap->buffer[0]), BUF_SIZE);
wrap->stream->read(reinterpret_cast<char*>(wrap->buffer.data()), BUF_SIZE);
std::streamsize size = wrap->stream->gcount();
wrap->manager.next_input_byte = wrap->buffer.data();
wrap->manager.bytes_in_buffer = BUF_SIZE;