[Git][wxwidgets/wxwidgets][master] 4 commits: Fix webkit2_ext installation directory with CMake

0 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Sep 1, 2025, 8:19:57 PM (6 days ago) Sep 1
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 13943013
    by Chris Mayo at 2025-08-31T23:54:35+02:00
    Fix webkit2_ext installation directory with CMake
    
    Don't hardcode "lib" for this target, use wxBUILD_INSTALL_LIBRARY_DIR.
    
    Closes #25736.
    
  • 085088ef
    by Václav Slavík at 2025-08-31T23:56:25+02:00
    Fix wxNotebook tabs appearance on macOS 26
    
    On macOS 26 Tahoe, just the mere presence of drawRect: in class derived
    from NSTabView prevents native appearance rendering and triggers legacy
    appearance code path.
    
    This isn't caused by wx's handling of drawRect:, but really by just its
    presence. Even applying this change and adding a minimal
    
        - (void)drawRect:(NSRect)dirtyRect
        {
            [super drawRect:dirtyRect];
        }
    
    to wxNSTabView reintroduces the bad rendering. In other words, there's
    nothing else to be done other than using wxOSXSKIP_DRAW.
    
    Closes #25743.
    
  • c2d1c9f7
    by Blake-Madden at 2025-09-01T15:23:25+02:00
    Upgrade Base64 tests to Catch2
    
    No real changes, just remove the CppUnit-compatible macros.
    
    Closes #25747.
    
  • 170c3863
    by Vadim Zeitlin at 2025-09-02T01:34:53+02:00
    Fix check for extended locale functions in CMake
    
    HAVE_LOCALE_T is misnamed, as it must only be defined not just when
    locale_t type is available but when the functions using it, such as
    strxxx_l(), are available.
    
    Due to the confusion about the nature of this symbol, CMake didn't check
    for it correctly and only checked for its existence, but musl (used by
    e.g. Alpine) does define the type without providing any of the functions
    using it, which resulted in build errors later.
    
    Fix this by checking for both the type and the functions in CMake too,
    just as we do in configure.
    
    Closes #25749.
    
    See #25750.
    

4 changed files:

