mirror of
https://github.com/boostorg/utility.git
synced 2025-05-08 10:24:00 +00:00
Added tests for the new smart pointers.
[SVN r12500]
This commit is contained in:
parent
88b9822db7
commit
e413428d71
33
assert_test.cpp
Normal file
33
assert_test.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#if defined(_MSC_VER) && !defined(__ICL)
|
||||||
|
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||||
|
#pragma warning(disable: 4710) // function not inlined
|
||||||
|
#pragma warning(disable: 4711) // function selected for automatic inline expansion
|
||||||
|
#pragma warning(disable: 4514) // unreferenced inline removed
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// assert_test.cpp - a test for boost/assert.hpp
|
||||||
|
//
|
||||||
|
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||||
|
//
|
||||||
|
// Permission to copy, use, modify, sell and distribute this software
|
||||||
|
// is granted provided this copyright notice appears in all copies.
|
||||||
|
// This software is provided "as is" without express or implied
|
||||||
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
|
//
|
||||||
|
|
||||||
|
#define BOOST_DEBUG 1
|
||||||
|
|
||||||
|
#include <boost/assert.hpp>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
bool boost_error(char const * expr, char const * func, char const * file, long line)
|
||||||
|
{
|
||||||
|
std::printf("%s(%ld): Assertion '%s' failed in function '%s'\n", file, line, expr, func);
|
||||||
|
return true; // fail w/ standard assert()
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(0 == 1);
|
||||||
|
}
|
32
current_function_test.cpp
Normal file
32
current_function_test.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#if defined(_MSC_VER) && !defined(__ICL)
|
||||||
|
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||||
|
#pragma warning(disable: 4710) // function not inlined
|
||||||
|
#pragma warning(disable: 4711) // function selected for automatic inline expansion
|
||||||
|
#pragma warning(disable: 4514) // unreferenced inline removed
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// current_function_test.cpp - a test for boost/current_function.hpp
|
||||||
|
//
|
||||||
|
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||||
|
//
|
||||||
|
// Permission to copy, use, modify, sell and distribute this software
|
||||||
|
// is granted provided this copyright notice appears in all copies.
|
||||||
|
// This software is provided "as is" without express or implied
|
||||||
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <boost/current_function.hpp>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
void message(char const * file, long line, char const * func, char const * msg)
|
||||||
|
{
|
||||||
|
std::printf("%s(%ld): %s in function '%s'\n", file, line, msg, func);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MESSAGE(msg) message(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, msg)
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
MESSAGE("assertion failed");
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user