stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r662715 - /stdcxx/branches/4.2.x/tests/src/file.cpp
Date Tue, 03 Jun 2008 09:16:23 GMT
Author: faridz
Date: Tue Jun  3 02:16:22 2008
New Revision: 662715

URL: http://svn.apache.org/viewvc?rev=662715&view=rev
Log:
2008-06-03  Farid Zaripov  <farid_zaripov@epam.com>

	* tests/src/file.cpp (rw_nextfd) [_MSC_VER]: Disable expected "Invalid file descriptor"
	CRT assertions from _commit().

Modified:
    stdcxx/branches/4.2.x/tests/src/file.cpp

Modified: stdcxx/branches/4.2.x/tests/src/file.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/file.cpp?rev=662715&r1=662714&r2=662715&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/src/file.cpp (original)
+++ stdcxx/branches/4.2.x/tests/src/file.cpp Tue Jun  3 02:16:22 2008
@@ -50,6 +50,9 @@
 #  include <unistd.h>     // for close(), open()
 #else
 #  include <io.h>         // for _commit()
+#  ifdef _MSC_VER
+#    include <crtdbg.h>   // for _CrtSetReportMode()
+#  endif
 #endif
 
 #include <assert.h>   // for assert
@@ -480,6 +483,12 @@
 
 #if defined (_WIN32) || defined (_WIN64)
 
+#  ifdef _MSC_VER
+        // save the report mode and disable "Invalid file descriptor"
+        // CRT assertions from _commit()
+        const int prev_mode = _CrtSetReportMode (_CRT_ASSERT, 0);
+#  endif
+
         for (int i = 0; i != 256; ++i) {
 
             const int ret = _commit (i);
@@ -487,6 +496,13 @@
             if (-1 != ret || EBADF != errno)
                 ++*count;
         }
+
+#  ifdef _MSC_VER
+        // restore the previous mode
+        if (-1 != prev_mode)
+            _CrtSetReportMode (_CRT_ASSERT, prev_mode);
+#  endif
+
 #else   // if not Windoze
 
         for (int i = 0; i != 256; ++i) {



Mime
View raw message