Changeset 25961 in vbox for trunk/src/VBox
- Timestamp:
- Jan 21, 2010 2:19:12 PM (15 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/uuid-generic.cpp
r25000 r25961 137 137 138 138 139 RTDECL(int) RTUuidCompareStr(PCRTUUID pUuid1, const char *pszString )139 RTDECL(int) RTUuidCompareStr(PCRTUUID pUuid1, const char *pszString2) 140 140 { 141 141 RTUUID Uuid2; … … 144 144 /* check params */ 145 145 AssertPtrReturn(pUuid1, -1); 146 AssertPtrReturn(pszString , 1);146 AssertPtrReturn(pszString2, 1); 147 147 148 148 /* 149 149 * Try convert the string to a UUID and then compare the two. 150 150 */ 151 rc = RTUuidFromStr(&Uuid2, pszString );151 rc = RTUuidFromStr(&Uuid2, pszString2); 152 152 AssertRCReturn(rc, 1); 153 153 … … 155 155 } 156 156 RT_EXPORT_SYMBOL(RTUuidCompareStr); 157 158 159 RTDECL(int) RTUuidCompare2Strs(const char *pszString1, const char *pszString2) 160 { 161 RTUUID Uuid1; 162 RTUUID Uuid2; 163 int rc; 164 165 /* check params */ 166 AssertPtrReturn(pszString1, -1); 167 AssertPtrReturn(pszString2, 1); 168 169 /* 170 * Try convert the strings to UUIDs and then compare them. 171 */ 172 rc = RTUuidFromStr(&Uuid1, pszString1); 173 AssertRCReturn(rc, -1); 174 175 rc = RTUuidFromStr(&Uuid2, pszString2); 176 AssertRCReturn(rc, 1); 177 178 return RTUuidCompare(&Uuid1, &Uuid2); 179 } 180 RT_EXPORT_SYMBOL(RTUuidCompare2Strs); 157 181 158 182 -
trunk/src/VBox/Runtime/r3/win/uuid-win.cpp
r9743 r25961 83 83 84 84 85 RTDECL(int) RTUuidCompareStr(PCRTUUID pUuid1, const char *pszString )85 RTDECL(int) RTUuidCompareStr(PCRTUUID pUuid1, const char *pszString2) 86 86 { 87 87 /* check params */ 88 88 AssertPtrReturn(pUuid1, -1); 89 AssertPtrReturn(pszString , 1);89 AssertPtrReturn(pszString2, 1); 90 90 91 91 /* … … 93 93 */ 94 94 RTUUID Uuid2; 95 int rc = RTUuidFromStr(&Uuid2, pszString );95 int rc = RTUuidFromStr(&Uuid2, pszString2); 96 96 AssertRCReturn(rc, 1); 97 97 98 98 return RTUuidCompare(pUuid1, &Uuid2); 99 } 100 101 102 RTDECL(int) RTUuidCompare2Strs(const char *pszString1, const char *pszString2) 103 { 104 RTUUID Uuid1; 105 RTUUID Uuid2; 106 int rc; 107 108 /* check params */ 109 AssertPtrReturn(pszString1, -1); 110 AssertPtrReturn(pszString2, 1); 111 112 /* 113 * Try convert the strings to UUIDs and then compare them. 114 */ 115 rc = RTUuidFromStr(&Uuid1, pszString1); 116 AssertRCReturn(rc, -1); 117 118 rc = RTUuidFromStr(&Uuid2, pszString2); 119 AssertRCReturn(rc, 1); 120 121 return RTUuidCompare(&Uuid1, &Uuid2); 99 122 } 100 123 -
trunk/src/VBox/Runtime/testcase/Makefile.kmk
r25946 r25961 114 114 tstTSC \ 115 115 tstUtf8 \ 116 tst Uuid116 tstRTUuid 117 117 # tstSems 118 118 PROGRAMS.win += \ … … 342 342 343 343 tstRTPath_TEMPLATE = VBOXR3TSTEXE 344 tstRTPath_SOURCES 344 tstRTPath_SOURCES = tstRTPath.cpp 345 345 346 346 tstPrfRT_SOURCES = tstPrfRT.cpp … … 421 421 tstTSC_CXXFLAGS.linux += -O3 422 422 423 tstUuid_SOURCES = tstUuid.cpp 423 tstRTUuid_TEMPLATE = VBOXR3TSTEXE 424 tstRTUuid_SOURCES = tstRTUuid.cpp 424 425 425 426 tstUtf8_SOURCES = tstUtf8.cpp -
trunk/src/VBox/Runtime/testcase/tstRTUuid.cpp
r25954 r25961 44 44 { 45 45 RTTEST hTest; 46 int rc = RTTestInitAndCreate("tst Uuid", &hTest);46 int rc = RTTestInitAndCreate("tstRTUuid", &hTest); 47 47 if (rc) 48 48 return rc; … … 88 88 RTTEST_CHECK(hTest, RTUuidCompare(&Uuid, &Uuid2) == 0); 89 89 90 RTTestSub(hTest, "RTUuidCompareStr"); 91 RTTEST_CHECK(hTest, RTUuidCompareStr(&Uuid, sz) == 0); 92 RTTEST_CHECK(hTest, RTUuidCompareStr(&Uuid, "00000000-0000-0000-0000-000000000000") > 0); 93 RTTEST_CHECK(hTest, RTUuidCompareStr(&UuidNull, "00000000-0000-0000-0000-000000000000") == 0); 94 95 RTTestSub(hTest, "RTUuidCompare2Strs"); 96 RTTEST_CHECK(hTest, RTUuidCompare2Strs(sz, sz) == 0); 97 RTTEST_CHECK(hTest, RTUuidCompare2Strs(sz, "00000000-0000-0000-0000-000000000000") > 0); 98 RTTEST_CHECK(hTest, RTUuidCompare2Strs("00000000-0000-0000-0000-000000000000", sz) < 0); 99 RTTEST_CHECK(hTest, RTUuidCompare2Strs("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000") == 0); 100 RTTEST_CHECK(hTest, RTUuidCompare2Strs("d95d883b-f91d-4ce5-a5c5-d08bb6a85dec", "a56193c7-3e0b-4c03-9d66-56efb45082f7") > 0); 101 RTTEST_CHECK(hTest, RTUuidCompare2Strs("a56193c7-3e0b-4c03-9d66-56efb45082f7", "d95d883b-f91d-4ce5-a5c5-d08bb6a85dec") < 0); 90 102 91 103 /*
Note:
See TracChangeset
for help on using the changeset viewer.