Changes:

  • build/cmake/lib/webview/CMakeLists.txt
    ... ... @@ -153,7 +153,9 @@ if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
    153 153
             ${WEBKIT2_LIBRARIES}
    
    154 154
             )
    
    155 155
     
    
    156
    -    wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION "lib/wx/${WX_WEB_EXT_VERSION}/web-extensions")
    
    156
    +    wx_get_install_dir(library "lib")
    
    157
    +
    
    158
    +    wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION "${library_dir}/wx/${WX_WEB_EXT_VERSION}/web-extensions")
    
    157 159
     
    
    158 160
         wx_add_dependencies(wxwebview wxwebkit2_ext)
    
    159 161
     endif()

  • build/cmake/setup.cmake
    ... ... @@ -587,13 +587,20 @@ if(wxUSE_FSWATCHER)
    587 587
     endif()
    
    588 588
     
    
    589 589
     if(wxUSE_XLOCALE)
    
    590
    +    list(APPEND xlocale_headers locale.h stdlib.h)
    
    590 591
         check_include_file(xlocale.h HAVE_XLOCALE_H)
    
    591
    -    set(CMAKE_EXTRA_INCLUDE_FILES locale.h)
    
    592 592
         if(HAVE_XLOCALE_H)
    
    593
    -        list(APPEND CMAKE_EXTRA_INCLUDE_FILES xlocale.h)
    
    593
    +        list(APPEND xlocale_headers xlocale.h)
    
    594 594
         endif()
    
    595
    -    check_type_size(locale_t LOCALE_T)
    
    596
    -    set(CMAKE_EXTRA_INCLUDE_FILES)
    
    595
    +    wx_check_c_source_compiles("
    
    596
    +        locale_t t;
    
    597
    +        strtod_l(NULL, NULL, t);
    
    598
    +        strtol_l(NULL, NULL, 0, t);
    
    599
    +        strtoul_l(NULL, NULL, 0, t);
    
    600
    +"
    
    601
    +        HAVE_LOCALE_T
    
    602
    +        ${xlocale_headers}
    
    603
    +        )
    
    597 604
     endif()
    
    598 605
     
    
    599 606
     # Check sizes of various types
    

  • src/osx/cocoa/notebook.mm
    ... ... @@ -23,6 +23,7 @@
    23 23
     #include "wx/string.h"
    
    24 24
     #include "wx/private/bmpbndl.h"
    
    25 25
     #include "wx/osx/private.h"
    
    26
    +#include "wx/osx/private/available.h"
    
    26 27
     
    
    27 28
     //
    
    28 29
     // controller
    
    ... ... @@ -86,7 +87,18 @@
    86 87
         if (!initialized)
    
    87 88
         {
    
    88 89
             initialized = YES;
    
    89
    -        wxOSXCocoaClassAddWXMethods( self );
    
    90
    +
    
    91
    +        // On macOS 26 Tahoe, the mere presence of drawRect: in derived class,
    
    92
    +        // even if it just calls super's implementation, triggers legacy
    
    93
    +        // rendering of NSTabView.
    
    94
    +        if (WX_IS_MACOS_AVAILABLE(26, 0))
    
    95
    +        {
    
    96
    +            wxOSXCocoaClassAddWXMethods(self, wxOSXSKIP_DRAW);
    
    97
    +        }
    
    98
    +        else
    
    99
    +        {
    
    100
    +            wxOSXCocoaClassAddWXMethods(self);
    
    101
    +        }
    
    90 102
         }
    
    91 103
     }
    
    92 104
     
    

  • tests/base64/base64.cpp
    ... ... @@ -69,238 +69,197 @@ static void generateGibberish(void* buff, size_t len)
    69 69
     // test class
    
    70 70
     // --------------------------------------------------------------------------
    
    71 71
     
    
    72
    -class Base64TestCase : public CppUnit::TestCase
    
    73
    -{
    
    74
    -public:
    
    75
    -    Base64TestCase() { }
    
    76
    -
    
    77
    -private:
    
    78
    -    CPPUNIT_TEST_SUITE( Base64TestCase );
    
    79
    -        CPPUNIT_TEST( EncodeDecodeEmpty );
    
    80
    -        CPPUNIT_TEST( EncodeDecodeA );
    
    81
    -        CPPUNIT_TEST( EncodeDecodeAB );
    
    82
    -        CPPUNIT_TEST( EncodeDecodeABC );
    
    83
    -        CPPUNIT_TEST( EncodeDecodeABCD );
    
    84
    -        CPPUNIT_TEST( EncodeDecode0to255 );
    
    85
    -        CPPUNIT_TEST( EncodeDecodePatternA );
    
    86
    -        CPPUNIT_TEST( EncodeDecodePatternB );
    
    87
    -        CPPUNIT_TEST( EncodeDecodePatternC );
    
    88
    -        CPPUNIT_TEST( EncodeDecodeRandom );
    
    89
    -        CPPUNIT_TEST( DecodeInvalid );
    
    90
    -    CPPUNIT_TEST_SUITE_END();
    
    91
    -
    
    92
    -    void EncodeDecodeEmpty();
    
    93
    -    void EncodeDecodeA();
    
    94
    -    void EncodeDecodeAB();
    
    95
    -    void EncodeDecodeABC();
    
    96
    -    void EncodeDecodeABCD();
    
    97
    -    void EncodeDecode0to255();
    
    98
    -    void EncodeDecodePatternA();
    
    99
    -    void EncodeDecodePatternB();
    
    100
    -    void EncodeDecodePatternC();
    
    101
    -    void EncodeDecodeRandom();
    
    102
    -    void DecodeInvalid();
    
    103
    -
    
    104
    -    wxDECLARE_NO_COPY_CLASS(Base64TestCase);
    
    105
    -};
    
    106
    -
    
    107
    -// register in the unnamed registry so that these tests are run by default
    
    108
    -CPPUNIT_TEST_SUITE_REGISTRATION( Base64TestCase );
    
    109
    -
    
    110
    -// also include in its own registry so that these tests can be run alone
    
    111
    -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( Base64TestCase, "Base64TestCase" );
    
    112
    -
    
    113
    -void Base64TestCase::EncodeDecodeEmpty()
    
    72
    +TEST_CASE("Encode Decode Empty", "[base64]")
    
    114 73
     {
    
    115 74
         char shouldBeEmpty[10];
    
    116 75
         shouldBeEmpty[0] = '\0';
    
    117 76
         size_t len = 10;
    
    118 77
     
    
    119
    -    CPPUNIT_ASSERT(wxBase64Encode(shouldBeEmpty, len, "", 0) != wxCONV_FAILED);
    
    120
    -    CPPUNIT_ASSERT_EQUAL('\0', shouldBeEmpty[0]);
    
    78
    +    CHECK( wxBase64Encode(shouldBeEmpty, len, "", 0) != wxCONV_FAILED );
    
    79
    +    CHECK( shouldBeEmpty[0] == '\0' );
    
    121 80
     
    
    122
    -    CPPUNIT_ASSERT(wxBase64Decode(shouldBeEmpty, len, "") != wxCONV_FAILED);
    
    123
    -    CPPUNIT_ASSERT_EQUAL('\0', shouldBeEmpty[0]);
    
    81
    +    CHECK( wxBase64Decode(shouldBeEmpty, len, "") != wxCONV_FAILED );
    
    82
    +    CHECK( shouldBeEmpty[0] == '\0' );
    
    124 83
     
    
    125 84
         wxMemoryBuffer bufmt;
    
    126 85
         wxString resultEmpty = wxBase64Encode(bufmt);
    
    127
    -    CPPUNIT_ASSERT(resultEmpty.empty());
    
    86
    +    CHECK( resultEmpty.empty() );
    
    128 87
     
    
    129 88
         bufmt = wxBase64Decode(resultEmpty);
    
    130
    -    CPPUNIT_ASSERT_EQUAL(0, bufmt.GetDataLen());
    
    89
    +    CHECK( bufmt.GetDataLen() == 0 );
    
    131 90
     }
    
    132 91
     
    
    133
    -void Base64TestCase::EncodeDecodeA()
    
    92
    +TEST_CASE("Encode Decode A", "[base64]")
    
    134 93
     {
    
    135 94
         const wxString str = wxBase64Encode("A", 1);
    
    136
    -    CPPUNIT_ASSERT_EQUAL(wxString("QQ=="), str);
    
    95
    +    CHECK( str == wxString("QQ==") );
    
    137 96
     
    
    138 97
         wxMemoryBuffer buf = wxBase64Decode(str);
    
    139
    -    CPPUNIT_ASSERT_EQUAL(1, buf.GetDataLen());
    
    140
    -    CPPUNIT_ASSERT_EQUAL('A', *(char *)buf.GetData());
    
    98
    +    CHECK(buf.GetDataLen() == 1);
    
    99
    +    CHECK( *(char*)buf.GetData() == 'A' );
    
    141 100
     
    
    142 101
         char cbuf[10];
    
    143 102
         memset(cbuf, (char)-1, sizeof(cbuf));
    
    144
    -    CPPUNIT_ASSERT_EQUAL( 1, wxBase64Decode(cbuf, 1, str) );
    
    145
    -    CPPUNIT_ASSERT_EQUAL( 'A', cbuf[0] );
    
    146
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[1] );
    
    147
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[2] );
    
    103
    +    CHECK(wxBase64Decode(cbuf, 1, str) == 1);
    
    104
    +    CHECK( cbuf[0] == 'A' );
    
    105
    +    CHECK( cbuf[1] == (char)-1 );
    
    106
    +    CHECK( cbuf[2] == (char)-1 );
    
    148 107
     }
    
    149 108
     
    
    150
    -void Base64TestCase::EncodeDecodeAB()
    
    109
    +TEST_CASE("Encode Decode AB", "[base64]")
    
    151 110
     {
    
    152 111
         const wxString str = wxBase64Encode("AB", 2);
    
    153
    -    CPPUNIT_ASSERT_EQUAL(wxString("QUI="), str);
    
    112
    +    CHECK( str == wxString("QUI=") );
    
    154 113
     
    
    155 114
         wxMemoryBuffer buf = wxBase64Decode(str);
    
    156
    -    CPPUNIT_ASSERT_EQUAL(2, buf.GetDataLen());
    
    157
    -    CPPUNIT_ASSERT_EQUAL('A', buf[0]);
    
    158
    -    CPPUNIT_ASSERT_EQUAL('B', buf[1]);
    
    115
    +    CHECK( buf.GetDataLen() == 2 );
    
    116
    +    CHECK( buf[0] == 'A' );
    
    117
    +    CHECK( buf[1] == 'B' );
    
    159 118
     
    
    160 119
         char cbuf[10];
    
    161 120
         memset(cbuf, (char)-1, sizeof(cbuf));
    
    162
    -    CPPUNIT_ASSERT_EQUAL( wxCONV_FAILED, wxBase64Decode(cbuf, 1, str) );
    
    163
    -    CPPUNIT_ASSERT_EQUAL( 2, wxBase64Decode(cbuf, 2, str) );
    
    164
    -    CPPUNIT_ASSERT_EQUAL( 'A', cbuf[0] );
    
    165
    -    CPPUNIT_ASSERT_EQUAL( 'B', cbuf[1] );
    
    166
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[2] );
    
    167
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[3] );
    
    121
    +    CHECK( wxBase64Decode(cbuf, 1, str) == wxCONV_FAILED);
    
    122
    +    CHECK( wxBase64Decode(cbuf, 2, str) == 2 );
    
    123
    +    CHECK( cbuf[0] == 'A' );
    
    124
    +    CHECK( cbuf[1] == 'B' );
    
    125
    +    CHECK( cbuf[2] == (char)-1 );
    
    126
    +    CHECK( cbuf[3] == (char)-1 );
    
    168 127
     }
    
    169 128
     
    
    170
    -void Base64TestCase::EncodeDecodeABC()
    
    129
    +TEST_CASE("Encode Decode ABC", "[base64]")
    
    171 130
     {
    
    172 131
         const wxString str = wxBase64Encode("ABC", 3);
    
    173
    -    CPPUNIT_ASSERT_EQUAL(wxString("QUJD"), str);
    
    132
    +    CHECK( str == wxString("QUJD") );
    
    174 133
     
    
    175 134
         wxMemoryBuffer buf = wxBase64Decode(str);
    
    176
    -    CPPUNIT_ASSERT_EQUAL(3, buf.GetDataLen());
    
    177
    -    CPPUNIT_ASSERT_EQUAL('A', buf[0]);
    
    178
    -    CPPUNIT_ASSERT_EQUAL('B', buf[1]);
    
    179
    -    CPPUNIT_ASSERT_EQUAL('C', buf[2]);
    
    135
    +    CHECK( buf.GetDataLen() == 3 );
    
    136
    +    CHECK( buf[0] == 'A' );
    
    137
    +    CHECK( buf[1] == 'B' );
    
    138
    +    CHECK( buf[2] == 'C' );
    
    180 139
     
    
    181 140
         char cbuf[10];
    
    182 141
         memset(cbuf, (char)-1, sizeof(cbuf));
    
    183
    -    CPPUNIT_ASSERT_EQUAL( wxCONV_FAILED, wxBase64Decode(cbuf, 2, str) );
    
    184
    -    CPPUNIT_ASSERT_EQUAL( 3, wxBase64Decode(cbuf, 3, str) );
    
    185
    -    CPPUNIT_ASSERT_EQUAL( 'A', cbuf[0] );
    
    186
    -    CPPUNIT_ASSERT_EQUAL( 'B', cbuf[1] );
    
    187
    -    CPPUNIT_ASSERT_EQUAL( 'C', cbuf[2] );
    
    188
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[3] );
    
    189
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[4] );
    
    142
    +    CHECK( wxBase64Decode(cbuf, 2, str) == wxCONV_FAILED );
    
    143
    +    CHECK( wxBase64Decode(cbuf, 3, str) == 3 );
    
    144
    +    CHECK( cbuf[0] == 'A' );
    
    145
    +    CHECK( cbuf[1] == 'B' );
    
    146
    +    CHECK( cbuf[2] == 'C' );
    
    147
    +    CHECK( cbuf[3] == (char)-1 );
    
    148
    +    CHECK( cbuf[4] == (char)-1 );
    
    190 149
     }
    
    191 150
     
    
    192
    -void Base64TestCase::EncodeDecodeABCD()
    
    151
    +TEST_CASE("Encode Decode ABCD", "[base64]")
    
    193 152
     {
    
    194 153
         const wxString str = wxBase64Encode("ABCD", 4);
    
    195
    -    CPPUNIT_ASSERT_EQUAL(wxString("QUJDRA=="), str);
    
    154
    +    CHECK( str == wxString("QUJDRA==") );
    
    196 155
     
    
    197 156
         wxMemoryBuffer buf = wxBase64Decode(str);
    
    198
    -    CPPUNIT_ASSERT_EQUAL(4, buf.GetDataLen());
    
    199
    -    CPPUNIT_ASSERT_EQUAL('A', buf[0]);
    
    200
    -    CPPUNIT_ASSERT_EQUAL('B', buf[1]);
    
    201
    -    CPPUNIT_ASSERT_EQUAL('C', buf[2]);
    
    202
    -    CPPUNIT_ASSERT_EQUAL('D', buf[3]);
    
    157
    +    CHECK( buf.GetDataLen() == 4 );
    
    158
    +    CHECK( buf[0] == 'A' );
    
    159
    +    CHECK( buf[1] == 'B' );
    
    160
    +    CHECK( buf[2] == 'C' );
    
    161
    +    CHECK( buf[3] == 'D' );
    
    203 162
     
    
    204 163
         char cbuf[10];
    
    205 164
         memset(cbuf, (char)-1, sizeof(cbuf));
    
    206
    -    CPPUNIT_ASSERT_EQUAL( wxCONV_FAILED, wxBase64Decode(cbuf, 3, str) );
    
    207
    -    CPPUNIT_ASSERT_EQUAL( 4, wxBase64Decode(cbuf, 4, str) );
    
    208
    -    CPPUNIT_ASSERT_EQUAL( 'A', cbuf[0] );
    
    209
    -    CPPUNIT_ASSERT_EQUAL( 'B', cbuf[1] );
    
    210
    -    CPPUNIT_ASSERT_EQUAL( 'C', cbuf[2] );
    
    211
    -    CPPUNIT_ASSERT_EQUAL( 'D', cbuf[3] );
    
    212
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[4] );
    
    213
    -    CPPUNIT_ASSERT_EQUAL( (char)-1, cbuf[5] );
    
    165
    +    CHECK( wxBase64Decode(cbuf, 3, str) == wxCONV_FAILED );
    
    166
    +    CHECK( wxBase64Decode(cbuf, 4, str) == 4 );
    
    167
    +    CHECK( cbuf[0] == 'A' );
    
    168
    +    CHECK( cbuf[1] == 'B' );
    
    169
    +    CHECK( cbuf[2] == 'C' );
    
    170
    +    CHECK( cbuf[3] == 'D' );
    
    171
    +    CHECK( cbuf[4] == (char)-1 );
    
    172
    +    CHECK( cbuf[5] == (char)-1 );
    
    214 173
     }
    
    215 174
     
    
    216
    -void Base64TestCase::EncodeDecode0to255()
    
    175
    +TEST_CASE("Encode Decode 0 to 255", "[base64]")
    
    217 176
     {
    
    218 177
         unsigned char buff[256];
    
    219 178
         generatePatternedData(buff, 256, 0, 1);
    
    220 179
         wxString str = wxBase64Encode(buff, 256);
    
    221 180
         wxMemoryBuffer mbuff = wxBase64Decode(str);
    
    222
    -    CPPUNIT_ASSERT(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    181
    +    CHECK(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    223 182
     
    
    224 183
         mbuff = wxBase64Decode(encoded0to255);
    
    225
    -    CPPUNIT_ASSERT(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    184
    +    CHECK(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    226 185
     }
    
    227 186
     
    
    228
    -void Base64TestCase::EncodeDecodePatternA()
    
    187
    +TEST_CASE("Encode Decode Pattern A", "[base64]")
    
    229 188
     {
    
    230 189
         unsigned char buff[350];
    
    231 190
         generatePatternedData(buff, 350, 24, 5, 3);
    
    232 191
         wxString str = wxBase64Encode(buff, 350);
    
    233 192
         wxMemoryBuffer mbuff = wxBase64Decode(str);
    
    234
    -    CPPUNIT_ASSERT(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    193
    +    CHECK(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    235 194
     }
    
    236 195
     
    
    237
    -void Base64TestCase::EncodeDecodePatternB()
    
    196
    +TEST_CASE("Encode Decode Pattern B", "[base64]")
    
    238 197
     {
    
    239 198
         unsigned char buff[350];
    
    240 199
         generatePatternedData(buff, 350, 0, 1, 1, 0xAA);
    
    241 200
         wxString str = wxBase64Encode(buff, 350);
    
    242 201
         wxMemoryBuffer mbuff = wxBase64Decode(str);
    
    243
    -    CPPUNIT_ASSERT(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    202
    +    CHECK(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    244 203
     }
    
    245 204
     
    
    246
    -void Base64TestCase::EncodeDecodePatternC()
    
    205
    +TEST_CASE("Encode Decode PatternC", "[base64]")
    
    247 206
     {
    
    248 207
         unsigned char buff[11];
    
    249 208
         generatePatternedData(buff, 11, 1, 0, 2);
    
    250 209
         wxString str = wxBase64Encode(buff, 11);
    
    251 210
         wxMemoryBuffer mbuff = wxBase64Decode(str);
    
    252
    -    CPPUNIT_ASSERT(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    211
    +    CHECK(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    253 212
     }
    
    254 213
     
    
    255
    -void Base64TestCase::EncodeDecodeRandom()
    
    214
    +TEST_CASE("Encode Decode Random", "[base64]")
    
    256 215
     {
    
    257 216
         size_t size = (size_t)(rand() / (float)RAND_MAX * 3000. + 11);
    
    258 217
         unsigned char *buff = new unsigned char[size];
    
    259 218
         generateRandomData(buff, size);
    
    260 219
         wxString str = wxBase64Encode(buff, size);
    
    261 220
         wxMemoryBuffer mbuff = wxBase64Decode(str);
    
    262
    -    CPPUNIT_ASSERT(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    221
    +    CHECK(memcmp(mbuff.GetData(), buff, mbuff.GetDataLen()) == 0);
    
    263 222
     
    
    264 223
         generateGibberish(buff, size);
    
    265 224
         char *buff2 = new char[size];
    
    266 225
         size_t realsize = size;
    
    267
    -    CPPUNIT_ASSERT(wxBase64Decode(buff2, realsize, (char *)buff, size));
    
    268
    -    CPPUNIT_ASSERT(wxBase64Encode(buff2, size, buff2, realsize));
    
    226
    +    CHECK(wxBase64Decode(buff2, realsize, (char *)buff, size));
    
    227
    +    CHECK(wxBase64Encode(buff2, size, buff2, realsize));
    
    269 228
         delete[] buff2;
    
    270 229
         delete[] buff;
    
    271 230
     }
    
    272 231
     
    
    273
    -void Base64TestCase::DecodeInvalid()
    
    232
    +TEST_CASE("Decode Invalid", "[base64]")
    
    274 233
     {
    
    275 234
         size_t rc, posErr;
    
    276 235
         rc = wxBase64Decode(nullptr, 0, "one two!", wxNO_LEN,
    
    277 236
                             wxBase64DecodeMode_Strict, &posErr);
    
    278
    -    CPPUNIT_ASSERT_EQUAL( wxCONV_FAILED, rc);
    
    279
    -    CPPUNIT_ASSERT_EQUAL( 3, posErr );
    
    237
    +    CHECK( rc == wxCONV_FAILED );
    
    238
    +    CHECK( posErr == 3 );
    
    280 239
     
    
    281 240
         rc = wxBase64Decode(nullptr, 0, "one two!", wxNO_LEN,
    
    282 241
                             wxBase64DecodeMode_SkipWS, &posErr);
    
    283
    -    CPPUNIT_ASSERT_EQUAL( wxCONV_FAILED, rc);
    
    284
    -    CPPUNIT_ASSERT_EQUAL( 7, posErr );
    
    242
    +    CHECK( rc == wxCONV_FAILED );
    
    243
    +    CHECK( posErr == 7 );
    
    285 244
     
    
    286 245
         rc = wxBase64Decode(nullptr, 0, "? QQ==", wxNO_LEN,
    
    287 246
                             wxBase64DecodeMode_SkipWS, &posErr);
    
    288
    -    CPPUNIT_ASSERT_EQUAL( wxCONV_FAILED, rc);
    
    289
    -    CPPUNIT_ASSERT_EQUAL( 0, posErr );
    
    247
    +    CHECK( rc == wxCONV_FAILED );
    
    248
    +    CHECK( posErr == 0 );
    
    290 249
     
    
    291 250
         const size_t POS_INVALID = (size_t)-1;
    
    292 251
         posErr = POS_INVALID;
    
    293 252
         rc = wxBase64Decode(nullptr, 0, " QQ==", wxNO_LEN,
    
    294 253
                             wxBase64DecodeMode_SkipWS, &posErr);
    
    295
    -    CPPUNIT_ASSERT_EQUAL( 1, rc );
    
    296
    -    CPPUNIT_ASSERT_EQUAL( POS_INVALID, posErr );
    
    254
    +    CHECK( rc == 1 );
    
    255
    +    CHECK( posErr == POS_INVALID );
    
    297 256
     
    
    298 257
         rc = wxBase64Decode(nullptr, 0, "? QQ==", wxNO_LEN,
    
    299 258
                             wxBase64DecodeMode_Relaxed, &posErr);
    
    300
    -    CPPUNIT_ASSERT_EQUAL( 1, rc );
    
    301
    -    CPPUNIT_ASSERT_EQUAL( POS_INVALID, posErr );
    
    259
    +    CHECK( rc == 1);
    
    260
    +    CHECK( posErr == POS_INVALID );
    
    302 261
     
    
    303
    -    CPPUNIT_ASSERT( !wxBase64Decode("wxGetApp()").GetDataLen() );
    
    262
    +    CHECK( !wxBase64Decode("wxGetApp()").GetDataLen() );
    
    304 263
     }
    
    305 264
     
    
    306 265
     #endif // wxUSE_BASE64

Reply all
Reply to author
Forward
0 new messages