Changeset 9334 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jun 2, 2008 11:15:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
r8155 r9334 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VBox host drivers - Ring-0 support drivers - Testcases: 4 * Test contiguous memory 3 * VBox Support Driver - Contiguous Memory Testcase (ring-3). 5 4 */ 6 5 … … 36 35 #include <VBox/sup.h> 37 36 #include <VBox/param.h> 38 #include <iprt/ runtime.h>37 #include <iprt/initterm.h> 39 38 #include <iprt/stream.h> 40 39 #include <stdlib.h> 41 40 #include <string.h> 42 43 41 44 42 … … 72 70 if (rc) 73 71 RTPrintf("tstContiguous: SUPContFree failed! rc=%Vrc\n", rc); 72 73 void *apv[128]; 74 for (unsigned i = 0; i < RT_ELEMENTS(apv); i++) 75 { 76 apv[i] = SUPContAlloc(1 + (i % 11), &HCPhys); 77 if (!apv[i]) 78 { 79 RTPrintf("tstContiguous: i=%d: failed to allocate %d pages\n", i, 1 + (i % 11)); 80 rcRet++; 81 } 82 } 83 for (unsigned i = 0; i < RT_ELEMENTS(apv); i++) 84 if (apv[i]) 85 { 86 rc = SUPContFree(apv[i], 1 + (i % 11)); 87 rcRet += rc != 0; 88 if (rc) 89 RTPrintf("tstContiguous: i=%d SUPContFree failed! rc=%Vrc\n", i, rc); 90 } 74 91 } 75 92 else … … 84 101 } 85 102 86 return rcRet ;103 return rcRet ? 1 : 0; 87 104 }
Note:
See TracChangeset
for help on using the changeset viewer.