| 98 | } // namespace |
| 99 | |
| 100 | void TestSession() { |
| 101 | // We define local variables for all types for which we want to test |
| 102 | // pretty-printing. |
| 103 | // Then, at the end of this function, we trap to the debugger, so that |
| 104 | // test instrumentation can print values from this frame by interacting |
| 105 | // with the debugger. |
| 106 | // The test instrumentation is in pyarrow/tests/test_gdb.py |
| 107 | |
| 108 | #ifdef __clang__ |
| 109 | _Pragma("clang diagnostic push"); |
| 110 | _Pragma("clang diagnostic ignored \"-Wunused-variable\""); |
| 111 | #elif defined(__GNUC__) |
| 112 | _Pragma("GCC diagnostic push"); |
| 113 | _Pragma("GCC diagnostic ignored \"-Wunused-variable\""); |
| 114 | #endif |
| 115 | |
| 116 | arrow::DummyFunction(); |
| 117 | |
| 118 | // Status & Result |
| 119 | auto ok_status = Status::OK(); |
| 120 | auto error_status = Status::IOError("This is an error"); |
| 121 | auto error_detail_status = |
| 122 | error_status.WithDetail(std::make_shared<CustomStatusDetail>()); |
| 123 | auto ok_result = Result<int>(42); |
| 124 | auto error_result = Result<int>(error_status); |
| 125 | auto error_detail_result = Result<int>(error_detail_status); |
| 126 | |
| 127 | // String views |
| 128 | std::string_view string_view_abc{"abc"}; |
| 129 | std::string special_chars = std::string("foo\"bar") + '\x00' + "\r\n\t\x1f"; |
| 130 | std::string_view string_view_special_chars(special_chars); |
| 131 | |
| 132 | // Buffers |
| 133 | Buffer buffer_null{nullptr, 0}; |
| 134 | Buffer buffer_abc{string_view_abc}; |
| 135 | Buffer buffer_special_chars{string_view_special_chars}; |
| 136 | char mutable_array[3] = {'a', 'b', 'c'}; |
| 137 | MutableBuffer buffer_mutable{reinterpret_cast<uint8_t*>(mutable_array), 3}; |
| 138 | auto heap_buffer = std::make_shared<Buffer>(string_view_abc); |
| 139 | auto heap_buffer_mutable = *AllocateBuffer(buffer_abc.size()); |
| 140 | memcpy(heap_buffer_mutable->mutable_data(), buffer_abc.data(), buffer_abc.size()); |
| 141 | |
| 142 | // KeyValueMetadata |
| 143 | auto empty_metadata = key_value_metadata({}, {}); |
| 144 | auto metadata = key_value_metadata( |
| 145 | {"key_text", "key_binary"}, {"some value", std::string("z") + '\x00' + "\x1f\xff"}); |
| 146 | |
| 147 | // Decimals |
| 148 | Decimal32 decimal32_zero{}; |
| 149 | Decimal32 decimal32_pos{"987654321"}; |
| 150 | Decimal32 decimal32_neg{"-987654321"}; |
| 151 | BasicDecimal32 basic_decimal32_zero{}; |
| 152 | BasicDecimal32 basic_decimal32_pos{decimal32_pos.value()}; |
| 153 | BasicDecimal32 basic_decimal32_neg{decimal32_neg.value()}; |
| 154 | Decimal64 decimal64_zero{}; |
| 155 | Decimal64 decimal64_pos{"987654321098765432"}; |
| 156 | Decimal64 decimal64_neg{"-987654321098765432"}; |
| 157 | BasicDecimal64 basic_decimal64_zero{}; |
nothing calls this directly
no test coverage detected