use clang-tidy (#59)

* use clang-tidy for Frame.cpp

* fixes for defs.cpp

* clang-tidy 6/45

* clang-tidy for core

* clang-tidy fixes: for hpp File,FileInterface,SubFile.cpp

* ci fixes

* fix build errors

* fix clang-tidy command ci

* fix clang-tidy ci

* clang-tidy for rawfile.cpp

* clang-tidy numpy helpers

* fix ci

* clang-tidy file_io

* clang-tidy file_io and core working

* zmqheader

* clagn-tidy: network_io,file_io,core

* clang-tidy working

* format

---------

Co-authored-by: Bechir <bechir.brahem420@gmail.com>
This commit is contained in:
Bechir Braham
2024-04-12 17:35:36 +02:00
committed by GitHub
parent eb7108b837
commit 9dfd388927
44 changed files with 1055 additions and 470 deletions

View File

@ -4,9 +4,9 @@
using aare::Frame;
TEST_CASE("Construct a frame") {
ssize_t rows = 10;
ssize_t cols = 10;
ssize_t bitdepth = 8;
size_t rows = 10;
size_t cols = 10;
size_t bitdepth = 8;
Frame frame(rows, cols, bitdepth);
@ -16,8 +16,8 @@ TEST_CASE("Construct a frame") {
REQUIRE(frame.size() == rows * cols * bitdepth / 8);
// data should be initialized to 0
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
for (size_t i = 0; i < rows; i++) {
for (size_t j = 0; j < cols; j++) {
uint8_t *data = (uint8_t *)frame.get(i, j);
REQUIRE(data != nullptr);
REQUIRE(*data == 0);
@ -26,9 +26,9 @@ TEST_CASE("Construct a frame") {
}
TEST_CASE("Set a value in a 8 bit frame") {
ssize_t rows = 10;
ssize_t cols = 10;
ssize_t bitdepth = 8;
size_t rows = 10;
size_t cols = 10;
size_t bitdepth = 8;
Frame frame(rows, cols, bitdepth);
@ -37,8 +37,8 @@ TEST_CASE("Set a value in a 8 bit frame") {
frame.set(5, 7, value);
// only the value we did set should be non-zero
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
for (size_t i = 0; i < rows; i++) {
for (size_t j = 0; j < cols; j++) {
uint8_t *data = (uint8_t *)frame.get(i, j);
REQUIRE(data != nullptr);
if (i == 5 && j == 7) {
@ -51,9 +51,9 @@ TEST_CASE("Set a value in a 8 bit frame") {
}
TEST_CASE("Set a value in a 64 bit frame") {
ssize_t rows = 10;
ssize_t cols = 10;
ssize_t bitdepth = 64;
size_t rows = 10;
size_t cols = 10;
size_t bitdepth = 64;
Frame frame(rows, cols, bitdepth);
@ -62,8 +62,8 @@ TEST_CASE("Set a value in a 64 bit frame") {
frame.set(5, 7, value);
// only the value we did set should be non-zero
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
for (size_t i = 0; i < rows; i++) {
for (size_t j = 0; j < cols; j++) {
uint64_t *data = (uint64_t *)frame.get(i, j);
REQUIRE(data != nullptr);
if (i == 5 && j == 7) {
@ -76,9 +76,9 @@ TEST_CASE("Set a value in a 64 bit frame") {
}
TEST_CASE("Move construct a frame") {
ssize_t rows = 10;
ssize_t cols = 10;
ssize_t bitdepth = 8;
size_t rows = 10;
size_t cols = 10;
size_t bitdepth = 8;
Frame frame(rows, cols, bitdepth);
std::byte *data = frame.data();