[skip ci] Update coverage.yml

This commit is contained in:
ado 2024-02-21 01:25:53 +01:00
parent 9d96a7d47f
commit 59f6591da3
3 changed files with 22 additions and 16 deletions

View File

@ -60,7 +60,7 @@ jobs:
- name: Generate coverage report - name: Generate coverage report
run: | run: |
lcov -d . -c -o out.info --rc lcov_branch_coverage=1 --no-external lcov -d . -c -o out.info --rc lcov_branch_coverage=1 --no-external --filter branch --filter line
lcov -e out.info '*include/ss*hpp' -o filtered.info lcov -e out.info '*include/ss*hpp' -o filtered.info
- name: Invoke coveralls - name: Invoke coveralls

View File

@ -368,20 +368,22 @@ public:
template <typename U, typename... Us, typename Fun = none> template <typename U, typename... Us, typename Fun = none>
void try_convert_and_invoke(std::optional<U>& value, Fun&& fun) { void try_convert_and_invoke(std::optional<U>& value, Fun&& fun) {
if (!parser_.valid()) { if (parser_.valid()) {
auto tuple_output = try_same<Us...>(); return;
if (!parser_.valid()) {
return;
}
if constexpr (!std::is_same_v<U, decltype(tuple_output)>) {
value = to_object<U>(std::move(tuple_output));
} else {
value = std::move(tuple_output);
}
parser_.try_invoke(*value, std::forward<Fun>(fun));
} }
auto tuple_output = try_same<Us...>();
if (!parser_.valid()) {
return;
}
if constexpr (!std::is_same_v<U, decltype(tuple_output)>) {
value = to_object<U>(std::move(tuple_output));
} else {
value = std::move(tuple_output);
}
parser_.try_invoke(*value, std::forward<Fun>(fun));
} }
template <typename U, typename... Us> template <typename U, typename... Us>
@ -918,6 +920,7 @@ private:
} }
size_t remove_eol(char*& buffer, size_t ssize) { size_t remove_eol(char*& buffer, size_t ssize) {
// TODO write unit tests
if (buffer[ssize - 1] != '\n') { if (buffer[ssize - 1] != '\n') {
return ssize; return ssize;
} }
@ -940,7 +943,8 @@ private:
buffer_size = first_size + second_size + 3; buffer_size = first_size + second_size + 3;
auto new_first = static_cast<char*>( auto new_first = static_cast<char*>(
realloc(static_cast<void*>(first), buffer_size)); realloc(static_cast<void*>(first), buffer_size));
if (!first) { // TODO check
if (!new_first) {
throw std::bad_alloc{}; throw std::bad_alloc{};
} }

View File

@ -5,6 +5,8 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include <algorithm>
#include <fstream>
#ifdef CMAKE_GITHUB_CI #ifdef CMAKE_GITHUB_CI
#include <doctest/doctest.h> #include <doctest/doctest.h>
@ -134,7 +136,7 @@ template <typename T>
for (const auto& i : v) { for (const auto& i : v) {
for (auto j : inner_combinations) { for (auto j : inner_combinations) {
j.insert(j.begin(), i); j.insert(j.begin(), i);
ret.push_back(move(j)); ret.push_back(std::move(j));
} }
} }
return ret; return ret;