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

Class TestItem

tests/misc/containers.cpp:256–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254// ============================================================================
255
256struct TestItem {
257 int value;
258 int move_count = 0;
259 int copy_count = 0;
260
261 TestItem() : value(0) {}
262 explicit TestItem(int v) : value(v) {}
263
264 // Move constructor - tracks moves
265 TestItem(TestItem&& other) noexcept
266 : value(other.value), move_count(other.move_count + 1) {
267 other.move_count++;
268 }
269
270 // Move assignment
271 TestItem& operator=(TestItem&& other) noexcept {
272 value = other.value;
273 move_count = other.move_count + 1;
274 other.move_count++;
275 return *this;
276 }
277
278 // Delete copy constructor - prevents accidental copies
279 TestItem(const TestItem&) = delete;
280 TestItem& operator=(const TestItem&) = delete;
281
282 // Equality for checking values
283 bool operator==(const TestItem& other) const {
284 return value == other.value;
285 }
286};
287
288// ============================================================================
289// COMPONENT 3: TEMPLATED VALIDATORS

Callers 5

test_pop_backFunction · 0.85
test_size_and_emptyFunction · 0.85
test_clearFunction · 0.85
test_pop_frontFunction · 0.85
test_insert_and_eraseFunction · 0.85

Calls

no outgoing calls

Tested by 5

test_pop_backFunction · 0.68
test_size_and_emptyFunction · 0.68
test_clearFunction · 0.68
test_pop_frontFunction · 0.68
test_insert_and_eraseFunction · 0.68