MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / testAllTheTypes

Function testAllTheTypes

integrationTest/main.cc:346–443  ·  view source on GitHub ↗

Test all possible specifiers (except %n) from http://www.cplusplus.com/reference/cstdio/printf/ (3/20/18)

Source from the content-addressed store, hash-verified

344// Test all possible specifiers (except %n) from
345// http://www.cplusplus.com/reference/cstdio/printf/ (3/20/18)
346void testAllTheTypes() {
347 NANO_LOG(WARNING,
348 "No Length=%d %i %u %o %x %x %f %F %e %E %g %G %a %A %c %s %p",
349 (int)-1,
350 (int)-2,
351 (unsigned int)3,
352 (unsigned int)4,
353 (unsigned int)5,
354 (unsigned int)6,
355 (double)7.0,
356 (double)8.0,
357 (double)9.0,
358 (double)10.0,
359 (double)11.0,
360 (double)12.0,
361 (double)13.0,
362 (double)14.0,
363 'a',
364 "abc",
365 (void*)0x1);
366
367 NANO_LOG(WARNING,
368 "hh=%hhd %hhi %hhu %hho %hhx %hhx",
369 (signed char)-1,
370 (signed char)-2,
371 (unsigned char)3,
372 (unsigned char)4,
373 (unsigned char)5,
374 (unsigned char)6);
375
376 NANO_LOG(WARNING,
377 "h=%hd %hi %hu %ho %hx %hx",
378 (short int)-20000,
379 (short int)-20001,
380 (unsigned short int)20002,
381 (unsigned short int)20003,
382 (unsigned short int)20004,
383 (unsigned short int)20005);
384
385 // const wchar_t *longString = L"asdf";
386 NANO_LOG(WARNING,
387 "l=%ld %li %lu %lo %lx %lx %%lc %%ls",
388 (long int)-(1 << 30),
389 (long int)-(1 << 30) -1 ,
390 ((unsigned long int)1UL<<30) + 2,
391 ((unsigned long int)1UL<<30) + 3,
392 ((unsigned long int)1UL<<30) + 4,
393 ((unsigned long int)1UL<<30) + 5);//,
394 // (wchar_t)'a',
395 // (const wchar_t*)longString);
396
397 NANO_LOG(WARNING,
398 "ll=%lld %lli %llu %llo %llx %llx",
399 (long long int)1LL<<60,
400 (long long int)-(1LL<<60),
401 (unsigned long long int)1UL<<60,
402 (unsigned long long int)1UL<<61,
403 (unsigned long long int)1UL<<62,

Callers 1

mainFunction · 0.85

Calls 1

NANO_LOGClass · 0.85

Tested by

no test coverage detected