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

Function evilTestCase

integrationTest/main.cc:36–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34// forward decl
35struct NANO_LOG;
36static void
37evilTestCase(NANO_LOG* log) {
38 ////////
39 // Basic Tests
40 ////////
41 NANO_LOG(NOTICE, "Simple times");
42
43 NANO_LOG(NOTICE, "More simplicity");
44
45 NANO_LOG(NOTICE, "How about a number? %d", 1900);
46
47 NANO_LOG(NOTICE, "How about a second number? %d", 1901);
48
49 NANO_LOG(NOTICE, "How about a double? %lf", 0.11);
50
51 NANO_LOG(NOTICE, "How about a nice little string? %s", "Stephen Rocks!");
52
53 NANO_LOG(NOTICE, "A middle \"%s\" string?", "Stephen Rocks!");
54
55 NANO_LOG(NOTICE, "And another string? %s", "yolo swag! blah.");
56
57 NANO_LOG(NOTICE, "One that should be \"end\"? %s", "end\0 FAIL!!!");
58
59 int cnt = 2;
60 NANO_LOG(NOTICE, "Hello world number %d of %d (%0.2lf%%)! This is %s!", cnt, 10, 1.0*cnt/10, "Stephen");
61
62 NANO_LOG(NOTICE,
63 "This is a string of many strings, like %s, %s, and %s"
64 " with a number %d and a final string with spacers %*s",
65 "this one",
66 "this other one",
67 "this third one",
68 12345670,
69 20,
70 "far out");
71
72 void* pointer = (void*)0x7ffe075cbe7d;
73 const void* const_ptr = pointer;
74
75 NANO_LOG(NOTICE, "A const void* pointer %p", const_ptr);
76
77 NANO_LOG(NOTICE, "I'm a small log with a small %s", "string");
78
79 uint8_t small = 10;
80 uint16_t medium = 33;
81 uint32_t large = 99991;
82 uint64_t ultra_large = -1;
83
84 float Float = 121.121f;
85 double Double = 212.212;
86
87 NANO_LOG(NOTICE, "Let's try out all the types! "
88 "Pointer = %p! "
89 "uint8_t = %u! "
90 "uint16_t = %u! "
91 "uint32_t = %u! "
92 "uint64_t = %lu! "
93 "float = %f! "

Callers 1

mainFunction · 0.85

Calls 2

NANO_LOGClass · 0.85
hiddenInHeaderFilePrintFunction · 0.85

Tested by

no test coverage detected