RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
CommonTest.cpp File Reference
#include "common/Common.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
#include <gtest/gtest.h>
Include dependency graph for CommonTest.cpp:

Go to the source code of this file.

Classes

class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::RoundDownTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::RoundUpTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::roundUpDivisionSafeTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::IsAlignedTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::IsInTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::TrimSpacesTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::SplitStringTest
class  rawspeed_test::anonymous_namespace{CommonTest.cpp}::CopyPixelsTest

Namespaces

namespace  rawspeed_test
namespace  rawspeed_test::anonymous_namespace{CommonTest.cpp}

Macros

#define STR   "fo2o 3,24 b5a#r"

Typedefs

using rawspeed_test::anonymous_namespace{CommonTest.cpp}::RoundDownType = std::tuple<uint64_t, uint64_t, uint64_t>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::RoundUpType = std::tuple<uint64_t, uint64_t, uint64_t>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::roundUpDivisionSafeType = std::tuple<uint64_t, uint64_t, uint64_t>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::IsAlignedType = std::tuple<int, int>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::IsInType = std::tuple<string, bool>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::TrimSpacesType = std::tuple<string, string>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::splitStringType = std::tuple<string, char, vector<string>>
using rawspeed_test::anonymous_namespace{CommonTest.cpp}::copyPixelsType = std::tuple<int, int, int, int>

Functions

 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (RoundDownTest, RoundDownTest, ::testing::ValuesIn(RoundDownValues))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (RoundDownTest, RoundDownTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (RoundUpTest, RoundUpTest, ::testing::ValuesIn(RoundUpValues))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (RoundUpTest, RoundUpTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (roundUpDivisionSafeTest, roundUpDivisionSafeTest, ::testing::ValuesIn(roundUpDivisionSafeValues))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (roundUpDivisionSafeTest, roundUpDivisionSafeTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (IsAlignedTest, IsAlignedTest, ::testing::Combine(::testing::Range(0, 32), ::testing::Range(0, 32)))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (IsAlignedTest, IsAlignedAfterRoundUpTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (IsInTest, IsInTest, ::testing::ValuesIn(IsInValues))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (IsInTest, IsInTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (TrimSpacesTest, TrimSpacesTest, ::testing::ValuesIn(TrimSpacesValues))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (TrimSpacesTest, TrimSpacesTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (SplitStringTest, SplitStringTest, ::testing::ValuesIn(splitStringValues))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (SplitStringTest, SplitStringTest)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST (MakeUniqueTest, Test)
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::INSTANTIATE_TEST_SUITE_P (CopyPixelsTest, CopyPixelsTest, testing::Combine(testing::Range(1, 4, 1), testing::Range(1, 4, 1), testing::Range(1, 4, 1), testing::Range(1, 4, 1)))
 rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P (CopyPixelsTest, CopyPixelsTest)
void copyPixels (std::byte *destPtr, int dstPitch, const std::byte *srcPtr, int srcPitch, int rowSize, int height)
template<class T>
constexpr RAWSPEED_READNONE bool isAligned (T value, size_t multiple)
template<typename T, typename T2>
bool RAWSPEED_READONLY isIn (const T value, const std::initializer_list< T2 > &list)
template<typename T>
constexpr bool RAWSPEED_READNONE isPowerOfTwo (T val)
constexpr uint64_t RAWSPEED_READNONE roundDown (uint64_t value, uint64_t multiple)
constexpr uint64_t RAWSPEED_READNONE roundUp (uint64_t value, uint64_t multiple)
constexpr uint64_t RAWSPEED_READNONE roundUpDivisionSafe (uint64_t value, uint64_t div)
std::vector< std::string > splitString (const std::string &input, char c=' ')
std::string trimSpaces (std::string_view str)

Variables

const RoundDownType rawspeed_test::anonymous_namespace{CommonTest.cpp}::RoundDownValues []
const RoundUpType rawspeed_test::anonymous_namespace{CommonTest.cpp}::RoundUpValues []
const roundUpDivisionSafeType rawspeed_test::anonymous_namespace{CommonTest.cpp}::roundUpDivisionSafeValues []
const IsInType rawspeed_test::anonymous_namespace{CommonTest.cpp}::IsInValues []
const TrimSpacesType rawspeed_test::anonymous_namespace{CommonTest.cpp}::TrimSpacesValues []
const splitStringType rawspeed_test::anonymous_namespace{CommonTest.cpp}::splitStringValues []

Macro Definition Documentation

◆ STR

#define STR   "fo2o 3,24 b5a#r"

Function Documentation

◆ copyPixels()

void rawspeed::copyPixels ( std::byte * destPtr,
int dstPitch,
const std::byte * srcPtr,
int srcPitch,
int rowSize,
int height )
inline

Definition at line 79 of file Common.h.

◆ isAligned()

template<class T>
RAWSPEED_READNONE bool rawspeed::isAligned ( T value,
size_t multiple )
constexpr

Definition at line 151 of file Common.h.

Referenced by rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ isIn()

template<typename T, typename T2>
bool RAWSPEED_READONLY rawspeed::isIn ( const T value,
const std::initializer_list< T2 > & list )

Definition at line 156 of file Common.h.

Referenced by rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ isPowerOfTwo()

template<typename T>
bool RAWSPEED_READNONE rawspeed::isPowerOfTwo ( T val)
constexpr

Definition at line 38 of file Bit.h.

◆ roundDown()

uint64_t RAWSPEED_READNONE rawspeed::roundDown ( uint64_t value,
uint64_t multiple )
constexpr

Definition at line 129 of file Common.h.

Referenced by rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ roundUp()

uint64_t RAWSPEED_READNONE rawspeed::roundUp ( uint64_t value,
uint64_t multiple )
constexpr

Definition at line 134 of file Common.h.

◆ roundUpDivisionSafe()

uint64_t RAWSPEED_READNONE rawspeed::roundUpDivisionSafe ( uint64_t value,
uint64_t div )
constexpr

Definition at line 145 of file Common.h.

Referenced by rawspeed::DngOpcodes::DeltaRowOrCol< S >::DeltaRowOrCol(), rawspeed::anonymous_namespace{BitVacuumerBenchmark.cpp}::BitVectorLengthsGenerator::__attribute__(), rawspeed::DngOpcodes::PixelOpcode::applyOP(), and rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ splitString()

std::vector< std::string > rawspeed::splitString ( const std::string & input,
char c = ' ' )
inline

Definition at line 178 of file Common.h.

Referenced by rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P().

Here is the caller graph for this function:

◆ trimSpaces()

std::string rawspeed::trimSpaces ( std::string_view str)
inline

Definition at line 163 of file Common.h.

Referenced by rawspeed_test::anonymous_namespace{CommonTest.cpp}::TEST_P().

Here is the caller graph for this function: