diff --git a/README.md b/README.md index 17ea575..b8d5035 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ The library utilizes: ### Requirements * C++ compiler supporting C++11 (I've tested GNU g++, Clang and mingw-w64 yet.) * CMake to build -* cppunit to build and run unit tests after building -* The c++utilities library only depends on the C++ standard library. For Dependencies of my other projects - see the README.md of these projects. +* cppunit to build and run unit tests +* The c++utilities library only depends on the C++ standard library. For dependencies of my other projects + check the README.md of these projects. ### How to build Just run: @@ -50,7 +50,7 @@ To create *.ico files for application icons ffmpeg is required. In any case, the make option *-j* can be used for concurrent compilation. ### Creating Arch Linux package -The repository PKGBUILDs (also on GitHub) contains files for building Arch Linux packages. +The repository [PKGBUILDs](https://github.com/Martchus/PKGBUILDs) contains files for building Arch Linux packages. PKGBUILD files to build for Windows using the Mingw-w64 compiler are also included. ### Notes diff --git a/application/global.h b/application/global.h index 03bfa51..220bde4 100644 --- a/application/global.h +++ b/application/global.h @@ -17,12 +17,18 @@ */ #ifdef _WIN32 -# define PLATFORM_WINDOWS +# ifndef PLATFORM_WINDOWS +# define PLATFORM_WINDOWS +# endif #elif __unix__ -# define PLATFORM_UNIX +# ifndef PLATFORM_UNIX +# define PLATFORM_UNIX +# endif #endif #ifdef __linux__ -# define PLATFORM_LINUX +# ifndef PLATFORM_LINUX +# define PLATFORM_LINUX +# endif #endif /*! @@ -58,10 +64,12 @@ * If the function does nevertheless throw, the behaviour is undefined. */ -#if __cplusplus >= 201103L -# define USE_NOTHROW noexcept -#else -# define USE_NOTHROW throw() +#ifndef USE_NOTHROW +# if __cplusplus >= 201103L +# define USE_NOTHROW noexcept +# else +# define USE_NOTHROW throw() +# endif #endif /*! diff --git a/tests/cppunit.cpp b/tests/cppunit.cpp index afa419b..a3e3fe2 100644 --- a/tests/cppunit.cpp +++ b/tests/cppunit.cpp @@ -1 +1 @@ -#include "cppunit.h" +#include "./cppunit.h" diff --git a/tests/iotests.cpp b/tests/iotests.cpp index d9b9a8a..17c27e3 100644 --- a/tests/iotests.cpp +++ b/tests/iotests.cpp @@ -60,6 +60,11 @@ void IoTests::testFailure() fstream stream; stream.exceptions(ios_base::failbit | ios_base::badbit); CPPUNIT_ASSERT_THROW(stream.open("path/to/file/which/does/not/exist", ios_base::in), ios_base::failure); + // check other exceptions used by my applications, too + vector testVec; + map testMap; + CPPUNIT_ASSERT_THROW(testVec.at(1), out_of_range); + CPPUNIT_ASSERT_THROW(testMap.at("test"), out_of_range); } /*!