Update contrib.
1 //We are including stdlib.h and stddef.h first because under MSVC
2 //those headers contains a errno macro definition without the underlying value
8 #include <errno.h> // not typo, check errno def/undef/redef
12 #include "cppunit/cppunit_proxy.h"
17 class ErrnoTest : public CPPUNIT_NS::TestCase
19 CPPUNIT_TEST_SUITE(ErrnoTest);
21 CPPUNIT_TEST_SUITE_END();
27 CPPUNIT_TEST_SUITE_REGISTRATION(ErrnoTest);
29 void ErrnoTest::check()
31 //We are using ERANGE as it is part of the C++ ISO (see Table 26 in section 19.3)
32 //Using ERANGE improve the test as it means that the native errno.h file has really
36 CPPUNIT_ASSERT( errno == ERANGE );
39 /* Note: in common, you can't write ::errno or std::errno,
40 * due to errno in most cases is just a macro, that frequently
41 * (in MT environment errno is a per-thread value) expand to something like
42 * (*__errno_location()). I don't know way how masquerade such
43 * things: name of macro can't include ::.
51 if ( std::errno != 0 ) {