所有权指针明确
This commit is contained in:
@@ -39,16 +39,21 @@ TEST(partition_configuration,
|
||||
auto power = build_object<Power>();
|
||||
auto q_axis = build_object<Power>();
|
||||
auto time = build_object<Time>();
|
||||
auto spectrum = build_object<Spectrum_Object>(frequency.get(), power.get(),
|
||||
auto spectrum = build_object<Spectrum_Object>(not_null{frequency.get()},
|
||||
not_null{power.get()},
|
||||
6u);
|
||||
auto trace = build_object<Trace_Object>(time.get(), power.get(), 4u);
|
||||
auto sweep = build_object<Sweep_Object>(frequency.get(), power.get(), 4u);
|
||||
auto trace = build_object<Trace_Object>(not_null{time.get()},
|
||||
not_null{power.get()}, 4u);
|
||||
auto sweep = build_object<Sweep_Object>(not_null{frequency.get()},
|
||||
not_null{power.get()}, 4u);
|
||||
auto afterglow = build_object<Afterglow_Object>(
|
||||
frequency.get(), power.get(), Plot_Partition_Grid{2, 3});
|
||||
not_null{frequency.get()}, not_null{power.get()},
|
||||
Plot_Partition_Grid{2, 3});
|
||||
auto constellation = build_object<Constellation_Object>(
|
||||
power.get(), q_axis.get(), 7u);
|
||||
not_null{power.get()}, not_null{q_axis.get()}, 7u);
|
||||
auto waterfall = build_object<Waterfall_Object>(
|
||||
frequency.get(), time.get(), Plot_Partition_Grid{2, 3});
|
||||
not_null{frequency.get()}, not_null{time.get()},
|
||||
Plot_Partition_Grid{2, 3});
|
||||
|
||||
EXPECT_EQ(spectrum->read_prop<Spectrum::Base_Tag>().partition_count, 6u);
|
||||
EXPECT_EQ(constellation->read_prop<Constellation_Diagram::Base_Tag>()
|
||||
@@ -132,9 +137,9 @@ TEST(partition_configuration,
|
||||
ASSERT_EQ(actual.height, expected.height);
|
||||
for (int y = 0; y < expected.height; ++y) {
|
||||
const auto* expected_row = reinterpret_cast<const Pixel*>(
|
||||
expected.data + static_cast<std::ptrdiff_t>(y) * expected.stride);
|
||||
expected.data.data() + static_cast<std::ptrdiff_t>(y) * expected.stride);
|
||||
const auto* actual_row = reinterpret_cast<const Pixel*>(
|
||||
actual.data + static_cast<std::ptrdiff_t>(y) * actual.stride);
|
||||
actual.data.data() + static_cast<std::ptrdiff_t>(y) * actual.stride);
|
||||
for (int x = 0; x < expected.width; ++x)
|
||||
EXPECT_EQ(actual_row[x], expected_row[x])
|
||||
<< "pixel mismatch at " << x << ", " << y;
|
||||
@@ -207,9 +212,9 @@ TEST(partition_configuration,
|
||||
const Image_View actual = actual_cache.view();
|
||||
for (int y = 0; y < expected.height; ++y) {
|
||||
const auto* expected_row = reinterpret_cast<const Pixel*>(
|
||||
expected.data + static_cast<std::ptrdiff_t>(y) * expected.stride);
|
||||
expected.data.data() + static_cast<std::ptrdiff_t>(y) * expected.stride);
|
||||
const auto* actual_row = reinterpret_cast<const Pixel*>(
|
||||
actual.data + static_cast<std::ptrdiff_t>(y) * actual.stride);
|
||||
actual.data.data() + static_cast<std::ptrdiff_t>(y) * actual.stride);
|
||||
for (int x = 0; x < expected.width; ++x)
|
||||
EXPECT_EQ(actual_row[x], expected_row[x])
|
||||
<< "tile seam mismatch at " << x << ", " << y;
|
||||
|
||||
Reference in New Issue
Block a user