VirtualBox

Ignore:
Timestamp:
Sep 10, 2018 9:44:58 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124949
Message:

IPRT/rest: Added unittest for RTCRestString. Addressing a few issues. bugref:9167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rest/rest-primary-object-types.cpp

    r74170 r74176  
    10731073int RTCRestString::assignCopy(RTCRestString const &a_rThat)
    10741074{
     1075    int rc = assignNoThrow(a_rThat);
    10751076    m_fNullIndicator = a_rThat.m_fNullIndicator;
    1076     return assignNoThrow(a_rThat);
     1077    return rc;
    10771078}
    10781079
     
    11111112{
    11121113    if (!m_fNullIndicator)
    1113         a_rDst.printf("%RMjs", m_psz);
     1114        a_rDst.printf("%RMjs", m_psz ? m_psz : "");
    11141115    else
    11151116        a_rDst.printf("null");
     
    11751176{
    11761177    return "RTCString";
     1178}
     1179
     1180
     1181int RTCRestString::assignNoThrow(const RTCString &a_rSrc) RT_NOEXCEPT
     1182{
     1183    m_fNullIndicator = false;
     1184    return RTCString::assignNoThrow(a_rSrc);
     1185}
     1186
     1187
     1188int RTCRestString::assignNoThrow(const char *a_pszSrc) RT_NOEXCEPT
     1189{
     1190    m_fNullIndicator = false;
     1191    return RTCString::assignNoThrow(a_pszSrc);
     1192}
     1193
     1194
     1195int RTCRestString::assignNoThrow(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc /*= npos*/) RT_NOEXCEPT
     1196{
     1197    m_fNullIndicator = false;
     1198    return RTCString::assignNoThrow(a_rSrc, a_offSrc, a_cchSrc);
     1199}
     1200
     1201
     1202int RTCRestString::assignNoThrow(const char *a_pszSrc, size_t a_cchSrc) RT_NOEXCEPT
     1203{
     1204    m_fNullIndicator = false;
     1205    return RTCString::assignNoThrow(a_pszSrc, a_cchSrc);
     1206}
     1207
     1208
     1209int RTCRestString::assignNoThrow(size_t a_cTimes, char a_ch) RT_NOEXCEPT
     1210{
     1211    m_fNullIndicator = false;
     1212    return RTCString::assignNoThrow(a_cTimes, a_ch);
     1213}
     1214
     1215
     1216int RTCRestString::printfNoThrow(const char *pszFormat, ...) RT_NOEXCEPT
     1217{
     1218    m_fNullIndicator = false;
     1219    va_list va;
     1220    va_start(va, pszFormat);
     1221    int rc = RTCString::printfVNoThrow(pszFormat, va);
     1222    va_end(va);
     1223    return rc;
     1224}
     1225
     1226
     1227int RTCRestString::printfVNoThrow(const char *pszFormat, va_list va) RT_NOEXCEPT
     1228{
     1229    m_fNullIndicator = false;
     1230    return RTCString::printfVNoThrow(pszFormat, va);
     1231}
     1232
     1233
     1234RTCRestString &RTCRestString::operator=(const char *a_pcsz)
     1235{
     1236    m_fNullIndicator = false;
     1237    RTCString::operator=(a_pcsz);
     1238    return *this;
     1239}
     1240
     1241
     1242RTCRestString &RTCRestString::operator=(const RTCString &a_rThat)
     1243{
     1244    m_fNullIndicator = false;
     1245    RTCString::operator=(a_rThat);
     1246    return *this;
     1247}
     1248
     1249
     1250RTCRestString &RTCRestString::operator=(const RTCRestString &a_rThat)
     1251{
     1252    m_fNullIndicator = a_rThat.m_fNullIndicator;
     1253    RTCString::operator=(a_rThat);
     1254    return *this;
     1255}
     1256
     1257
     1258RTCRestString &RTCRestString::assign(const RTCString &a_rSrc)
     1259{
     1260    m_fNullIndicator = false;
     1261    RTCString::assign(a_rSrc);
     1262    return *this;
     1263}
     1264
     1265
     1266RTCRestString &RTCRestString::assign(const char *a_pszSrc)
     1267{
     1268    m_fNullIndicator = false;
     1269    RTCString::assign(a_pszSrc);
     1270    return *this;
     1271}
     1272
     1273
     1274RTCRestString &RTCRestString::assign(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc /*= npos*/)
     1275{
     1276    m_fNullIndicator = false;
     1277    RTCString::assign(a_rSrc, a_offSrc, a_cchSrc);
     1278    return *this;
     1279}
     1280
     1281
     1282RTCRestString &RTCRestString::assign(const char *a_pszSrc, size_t a_cchSrc)
     1283{
     1284    m_fNullIndicator = false;
     1285    RTCString::assign(a_pszSrc, a_cchSrc);
     1286    return *this;
     1287}
     1288
     1289
     1290RTCRestString &RTCRestString::assign(size_t a_cTimes, char a_ch)
     1291{
     1292    m_fNullIndicator = false;
     1293    RTCString::assign(a_cTimes, a_ch);
     1294    return *this;
     1295}
     1296
     1297
     1298RTCRestString &RTCRestString::printf(const char *pszFormat, ...)
     1299{
     1300    m_fNullIndicator = false;
     1301    va_list va;
     1302    va_start(va, pszFormat);
     1303    RTCString::printfV(pszFormat, va);
     1304    va_end(va);
     1305    return *this;
     1306}
     1307
     1308
     1309RTCRestString &RTCRestString::printfV(const char *pszFormat, va_list va)
     1310{
     1311    m_fNullIndicator = false;
     1312    RTCString::printfV(pszFormat, va);
     1313    return *this;
    11771314}
    11781315
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette