• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 13704368534

06 Mar 2025 05:14PM UTC coverage: 58.859% (+0.01%) from 58.849%
13704368534

push

github

turleypol
added dynamic property which returns a pointer of the object instead of
a copy like the current imp.
needed to be able to eg store a vector

43 of 61 new or added lines in 2 files covered. (70.49%)

10 existing lines in 3 files now uncovered.

42431 of 72089 relevant lines covered (58.86%)

384179.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.36
/pol-core/pol/testing/testmisc.cpp
1
/** @file
2
 *
3
 * @par History
4
 */
5

6
#include <algorithm>
7
#include <array>
8
#include <cstring>
9
#include <limits>
10
#include <string>
11

12
#include "../../clib/logfacility.h"
13
#include "../../clib/rawtypes.h"
14
#include "../../plib/maptile.h"
15
#include "../dynproperties.h"
16
#include "../globals/uvars.h"
17
#include "../network/packethelper.h"
18
#include "../realms/realm.h"
19
#include "testenv.h"
20

21
#include <curl/curl.h>
22
#include <type_traits>
23

24
namespace Pol
25
{
26
namespace Testing
27
{
28
void dummy() {}
×
29

30
void map_test()
×
31
{
32
  Plib::MAPTILE_CELL cell = Core::gamestate.main_realm->getmaptile( Core::Pos2d( 1453, 1794 ) );
×
33
  INFO_PRINTLN( "{} {}", cell.landtile, cell.z );
×
34
}
×
35

36
void dynprops_test()
1✔
37
{
38
  struct VecTest
39
  {
40
    bool test = false;
41
  };
42
  class Test : public Core::DynamicPropsHolder
43
  {
44
  public:
45
    DYN_PROPERTY( armod, s16, Core::PROP_AR_MOD, 0 );
8✔
46
    DYN_PROPERTY( max_items, u32, Core::PROP_MAX_ITEMS_MOD, 0 );
47
    DYN_PROPERTY( itemname, std::string, Core::PROP_NAME_SUFFIX, "" );
8✔
48
    DYN_PROPERTY_REF( vec, std::vector<VecTest>, Core::PROP_PROCESS, std::vector<VecTest>{} );
9✔
49
  };
50
  Test h;
1✔
51
  if ( h.armod() || h.has_armod() )
1✔
52
  {
53
    INFO_PRINTLN( "initial ar {} {}", h.armod(), h.has_armod() );
×
54
    UnitTest::inc_failures();
×
55
  }
56
  else
57
    UnitTest::inc_successes();
1✔
58
  h.armod( 10 );
1✔
59
  if ( h.armod() != 10 || !h.has_armod() )
1✔
60
  {
61
    INFO_PRINTLN( "ar {} {}", h.armod(), h.has_armod() );
×
62
    UnitTest::inc_failures();
×
63
  }
64
  else
65
    UnitTest::inc_successes();
1✔
66
  h.armod( 0 );
1✔
67
  if ( h.armod() || h.has_armod() )
1✔
68
  {
69
    INFO_PRINTLN( "removed ar {} {}", h.armod(), h.has_armod() );
×
70
    UnitTest::inc_failures();
×
71
  }
72
  else
73
    UnitTest::inc_successes();
1✔
74

75
  if ( !h.itemname().empty() || h.has_itemname() )
1✔
76
  {
77
    INFO_PRINTLN( "initial name {} {}", h.itemname(), h.has_itemname() );
×
78
    UnitTest::inc_failures();
×
79
  }
80
  else
81
    UnitTest::inc_successes();
1✔
82
  h.itemname( "hello world" );
1✔
83
  if ( h.itemname() != "hello world" || !h.has_itemname() )
1✔
84
  {
85
    INFO_PRINTLN( "name {} {}", h.itemname(), h.has_itemname() );
×
86
    UnitTest::inc_failures();
×
87
  }
88
  else
89
    UnitTest::inc_successes();
1✔
90
  h.itemname( "" );
1✔
91
  if ( !h.itemname().empty() || h.has_itemname() )
1✔
92
  {
93
    INFO_PRINTLN( "removed name {} {}", h.itemname(), h.has_itemname() );
×
94
    UnitTest::inc_failures();
×
95
  }
96
  else
97
    UnitTest::inc_successes();
1✔
98

99
  if ( h.has_vec() )
1✔
100
  {
NEW
101
    INFO_PRINTLN( "testvec set" );
×
NEW
102
    UnitTest::inc_failures();
×
103
  }
104
  else
105
    UnitTest::inc_successes();
1✔
106
  if ( !h.vec()->empty() )
1✔
107
  {
NEW
108
    INFO_PRINTLN( "testvec not empty" );
×
NEW
109
    UnitTest::inc_failures();
×
110
  }
111
  else
112
    UnitTest::inc_successes();
1✔
113
  h.vec()->push_back( VecTest{ true } );
1✔
114
  if ( h.vec()->empty() )
1✔
115
  {
NEW
116
    INFO_PRINTLN( "testvec empty" );
×
NEW
117
    UnitTest::inc_failures();
×
118
  }
119
  else
120
    UnitTest::inc_successes();
1✔
121
  if ( !h.vec()->begin()->test )
1✔
122
  {
NEW
123
    INFO_PRINTLN( "testvec value false" );
×
NEW
124
    UnitTest::inc_failures();
×
125
  }
126
  else
127
    UnitTest::inc_successes();
1✔
128
  if ( !( *h.vec() )[0].test )
1✔
129
  {
NEW
130
    INFO_PRINTLN( "testvec value false" );
×
NEW
131
    UnitTest::inc_failures();
×
132
  }
133
  else
134
    UnitTest::inc_successes();
1✔
135
  if ( []( const auto& o ) { return o.vec()->empty(); }( h ) )
2✔
136
  {
NEW
137
    INFO_PRINTLN( "testvec const !empty" );
×
NEW
138
    UnitTest::inc_failures();
×
139
  }
140
  else
141
    UnitTest::inc_successes();
1✔
142
  h.clear_vec();
1✔
143
  if ( h.has_vec() )
1✔
144
  {
NEW
145
    INFO_PRINTLN( "testvec not cleared" );
×
NEW
146
    UnitTest::inc_failures();
×
147
  }
148
  else
149
    UnitTest::inc_successes();
1✔
150
}
1✔
151

152
void packet_test()
1✔
153
{
154
  using namespace Network;
155
  using namespace Network::PktHelper;
156
  auto debug = []( const PacketOut<PktOut_2F>& p )
×
157
  {
158
    std::string w;
×
159
    for ( auto& c : p->buffer )
×
160
    {
161
      w += fmt::format( "{:x} ", c );
×
162
    }
163
    INFO_PRINTLN( w );
×
164
  };
×
165
  auto test = [&]( const PacketOut<PktOut_2F>& p, const std::array<s8, 10>& a )
5✔
166
  {
167
    if ( std::equal( std::begin( p->buffer ), std::end( p->buffer ), std::begin( a ) ) )
5✔
168
      UnitTest::inc_successes();
5✔
169
    else
170
    {
171
      UnitTest::inc_failures();
×
172
      INFO_PRINTLN( "failed" );
×
173
      debug( p );
×
174
      std::string w;
×
175
      for ( auto& c : a )
×
176
      {
177
        w += fmt::format( "{:x} ", c );
×
178
      }
179
      INFO_PRINTLN( w );
×
180
    }
×
181
  };
5✔
182
  {
183
    PacketOut<PktOut_2F> p;  // size 10
1✔
184
    p->Write<s8>( 0x12 );
1✔
185
    p->Write<u8>( 0x21u );
1✔
186
    p->WriteFlipped<s8>( 0x12 );
1✔
187
    p->WriteFlipped<u8>( 0x21u );
1✔
188
    p->Write<u8>( 0u );
1✔
189
    std::array<s8, 10> a{ { 0x2f, 0x12, 0x21, 0x12, 0x21, 0, 0, 0, 0, 0 } };
1✔
190
    test( p, a );
1✔
191
  }
1✔
192
  {
193
    PacketOut<PktOut_2F> p;  // size 10
1✔
194
    p->Write<s16>( 0x1234 );
1✔
195
    p->Write<u16>( 0x4321u );
1✔
196
    p->WriteFlipped<s16>( 0x1234 );
1✔
197
    p->WriteFlipped<u16>( 0x4321u );
1✔
198
    p->Write<u8>( 0u );
1✔
199
    std::array<s8, 10> a{ { 0x2f, 0x34, 0x12, 0x21, 0x43, 0x12, 0x34, 0x43, 0x21, 0 } };
1✔
200
    test( p, a );
1✔
201
  }
1✔
202
  {
203
    PacketOut<PktOut_2F> p;  // size 10
1✔
204
    p->Write<s32>( 0x12344321 );
1✔
205
    p->Write<u32>( 0x12344321u );
1✔
206
    p->Write<u8>( 0u );
1✔
207
    std::array<s8, 10> a{ { 0x2f, 0x21, 0x43, 0x34, 0x12, 0x21, 0x43, 0x34, 0x12, 0 } };
1✔
208
    test( p, a );
1✔
209
  }
1✔
210
  {
211
    PacketOut<PktOut_2F> p;  // size 10
1✔
212
    p->WriteFlipped<s32>( 0x12344321 );
1✔
213
    p->WriteFlipped<u32>( 0x12344321u );
1✔
214
    p->Write<u8>( 0u );
1✔
215
    std::array<s8, 10> a{ { 0x2f, 0x12, 0x34, 0x43, 0x21, 0x12, 0x34, 0x43, 0x21, 0 } };
1✔
216
    test( p, a );
1✔
217
  }
1✔
218
  {
219
    PacketOut<PktOut_2F> p;  // size 10
1✔
220
    std::string s( "1234" );
1✔
221
    p->Write( s.c_str(), 4, false );
1✔
222
    u8 b[] = { 0x12, 0x34, 0x43, 0x21 };
1✔
223
    p->Write( b, 4 );
1✔
224
    p->Write<u8>( 0u );
1✔
225
    std::array<s8, 10> a{ { 0x2f, 0x31, 0x32, 0x33, 0x34, 0x12, 0x34, 0x43, 0x21, 0 } };
1✔
226
    test( p, a );
1✔
227
  }
1✔
228
}
1✔
229

230
void test_splitnamevalue( const std::string& istr, const std::string& exp_pn,
11✔
231
                          const std::string& exp_pv )
232
{
233
  std::string pn, pv;
11✔
234
  Clib::splitnamevalue( istr, pn, pv );
11✔
235
  if ( pn != exp_pn || pv != exp_pv )
11✔
236
  {
237
    INFO_PRINTLN( "splitnamevalue( \"{}\" ) fails!", istr );
×
238
    UnitTest::inc_failures();
×
239
  }
240
  else
241
    UnitTest::inc_successes();
11✔
242
}
11✔
243

244
void test_splitnamevalue()
1✔
245
{
246
  test_splitnamevalue( "a b", "a", "b" );
1✔
247
  test_splitnamevalue( "av bx", "av", "bx" );
1✔
248
  test_splitnamevalue( "nm=valu", "nm", "valu" );
1✔
249
  test_splitnamevalue( "nm:valu", "nm:valu", "" );
1✔
250
  test_splitnamevalue( "nm", "nm", "" );
1✔
251
  test_splitnamevalue( "  nm", "nm", "" );
1✔
252
  test_splitnamevalue( "  nm  ", "nm", "" );
1✔
253
  test_splitnamevalue( "  nm valu", "nm", "valu" );
1✔
254
  test_splitnamevalue( "  nm   value   ", "nm", "value" );
1✔
255
  test_splitnamevalue( "  nm  value is multiple words", "nm", "value is multiple words" );
1✔
256
  test_splitnamevalue( "  nm  value is multiple words\t ", "nm", "value is multiple words" );
1✔
257
}
1✔
258

259
void test_dqs( const std::string& in, const std::string& out )
4✔
260
{
261
  std::string tmp = in;
4✔
262
  Clib::decodequotedstring( tmp );
4✔
263
  if ( tmp != out )
4✔
264
  {
265
    INFO_PRINTLN( "decodequotedstring( {} ) fails!", in );
×
266
    UnitTest::inc_failures();
×
267
  }
268
  else
269
    UnitTest::inc_successes();
4✔
270

271
  Clib::encodequotedstring( tmp );
4✔
272
  if ( tmp != in )
4✔
273
  {
274
    INFO_PRINTLN( "encodequotedstring( {} ) fails!", out );
×
275
    UnitTest::inc_failures();
×
276
  }
277
  else
278
    UnitTest::inc_successes();
4✔
279
}
4✔
280

281
void test_convertquotedstring()
1✔
282
{
283
  test_dqs( "\"hi\"", "hi" );
1✔
284
  test_dqs( "\"hi \"", "hi " );
1✔
285
  test_dqs( "\" hi \"", " hi " );
1✔
286
  test_dqs( "\" \\\"hi\"", " \"hi" );
1✔
287
}
1✔
288

289
void test_sanitizeUnicodeWithIso()
1✔
290
{
291
  std::string input;
1✔
292
  std::string output;
1✔
293
  std::string expected;
1✔
294

295
  input = "Some weird characters: \xC3 \xD0 \xA9.";
1✔
296
  output = std::string( input );
1✔
297
  expected = "Some weird characters: Ã Ð ©.";
1✔
298
  Clib::sanitizeUnicodeWithIso( &output );
1✔
299
  if ( output != expected )
1✔
300
  {
301
    INFO_PRINTLN(
×
302
        "sanitizeUnicodeWithIso fails!\n"
303
        "\tinput:    {}\n"
304
        "\toutput:   {}\n"
305
        "\texpected: {}",
306
        input, output, expected );
307
    UnitTest::inc_failures();
×
308
  }
309
  else
310
    UnitTest::inc_successes();
1✔
311

312
  input = "Maybe someone just wants to say \xC3\xA4. Well, that is probably an acceptable loss.";
1✔
313
  output = std::string( input );
1✔
314
  expected = "Maybe someone just wants to say ä. Well, that is probably an acceptable loss.";
1✔
315
  Clib::sanitizeUnicodeWithIso( &output );
1✔
316
  if ( output != expected )
1✔
317
  {
318
    INFO_PRINTLN(
×
319
        "sanitizeUnicodeWithIso fails!\n"
320
        "\tinput:    {}\n"
321
        "\toutput:   {}\n"
322
        "\texpected: {}",
323
        input, output, expected );
324
    UnitTest::inc_failures();
×
325
  }
326
  else
327
    UnitTest::inc_successes();
1✔
328
}
1✔
329

330
void test_cp1252ToUtf8( const std::string& in, const std::string& expected )
1✔
331
{
332
  std::string converted = Clib::strCp1252ToUtf8( in );
1✔
333
  if ( converted != expected )
1✔
334
  {
335
    INFO_PRINTLN( "CP-1252 to UTF-8 conversion fails!" );
×
336
    UnitTest::inc_failures();
×
337
  }
338
  else
339
  {
340
    UnitTest::inc_successes();
1✔
341
  }
342
}
1✔
343

344
void test_utf8ToCp1252( const std::string& in, const std::string& expected )
1✔
345
{
346
  std::string converted = Clib::strUtf8ToCp1252( in );
1✔
347
  if ( converted != expected )
1✔
348
  {
349
    INFO_PRINTLN( "UTF-8 to CP-1252 conversion fails!" );
×
350
    UnitTest::inc_failures();
×
351
  }
352
  else
353
  {
354
    UnitTest::inc_successes();
1✔
355
  }
356
}
1✔
357

358
void test_encodingconversions()
1✔
359
{
360
  // All non-control characters in cp1252
361
  const unsigned char cp1252data[] = {
1✔
362
      0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
363
      0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
364
      0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
365
      0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c,
366
      0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,
367
      0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,
368
      0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
369
      0x8b, 0x8c, 0x8e, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c,
370
      0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac,
371
      0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb,
372
      0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca,
373
      0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
374
      0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8,
375
      0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
376
      0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff };
377

378
  // The same characters as above but encoded in UTF-8
379
  const unsigned char utf8data[] = {
1✔
380
      0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
381
      0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
382
      0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
383
      0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c,
384
      0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,
385
      0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,
386
      0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0xe2, 0x82, 0xac, 0xe2, 0x80, 0x9a, 0xc6, 0x92, 0xe2, 0x80,
387
      0x9e, 0xe2, 0x80, 0xa6, 0xe2, 0x80, 0xa0, 0xe2, 0x80, 0xa1, 0xcb, 0x86, 0xe2, 0x80, 0xb0,
388
      0xc5, 0xa0, 0xe2, 0x80, 0xb9, 0xc5, 0x92, 0xc5, 0xbd, 0xe2, 0x80, 0x98, 0xe2, 0x80, 0x99,
389
      0xe2, 0x80, 0x9c, 0xe2, 0x80, 0x9d, 0xe2, 0x80, 0xa2, 0xe2, 0x80, 0x93, 0xe2, 0x80, 0x94,
390
      0xcb, 0x9c, 0xe2, 0x84, 0xa2, 0xc5, 0xa1, 0xe2, 0x80, 0xba, 0xc5, 0x93, 0xc5, 0xbe, 0xc5,
391
      0xb8, 0xc2, 0xa0, 0xc2, 0xa1, 0xc2, 0xa2, 0xc2, 0xa3, 0xc2, 0xa4, 0xc2, 0xa5, 0xc2, 0xa6,
392
      0xc2, 0xa7, 0xc2, 0xa8, 0xc2, 0xa9, 0xc2, 0xaa, 0xc2, 0xab, 0xc2, 0xac, 0xc2, 0xad, 0xc2,
393
      0xae, 0xc2, 0xaf, 0xc2, 0xb0, 0xc2, 0xb1, 0xc2, 0xb2, 0xc2, 0xb3, 0xc2, 0xb4, 0xc2, 0xb5,
394
      0xc2, 0xb6, 0xc2, 0xb7, 0xc2, 0xb8, 0xc2, 0xb9, 0xc2, 0xba, 0xc2, 0xbb, 0xc2, 0xbc, 0xc2,
395
      0xbd, 0xc2, 0xbe, 0xc2, 0xbf, 0xc3, 0x80, 0xc3, 0x81, 0xc3, 0x82, 0xc3, 0x83, 0xc3, 0x84,
396
      0xc3, 0x85, 0xc3, 0x86, 0xc3, 0x87, 0xc3, 0x88, 0xc3, 0x89, 0xc3, 0x8a, 0xc3, 0x8b, 0xc3,
397
      0x8c, 0xc3, 0x8d, 0xc3, 0x8e, 0xc3, 0x8f, 0xc3, 0x90, 0xc3, 0x91, 0xc3, 0x92, 0xc3, 0x93,
398
      0xc3, 0x94, 0xc3, 0x95, 0xc3, 0x96, 0xc3, 0x97, 0xc3, 0x98, 0xc3, 0x99, 0xc3, 0x9a, 0xc3,
399
      0x9b, 0xc3, 0x9c, 0xc3, 0x9d, 0xc3, 0x9e, 0xc3, 0x9f, 0xc3, 0xa0, 0xc3, 0xa1, 0xc3, 0xa2,
400
      0xc3, 0xa3, 0xc3, 0xa4, 0xc3, 0xa5, 0xc3, 0xa6, 0xc3, 0xa7, 0xc3, 0xa8, 0xc3, 0xa9, 0xc3,
401
      0xaa, 0xc3, 0xab, 0xc3, 0xac, 0xc3, 0xad, 0xc3, 0xae, 0xc3, 0xaf, 0xc3, 0xb0, 0xc3, 0xb1,
402
      0xc3, 0xb2, 0xc3, 0xb3, 0xc3, 0xb4, 0xc3, 0xb5, 0xc3, 0xb6, 0xc3, 0xb7, 0xc3, 0xb8, 0xc3,
403
      0xb9, 0xc3, 0xba, 0xc3, 0xbb, 0xc3, 0xbc, 0xc3, 0xbd, 0xc3, 0xbe, 0xc3, 0xbf };
404

405
  std::string cp1252string( reinterpret_cast<const char*>( cp1252data ), sizeof( cp1252data ) );
1✔
406
  std::string utf8string( reinterpret_cast<const char*>( utf8data ), sizeof( utf8data ) );
1✔
407

408
  test_cp1252ToUtf8( cp1252string, utf8string );
1✔
409
  test_utf8ToCp1252( utf8string, cp1252string );
1✔
410
}
1✔
411

412
void test_curlfeatures()
1✔
413
{
414
  bool http{ false };
1✔
415
  bool https{ false };
1✔
416
  curl_version_info_data* data = curl_version_info( CURLVERSION_NOW );
1✔
417
  for ( int i = 0; data->protocols[i]; ++i )
21✔
418
  {
419
    INFO_PRINT( "{} ", data->protocols[i] );
20✔
420
    if ( std::string( data->protocols[i] ) == "https" )
20✔
421
      https = true;
1✔
422
    else if ( std::string( data->protocols[i] ) == "http" )
19✔
423
      http = true;
1✔
424
  }
425
  INFO_PRINTLN( "" );
1✔
426
  if ( !https || !http )
1✔
427
  {
428
    INFO_PRINTLN( "http(s) is not supported" );
×
429
    UnitTest::inc_failures();
×
430
  }
431
  else
432
    UnitTest::inc_successes();
1✔
433
}
1✔
434
}  // namespace Testing
435
}  // namespace Pol
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc