minor adjustments

This commit is contained in:
Martchus 2016-03-03 01:44:26 +01:00
parent ff15a54624
commit 0054a74302
4 changed files with 25 additions and 12 deletions

View File

@ -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

View File

@ -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
/*!

View File

@ -1 +1 @@
#include "cppunit.h"
#include "./cppunit.h"

View File

@ -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<int> testVec;
map<string, string> testMap;
CPPUNIT_ASSERT_THROW(testVec.at(1), out_of_range);
CPPUNIT_ASSERT_THROW(testMap.at("test"), out_of_range);
}
/*!