MCPcopy Create free account
hub / github.com/FastLED/FastLED / FL_TEST_FILE

Function FL_TEST_FILE

tests/fl/stl/variant.cpp:13–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "fl/stl/unordered_map.h"
12
13FL_TEST_FILE(FL_FILEPATH) {
14
15
16// Test object that tracks construction/destruction for move semantics testing
17struct TrackedObject {
18 static int construction_count;
19 static int destruction_count;
20 static int move_construction_count;
21 static int copy_construction_count;
22
23 int value;
24 bool moved_from;
25
26 TrackedObject(int v = 0) : value(v), moved_from(false) {
27 construction_count++;
28 }
29
30 TrackedObject(const TrackedObject& other) : value(other.value), moved_from(false) {
31 copy_construction_count++;
32 }
33
34 TrackedObject(TrackedObject&& other) noexcept : value(other.value), moved_from(false) {
35 other.moved_from = true;
36 move_construction_count++;
37 }
38
39 TrackedObject& operator=(const TrackedObject& other) {
40 if (this != &other) {
41 value = other.value;
42 moved_from = false;
43 }
44 return *this;
45 }
46
47 TrackedObject& operator=(TrackedObject&& other) noexcept {
48 if (this != &other) {
49 value = other.value;
50 moved_from = false;
51 other.moved_from = true;
52 }
53 return *this;
54 }
55
56 ~TrackedObject() {
57 destruction_count++;
58 }
59
60 static void reset_counters() {
61 construction_count = 0;
62 destruction_count = 0;
63 move_construction_count = 0;
64 copy_construction_count = 0;
65 }
66};
67
68// Static member definitions
69int TrackedObject::construction_count = 0;
70int TrackedObject::destruction_count = 0;

Callers

nothing calls this directly

Calls 13

TrackedObjectClass · 0.85
isEmptyMethod · 0.80
stringClass · 0.50
emptyMethod · 0.45
use_countMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
resetMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected