VirtualBox

Changeset 21725 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jul 20, 2009 1:10:08 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50292
Message:

iprt: Added RTMpGetDescription.

Location:
trunk/src/VBox/Runtime
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r21714 r21725  
    304304        generic/RTLogWriteStdOut-generic.cpp \
    305305        generic/RTLogWriteUser-generic.cpp \
     306        generic/RTMpGetDescription-generic.cpp \
    306307        generic/RTTimerLRCreate-generic.cpp \
    307308        generic/mempool-generic.cpp \
  • trunk/src/VBox/Runtime/testcase/tstMp-1.cpp

    r12107 r21725  
    3535#include <iprt/cpuset.h>
    3636#include <iprt/err.h>
     37#include <iprt/initterm.h>
    3738#include <iprt/stream.h>
    38 #include <iprt/initterm.h>
     39#include <iprt/string.h>
    3940
    4041
     
    244245
    245246
     247    /* Find an online cpu for the next test. */
     248    RTCPUID idCpuOnline;
     249    for (idCpuOnline = 0; idCpuOnline < RTCPUSET_MAX_CPUS; idCpuOnline++)
     250        if (RTMpIsCpuOnline(idCpuOnline))
     251            break;
     252
     253    /*
     254     * Quick test of RTMpGetDescription.
     255     */
     256    char szBuf[64];
     257    int rc = RTMpGetDescription(idCpuOnline, &szBuf[0], sizeof(szBuf));
     258    if (RT_SUCCESS(rc))
     259    {
     260        RTPrintf("tstMp-1: RTMpGetDescription -> '%s'\n", szBuf);
     261
     262        size_t cch = strlen(szBuf);
     263        rc = RTMpGetDescription(idCpuOnline, &szBuf[0], cch);
     264        if (rc != VERR_BUFFER_OVERFLOW)
     265        {
     266            RTPrintf("tstMp-1: FAILURE: RTMpGetDescription -> %Rrc, expected VERR_BUFFER_OVERFLOW\n", rc);
     267            g_cErrors++;
     268        }
     269        rc = RTMpGetDescription(idCpuOnline, &szBuf[0], cch + 1);
     270        if (RT_FAILURE(rc))
     271        {
     272            RTPrintf("tstMp-1: FAILURE: RTMpGetDescription -> %Rrc, expected VINF_SUCCESS\n", rc);
     273            g_cErrors++;
     274        }
     275    }
     276    else
     277    {
     278        RTPrintf("tstMp-1: FAILURE: RTMpGetDescription -> %Rrc\n", rc);
     279        g_cErrors++;
     280    }
     281
    246282
    247283    if (!g_cErrors)
Note: See TracChangeset for help on using the changeset viewer.

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