diff --git a/webrtc/system_wrappers/interface/aligned_array.h b/webrtc/system_wrappers/interface/aligned_array.h index 0acf53f481..8278af2ae3 100644 --- a/webrtc/system_wrappers/interface/aligned_array.h +++ b/webrtc/system_wrappers/interface/aligned_array.h @@ -68,6 +68,14 @@ template class AlignedArray { return Row(row)[col]; } + int rows() const { + return rows_; + } + + int cols() const { + return cols_; + } + private: int rows_; int cols_; @@ -78,4 +86,3 @@ template class AlignedArray { } // namespace webrtc #endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_ARRAY_ - diff --git a/webrtc/system_wrappers/source/aligned_array_unittest.cc b/webrtc/system_wrappers/source/aligned_array_unittest.cc index e5e556dff5..f25c7178d2 100644 --- a/webrtc/system_wrappers/source/aligned_array_unittest.cc +++ b/webrtc/system_wrappers/source/aligned_array_unittest.cc @@ -51,5 +51,10 @@ TEST(AlignedArrayTest, CheckOverlap) { } } -} // namespace webrtc +TEST(AlignedArrayTest, CheckRowsCols) { + AlignedArray arr(10, 7, 128); + ASSERT_EQ(arr.rows(), 10); + ASSERT_EQ(arr.cols(), 7); +} +} // namespace webrtc