Changeset 58438 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Oct 27, 2015 4:30:34 PM (9 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTNetIPv4.cpp
r57358 r58438 97 97 98 98 99 #define CHECKANY(String, fExpected) \ 100 do { \ 101 bool fRc = RTNetStrIsIPv4AddrAny(String); \ 102 if (fRc != fExpected) \ 103 { \ 104 RTTestIFailed("at line %d: '%s':" \ 105 " expected %RTbool got %RTbool\n", \ 106 __LINE__, (String), fExpected, fRc); \ 107 } \ 108 } while (0) 109 110 #define IS_ANY(String) CHECKANY((String), true) 111 #define NOT_ANY(String) CHECKANY((String), false) 112 113 99 114 int main() 100 115 { … … 131 146 CHECKADDREX("1.2.3.444", "", VERR_INVALID_PARAMETER, 0); 132 147 148 149 IS_ANY("0.0.0.0"); 150 IS_ANY("\t 0.0.0.0 \t"); 151 152 NOT_ANY("1.1.1.1"); /* good address, but not INADDR_ANY */ 153 NOT_ANY("0.0.0.0x"); /* bad address */ 154 133 155 return RTTestSummaryAndDestroy(hTest); 134 156 } -
trunk/src/VBox/Runtime/testcase/tstRTNetIPv6.cpp
r57358 r58438 73 73 74 74 75 #define CHECKANY(String, fExpected) \ 76 do { \ 77 bool fRc = RTNetStrIsIPv6AddrAny(String); \ 78 if (fRc != fExpected) \ 79 { \ 80 RTTestIFailed("at line %d: '%s':" \ 81 " expected %RTbool got %RTbool\n", \ 82 __LINE__, (String), fExpected, fRc); \ 83 } \ 84 } while (0) 85 86 #define IS_ANY(String) CHECKANY((String), true) 87 #define NOT_ANY(String) CHECKANY((String), false) 88 89 75 90 int main() 76 91 { … … 189 204 GOODADDR(" ff01::1%net1.1\t", 0xff010000, 0, 0, 1); 190 205 206 207 IS_ANY("::"); 208 IS_ANY("::0.0.0.0"); 209 IS_ANY("0:0:0:0:0:0:0:0"); 210 IS_ANY("0000:0000:0000:0000:0000:0000:0000:0000"); 211 212 IS_ANY("\t :: \t"); 213 214 NOT_ANY("::1"); 215 NOT_ANY("0:0:0:0:0:0:0:1"); 216 217 NOT_ANY(":: x"); 218 NOT_ANY("::%"); 219 NOT_ANY("::%eth0"); /* or is it? */ 220 191 221 return RTTestSummaryAndDestroy(hTest); 192 222 }
Note:
See TracChangeset
for help on using the changeset viewer.