Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Algorithm/include/Algorithm/BitstreamReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include <type_traits>
#include <bitset>
#include <utility>
#include <string>

namespace o2
{
Expand Down
1 change: 1 addition & 0 deletions Algorithm/include/Algorithm/FlattenRestore.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/// @brief Utilities to copy complex objects to flat buffer and restore

#include <type_traits>
#include <utility>

namespace o2::algorithm
{
Expand Down
2 changes: 2 additions & 0 deletions Algorithm/include/Algorithm/PageParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <cassert>
#include <type_traits>
#include <stdexcept>
#include <set>
#include <algorithm>

namespace o2
{
Expand Down
4 changes: 3 additions & 1 deletion Algorithm/test/StaticSequenceAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/// @since 2017-09-21
/// @brief An allocator for static sequences of object types

#include <memory>

namespace o2
{
namespace algorithm
Expand Down Expand Up @@ -145,7 +147,7 @@ struct StaticSequenceAllocator {
StaticSequenceAllocator() = delete;

template <typename... Targs>
StaticSequenceAllocator(Targs... args)
explicit StaticSequenceAllocator(Targs... args)
{
bufferSize = sequenceLength(args...);
buffer = std::make_unique<value_type[]>(bufferSize);
Expand Down
1 change: 1 addition & 0 deletions Algorithm/test/o2formatparser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <iostream>
#include <iomanip>
#include <cstring> // memcmp
#include <vector>
#include "Headers/DataHeader.h" // hexdump, DataHeader
#include "../include/Algorithm/O2FormatParser.h"

Expand Down
4 changes: 3 additions & 1 deletion Algorithm/test/pageparser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <iostream>
#include <iomanip>
#include <vector>
#include <memory>
#include <utility>
#include "Headers/DataHeader.h" // hexdump
#include "../include/Algorithm/PageParser.h"
#include "StaticSequenceAllocator.h"
Expand All @@ -29,7 +31,7 @@ struct PageHeader {
uint32_t magic = 0x45474150;
uint32_t pageid;

PageHeader(uint32_t id) : pageid(id) {}
explicit PageHeader(uint32_t id) : pageid(id) {}
};

struct ClusterData {
Expand Down
4 changes: 2 additions & 2 deletions Algorithm/test/parser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ struct Header {
unsigned identifier = 0xdeadbeef;
size_t payloadSize = 0;

Header(size_t ps) : payloadSize(ps) {}
explicit Header(size_t ps) : payloadSize(ps) {}
};

// trailer test class
struct Trailer {
unsigned identifier = 0xaaffee00;
unsigned char flags = 0xaa;

Trailer(unsigned char f) : flags(f) {}
explicit Trailer(unsigned char f) : flags(f) {}
};

// trailer test class including payload size
Expand Down
1 change: 1 addition & 0 deletions Algorithm/test/test_BitstreamReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <array>
#include <vector>
#include <bitset>
#include <string>
#include "../include/Algorithm/BitstreamReader.h"

namespace o2
Expand Down
10 changes: 6 additions & 4 deletions Algorithm/test/test_FlattenRestore.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "../include/Algorithm/FlattenRestore.h"
#include <vector>
#include <algorithm>
#include <cstdlib>

namespace flatten = o2::algorithm::flatten;

Expand All @@ -35,13 +36,14 @@ struct DataAccess {
} // namespace o2::test
BOOST_AUTO_TEST_CASE(test_flattenrestore)
{
o2::test::DataAccess access{static_cast<size_t>(rand() % 32)};
unsigned int seed = 1;
o2::test::DataAccess access{static_cast<size_t>(rand_r(&seed) % 32)};
std::vector<char> chars(access.count);
std::generate(chars.begin(), chars.end(), []() { return rand() % 256; });
std::generate(chars.begin(), chars.end(), [&seed]() { return rand_r(&seed) % 256; });
std::vector<int> ints(access.count);
std::generate(ints.begin(), ints.end(), []() { return rand() % 256; });
std::generate(ints.begin(), ints.end(), [&seed]() { return rand_r(&seed) % 256; });
std::vector<float> floats(access.count);
std::generate(floats.begin(), floats.end(), []() { return rand() % 256; });
std::generate(floats.begin(), floats.end(), [&seed]() { return rand_r(&seed) % 256; });
access.chars = chars.data();
access.ints = ints.data();
access.floats = floats.data();
Expand Down
2 changes: 2 additions & 0 deletions Algorithm/test/test_RangeTokenizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "../include/Algorithm/RangeTokenizer.h"
#include <vector>
#include <map>
#include <string>
#include <utility>

using RangeTokenizer = o2::RangeTokenizer;

Expand Down
5 changes: 3 additions & 2 deletions Algorithm/test/test_mpl_tools.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <iomanip>
#include <vector>
#include <type_traits>
#include <cstdint>

// FIXME: mpl/string.hpp required to be included to avoid compilation error
// error: no matching function for call to ‘assertion_failed ...' in the mpl::for_each
Expand All @@ -42,7 +43,7 @@
namespace bmpl = boost::mpl;

// defining a list of known data types
using knowntypes = bmpl::vector<float, double, long double, short, long>;
using knowntypes = bmpl::vector<float, double, long double, int16_t, int64_t>;

// get the index of an element in a type sequence
template <typename Iterator, typename End, typename Element, typename T, int Count = 0>
Expand Down Expand Up @@ -132,7 +133,7 @@ struct checktype {

BOOST_AUTO_TEST_CASE(test_mpl_fold)
{
using types = bmpl::vector<long, float, short, double, float, long, long double>;
using types = bmpl::vector<int64_t, float, int16_t, double, float, int64_t, long double>;
std::cout << std::endl
<< "checking types:" << std::endl;
bmpl::for_each<types>(checktype());
Expand Down