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

Function FL_TEST_FILE

tests/fl/stl/istream.cpp:12–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "fl/stl/strstream.h"
11
12FL_TEST_FILE(FL_FILEPATH) {
13
14// Test that fl::cin and fl::istream compile without errors
15
16FL_TEST_CASE("fl::istream basic instantiation compiles") {
17 // Test that we can create an istream instance
18 fl::istream test_stream;
19
20 // Test that global cin exists
21 fl::istream* cin_ptr = &fl::cin;
22 FL_CHECK(cin_ptr != nullptr);
23
24 // Test basic state methods compile
25 bool good = test_stream.good();
26 bool fail = test_stream.fail();
27 bool eof = test_stream.eof();
28 test_stream.clear();
29
30 // Suppress unused variable warnings
31 (void)good;
32 (void)fail;
33 (void)eof;
34
35 FL_CHECK(true); // If we got here, compilation succeeded
36}
37
38FL_TEST_CASE("fl::cin_real global instance compiles") {
39 // Test that we can use the fl::cin_real() function
40 fl::istream_real* cin_real_ptr = &fl::cin_real();
41 FL_CHECK(cin_real_ptr != nullptr);
42
43 // Test that we can call methods on cin_real()
44 bool cin_real_good = fl::cin_real().good();
45 bool cin_real_fail = fl::cin_real().fail();
46 bool cin_real_eof = fl::cin_real().eof();
47 fl::cin_real().clear();
48
49 // Suppress unused variable warnings
50 (void)cin_real_good;
51 (void)cin_real_fail;
52 (void)cin_real_eof;
53
54 FL_CHECK(true); // If we got here, cin_real() compiled and is accessible
55}
56
57FL_TEST_CASE("fl::istream input operators compile") {
58 fl::istream test_stream;
59
60 // Test all input operator overloads compile
61 fl::string str_val;
62 char char_val;
63 int8_t int8_val;
64 uint8_t uint8_val;
65 int16_t int16_val;
66 uint16_t uint16_val;
67 int32_t int32_val;
68 uint32_t uint32_val;
69 float float_val;

Callers

nothing calls this directly

Calls 15

clear_io_handlersFunction · 0.85
inject_available_handlerFunction · 0.85
inject_read_handlerFunction · 0.85
strcmpFunction · 0.85
availableFunction · 0.50
readFunction · 0.50
ApproxFunction · 0.50
goodMethod · 0.45
failMethod · 0.45
eofMethod · 0.45
clearMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected