12#include "resources/version.h"
14#include <cppunit/TestFixture.h>
15#include <cppunit/extensions/HelperMacros.h>
22using namespace CPPUNIT_NS;
25#if CPP_UTILITIES_VERSION_CHECK(5, 2, 1) > CPP_UTILITIES_VERSION_CHECK(6, 0, 0)
26#error "Check for major version doesn't work"
28#if CPP_UTILITIES_VERSION_CHECK(5, 2, 2) > CPP_UTILITIES_VERSION_CHECK(5, 3, 0)
29#error "Check for minor version doesn't work"
31#if CPP_UTILITIES_VERSION_CHECK(5, 2, 1) > CPP_UTILITIES_VERSION_CHECK(5, 2, 2)
32#error "Check for path version doesn't work"
34#if CPP_UTILITIES_VERSION < CPP_UTILITIES_VERSION_CHECK(5, 0, 0)
35#error "Library version seems wrongly defined, should be already >= 5.0.0"
46 CPPUNIT_TEST_SUITE_END();
66 static_assert(
decltype(
makeMultiArray<char>(3, 2))::dimensionCount() == 2,
"dimension count 2D");
67 static_assert(
decltype(
makeMultiArray<char>(3, 2, 3))::dimensionCount() == 3,
"dimension count 3D");
81 const char *
const data(
array2d.data());
The MiscTests class tests misc functions and classes (mainly of files contained by the misc directory...
void testTestUtilities()
Tests helper from TestUtilities namespace which aren't used in other tests anyways.
#define CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(Namespace, EnumClassType)
CPPUNIT_TEST_SUITE_REGISTRATION(MiscTests)
Contains literals to ease asserting with CPPUNIT_ASSERT_EQUAL.
Contains all utilities provides by the c++utilities library.
CPP_UTILITIES_EXPORT std::string readFile(const std::string &path, std::string::size_type maxSize=std::string::npos)
Reads all contents of the specified file in a single call.
CPP_UTILITIES_EXPORT std::string workingCopyPath(const std::string &relativeTestFilePath, WorkingCopyMode mode=WorkingCopyMode::CreateCopy)
Convenience function to invoke TestApplication::workingCopyPath().
constexpr bool checkFlagEnum(FlagEnumClass flagVariable, FlagEnumClass flagsToCheck)
Returns whether the specified flagVariable has set all flags specified via flagsToCheck to true.
IntegralType stringToNumber(const StringType &string, BaseType base=10)
Converts the given string to an unsigned/signed number assuming string uses the specified base.
AsHexNumber< T > asHexNumber(const T &value)
Wraps a value to be printed using the hex system in the error case when asserted with cppunit (or sim...
CPP_UTILITIES_EXPORT std::string workingCopyPathAs(const std::string &relativeTestFilePath, const std::string &relativeWorkingCopyPath, WorkingCopyMode mode=WorkingCopyMode::CreateCopy)
Convenience function to invoke TestApplication::workingCopyPathAs().
constexpr FlagEnumClass & modFlagEnum(FlagEnumClass &flagVariable, FlagEnumClass relevantFlags, bool value)
Sets the specified relevantFlags in the specified flagVariable to the specified value.
CPP_UTILITIES_EXPORT std::size_t computeDamerauLevenshteinDistance(const char *str1, std::size_t size1, const char *str2, std::size_t size2)
constexpr bool testFlagEnumClass()
#define TESTUTILS_ASSERT_LIKE(message, expectedRegex, actualString)
Asserts whether the specified string matches the specified regex.