style: adjust clang-format rules (#2186)

Co-authored-by: Vithorio Polten <reach@vithor.io>
This commit is contained in:
ReenigneArcher 2025-01-19 22:34:47 -05:00 committed by GitHub
commit c2420427b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
158 changed files with 8754 additions and 9994 deletions

View file

@ -9,32 +9,31 @@
#include <vector>
namespace stream {
std::vector<uint8_t>
concat_and_insert(uint64_t insert_size, uint64_t slice_size, const std::string_view &data1, const std::string_view &data2);
std::vector<uint8_t> concat_and_insert(uint64_t insert_size, uint64_t slice_size, const std::string_view &data1, const std::string_view &data2);
}
#include "../tests_common.h"
TEST(ConcatAndInsertTests, ConcatNoInsertionTest) {
char b1[] = { 'a', 'b' };
char b2[] = { 'c', 'd', 'e' };
auto res = stream::concat_and_insert(0, 2, std::string_view { b1, sizeof(b1) }, std::string_view { b2, sizeof(b2) });
auto expected = std::vector<uint8_t> { 'a', 'b', 'c', 'd', 'e' };
char b1[] = {'a', 'b'};
char b2[] = {'c', 'd', 'e'};
auto res = stream::concat_and_insert(0, 2, std::string_view {b1, sizeof(b1)}, std::string_view {b2, sizeof(b2)});
auto expected = std::vector<uint8_t> {'a', 'b', 'c', 'd', 'e'};
ASSERT_EQ(res, expected);
}
TEST(ConcatAndInsertTests, ConcatLargeStrideTest) {
char b1[] = { 'a', 'b' };
char b2[] = { 'c', 'd', 'e' };
auto res = stream::concat_and_insert(1, sizeof(b1) + sizeof(b2) + 1, std::string_view { b1, sizeof(b1) }, std::string_view { b2, sizeof(b2) });
auto expected = std::vector<uint8_t> { 0, 'a', 'b', 'c', 'd', 'e' };
char b1[] = {'a', 'b'};
char b2[] = {'c', 'd', 'e'};
auto res = stream::concat_and_insert(1, sizeof(b1) + sizeof(b2) + 1, std::string_view {b1, sizeof(b1)}, std::string_view {b2, sizeof(b2)});
auto expected = std::vector<uint8_t> {0, 'a', 'b', 'c', 'd', 'e'};
ASSERT_EQ(res, expected);
}
TEST(ConcatAndInsertTests, ConcatSmallStrideTest) {
char b1[] = { 'a', 'b' };
char b2[] = { 'c', 'd', 'e' };
auto res = stream::concat_and_insert(1, 1, std::string_view { b1, sizeof(b1) }, std::string_view { b2, sizeof(b2) });
auto expected = std::vector<uint8_t> { 0, 'a', 0, 'b', 0, 'c', 0, 'd', 0, 'e' };
char b1[] = {'a', 'b'};
char b2[] = {'c', 'd', 'e'};
auto res = stream::concat_and_insert(1, 1, std::string_view {b1, sizeof(b1)}, std::string_view {b2, sizeof(b2)});
auto expected = std::vector<uint8_t> {0, 'a', 0, 'b', 0, 'c', 0, 'd', 0, 'e'};
ASSERT_EQ(res, expected);
}