Overpass API regression suite coverage (Nova Scotia) / template_db/lz4_wrapper.cc
template_db/lz4_wrapper.cc
13 of 48 instrumented lines run by the suite (27.1%) at 8edf11b0419c (this file on GitHub).
runnever runcolumns: line, executions, queries (click for the queries that run the line)
1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.2 *3 * This file is part of Overpass_API.4 *5 * Overpass_API is free software: you can redistribute it and/or modify6 * it under the terms of the GNU Affero General Public License as7 * published by the Free Software Foundation, either version 3 of the8 * License, or (at your option) any later version.9 *10 * Overpass_API is distributed in the hope that it will be useful,11 * but WITHOUT ANY WARRANTY; without even the implied warranty of12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * GNU General Public License for more details.14 *15 * You should have received a copy of the GNU Affero General Public License16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.17 */19#include "lz4_wrapper.h"21#include <cstring>22#include <iomanip>23#include <iostream>24#include <sstream>25#include <stdexcept>28namespace29{30 template < typename T >31 std::string to_string(T t)37}40LZ4_Deflate::Error::Error(int error_code_)49int LZ4_Deflate::compress(const void* in, int in_size, void* out, int out_buffer_size)530 int ret = LZ4_compress_limitedOutput((const char*) in, (char *) out + 4, in_size, out_buffer_size - 4);69#else71 throw std::runtime_error("Overpass API was compiled without lz4 compression library support");73#endif77LZ4_Inflate::Error::Error(int error_code_)87int LZ4_Inflate::decompress(const void* in, int in_size, void* out, int out_buffer_size)96485971590 q ret = LZ4_decompress_safe((const char*) in + 4, (char*) out, in_buffer_size, out_buffer_size);111#else113 throw std::runtime_error("Overpass API was compiled without lz4 compression library support");115#endif