Changeset 74161 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Sep 9, 2018 2:12:40 PM (6 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/rest/rest-primary-object-types.cpp
r74149 r74161 207 207 int RTCRestBool::deserializeFromJson(RTCRestJsonCursor const &a_rCursor) 208 208 { 209 m_fValue = false; 210 m_fNullIndicator = false; 211 209 212 RTJSONVALTYPE enmType = RTJsonValueGetType(a_rCursor.m_hValue); 210 213 … … 212 215 { 213 216 m_fValue = true; 214 m_fNullIndicator = false;215 217 return VINF_SUCCESS; 216 218 } 217 219 218 220 if (enmType == RTJSONVALTYPE_FALSE) 219 { 220 m_fValue = false; 221 m_fNullIndicator = false; 222 return VINF_SUCCESS; 223 } 221 return VINF_SUCCESS; 224 222 225 223 if (enmType == RTJSONVALTYPE_NULL) 226 224 { 227 m_fValue = false;228 225 m_fNullIndicator = true; 229 226 return VINF_SUCCESS; 230 227 } 231 228 232 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for boolean",229 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_BOOL, "wrong JSON type %s for boolean", 233 230 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 234 231 } … … 279 276 } 280 277 else 281 return RTErrInfoSetF(a_pErrInfo, VERR_INVALID_PARAMETER, "%s: unable to parse '%s' as bool", a_pszName, a_rValue.c_str()); 278 return RTErrInfoSetF(a_pErrInfo, VERR_REST_UNABLE_TO_PARSE_STRING_AS_BOOL, 279 "%s: unable to parse '%s' as bool", a_pszName, a_rValue.c_str()); 282 280 return VINF_SUCCESS; 283 281 } … … 405 403 m_iValue = 1; 406 404 407 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for 64-bit integer",405 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_INTEGER, "wrong JSON type %s for 64-bit integer", 408 406 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 409 407 } … … 432 430 m_fNullIndicator = false; 433 431 434 int rc = RTStrToInt64Full(RTStrStripL(a_rValue.c_str()), 10, &m_iValue); 432 /** @todo RTStrStripL and RTStrToInt64Full has a different idea what consitutes spaces... */ 433 int rc = RTStrToInt64Full(RTStrStripL(a_rValue.c_str()), 0, &m_iValue); 435 434 if (rc == VINF_SUCCESS || rc == VERR_TRAILING_SPACES) 436 435 return VINF_SUCCESS; … … 574 573 m_iValue = 1; 575 574 576 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for 32-bit integer",575 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_INTEGER, "wrong JSON type %s for 32-bit integer", 577 576 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 578 577 } … … 601 600 m_fNullIndicator = false; 602 601 603 int rc = RTStrToInt32Full(RTStrStripL(a_rValue.c_str()), 10, &m_iValue); 602 /** @todo RTStrStripL and RTStrToInt32Full has a different idea what consitutes spaces... */ 603 int rc = RTStrToInt32Full(RTStrStripL(a_rValue.c_str()), 0, &m_iValue); 604 604 if (rc == VINF_SUCCESS || rc == VERR_TRAILING_SPACES) 605 605 return VINF_SUCCESS; … … 743 743 m_iValue = 1; 744 744 745 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for 16-bit integer",745 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_INTEGER, "wrong JSON type %s for 16-bit integer", 746 746 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 747 747 } … … 770 770 m_fNullIndicator = false; 771 771 772 int rc = RTStrToInt16Full(RTStrStripL(a_rValue.c_str()), 10, &m_iValue); 772 /** @todo RTStrStripL and RTStrToInt16Full has a different idea what consitutes spaces... */ 773 int rc = RTStrToInt16Full(RTStrStripL(a_rValue.c_str()), 0, &m_iValue); 773 774 if (rc == VINF_SUCCESS || rc == VERR_TRAILING_SPACES) 774 775 return VINF_SUCCESS; … … 930 931 m_rdValue = 1.0; 931 932 932 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for a double",933 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_DOUBLE, "wrong JSON type %s for a double", 933 934 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 934 935 } … … 1118 1119 } 1119 1120 1120 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for string",1121 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_STRING, "wrong JSON type %s for string", 1121 1122 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 1122 1123 } … … 1264 1265 } 1265 1266 1266 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type for date: %s",1267 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_DATE, "wrong JSON type for date: %s", 1267 1268 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 1268 1269 } … … 1676 1677 } 1677 1678 1678 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_ WRONG_TYPE, "wrong JSON type %s for string/enum",1679 return a_rCursor.m_pPrimary->addError(a_rCursor, VERR_REST_WRONG_JSON_TYPE_FOR_STRING, "wrong JSON type %s for string/enum", 1679 1680 RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue))); 1680 1681 } -
trunk/src/VBox/Runtime/testcase/Makefile.kmk
r74094 r74161 56 56 tstRTCrX509-1 \ 57 57 tstRTCType \ 58 tstRTCRest-1 \ 58 59 tstRTDigest \ 59 60 tstRTDigest-2 \ … … 308 309 tstRTCType_SOURCES = tstRTCType.cpp 309 310 311 tstRTCRest-1_TEMPLATE = VBOXR3TSTEXE 312 tstRTCRest-1_SOURCES = tstRTCRest-1.cpp 313 310 314 tstRTDigest_TEMPLATE = VBOXR3TSTEXE 311 315 tstRTDigest_SOURCES = tstRTDigest.cpp
Note:
See TracChangeset
for help on using the changeset viewer.