check_null.hpp
Go to the documentation of this file.
00001 /* 00002 Copyright 2005-2007 Adobe Systems Incorporated 00003 Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt 00004 or a copy at http://stlab.adobe.com/licenses.html) 00005 */ 00006 00007 /*************************************************************************************************/ 00008 00009 #include <adobe/config.hpp> 00010 #include <boost/test/unit_test.hpp> 00011 00012 namespace adobe { 00018 template <typename T> 00019 void check_null(const T& x) 00020 { 00021 T t = T(); 00022 if(t) 00023 BOOST_ERROR("operator bool"); 00024 BOOST_CHECK_MESSAGE(!t, "operator!"); 00025 00026 BOOST_CHECK_MESSAGE(x, "operator!"); 00027 if(!x) 00028 BOOST_ERROR("operator bool"); 00029 00030 } 00032 } 00033 |