Skip to content

Commit 0a220b4

Browse files
committed
[refactor](be) Align binary cleanup and offset fixtures with style checks
### What problem does this PR solve? Keep the 4.1 fix synchronized with the master review changes: mark the private payload cleanup helper const and use named members in the offset fixtures. ### Release note None. ### Check List (For Author) - Test: 40 focused ASAN BE unit tests passed; clang-format 16 passed. - Behavior changed: No. - Does this need documentation: No.
1 parent d6b4586 commit 0a220b4

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎be/src/core/field.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct OwnedBinaryField {
125125
~OwnedBinaryField() { release_bytes(); }
126126

127127
private:
128-
void release_bytes() {
128+
void release_bytes() const {
129129
if (bytes != nullptr) {
130130
// Field::get() exposes a mutable view; release the original allocation size.
131131
Allocator<false> {}.free(bytes, byte_size);

‎be/test/runtime/timestamptz_value_test.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ TEST(TimeStampTzValueTest, ToStringPreservesHistoricalOffsetSeconds) {
5454
const char* offset;
5555
};
5656
const TestCase cases[] = {
57-
{shanghai, 1890, "1890-01-01 08:05:43", "+08:05:43"},
58-
{new_york, 1880, "1879-12-31 19:03:58", "-04:56:02"},
57+
{.zone = shanghai, .year = 1890, .civil = "1890-01-01 08:05:43", .offset = "+08:05:43"},
58+
{.zone = new_york, .year = 1880, .civil = "1879-12-31 19:03:58", .offset = "-04:56:02"},
5959
// Pre-standard offsets vary across tzdata versions. Fixed zones keep coverage
6060
// of offsets beyond 14 hours independent of the host's historical records.
6161
{.zone = cctz::fixed_time_zone(std::chrono::seconds(-57368)),
@@ -66,10 +66,10 @@ TEST(TimeStampTzValueTest, ToStringPreservesHistoricalOffsetSeconds) {
6666
.year = 1800,
6767
.civil = "1799-12-31 09:39:00",
6868
.offset = "-14:21"},
69-
{shanghai, 2024, "2024-01-01 08:00:00", "+08:00"},
70-
{new_york, 2024, "2023-12-31 19:00:00", "-05:00"},
71-
{kathmandu, 2024, "2024-01-01 05:45:00", "+05:45"},
72-
{utc, 2024, "2024-01-01 00:00:00", "+00:00"},
69+
{.zone = shanghai, .year = 2024, .civil = "2024-01-01 08:00:00", .offset = "+08:00"},
70+
{.zone = new_york, .year = 2024, .civil = "2023-12-31 19:00:00", .offset = "-05:00"},
71+
{.zone = kathmandu, .year = 2024, .civil = "2024-01-01 05:45:00", .offset = "+05:45"},
72+
{.zone = utc, .year = 2024, .civil = "2024-01-01 00:00:00", .offset = "+00:00"},
7373
};
7474
for (const auto& test_case : cases) {
7575
const auto& zone = test_case.zone;

0 commit comments

Comments
 (0)