diff --git a/src/common/ref_resource_view.h b/src/common/ref_resource_view.h index 0fadf846d..d4f82e615 100644 --- a/src/common/ref_resource_view.h +++ b/src/common/ref_resource_view.h @@ -76,7 +76,7 @@ class RefResourceView { [[nodiscard]] size_type size() const { return size_; } // NOLINT [[nodiscard]] size_type size_bytes() const { // NOLINT - return Span{data(), size()}.size_bytes(); + return Span{data(), size()}.size_bytes(); } [[nodiscard]] value_type* data() { return ptr_; }; // NOLINT [[nodiscard]] value_type const* data() const { return ptr_; }; // NOLINT diff --git a/tests/cpp/common/test_io.cc b/tests/cpp/common/test_io.cc index 8bc12698b..f8aa9fd73 100644 --- a/tests/cpp/common/test_io.cc +++ b/tests/cpp/common/test_io.cc @@ -148,7 +148,8 @@ TEST(IO, Resource) { fout << 1.0 << std::endl; fout.close(); - auto resource = std::make_shared(path, 0, sizeof(double)); + auto resource = std::shared_ptr{ + new MmapResource{path, 0, sizeof(double)}}; ASSERT_EQ(resource->Size(), sizeof(double)); ASSERT_EQ(resource->Type(), ResourceHandler::kMmap); ASSERT_EQ(resource->DataAs()[0], val);