VirtualBox

Ignore:
Timestamp:
Feb 14, 2009 8:21:46 AM (16 years ago)
Author:
vboxsync
Message:

RTBase64Decode testcase and bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstBase64.cpp

    r16762 r16763  
    3737#include <iprt/err.h>
    3838#include <iprt/initterm.h>
    39 
    40 struct TstI64
    41 {
    42     const char *psz;
    43     unsigned    uBase;
    44     int         rc;
    45     int64_t     Result;
    46 };
    47 
    48 struct TstU64
    49 {
    50     const char *psz;
    51     unsigned    uBase;
    52     int         rc;
    53     uint64_t    Result;
    54 };
    55 
    56 struct TstI32
    57 {
    58     const char *psz;
    59     unsigned    uBase;
    60     int         rc;
    61     int32_t     Result;
    62 };
    63 
    64 struct TstU32
    65 {
    66     const char *psz;
    67     unsigned    uBase;
    68     int         rc;
    69     uint32_t    Result;
    70 };
    71 
    72 
    73 #define TEST(Test, Type, Fmt, Fun, iTest) \
    74     do \
    75     { \
    76         Type Result; \
    77         int rc = Fun(Test.psz, NULL, Test.uBase, &Result); \
    78         if (Result != Test.Result) \
    79         { \
    80             RTPrintf("failure: '%s' -> " Fmt " expected " Fmt ". (%s/%u)\n", Test.psz, Result, Test.Result, #Fun, iTest); \
    81             cErrors++; \
    82         } \
    83         else if (rc != Test.rc) \
    84         { \
    85             RTPrintf("failure: '%s' -> rc=%Rrc expected %Rrc. (%s/%u)\n", Test.psz, rc, Test.rc, #Fun, iTest); \
    86             cErrors++; \
    87         } \
    88     } while (0)
    8939
    9040
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