Restore rows() and cols() in aligned_array.h
These getters were removed in https://codereview.webrtc.org/1172163004
but are used in external code, so it makes sense to keep
them around to make the class more useful.
R=henrikg@webrtc.org, pkasting@chromium.org
Review URL: https://codereview.webrtc.org/1178043005.
Cr-Commit-Position: refs/heads/master@{#9478}
diff --git a/webrtc/system_wrappers/interface/aligned_array.h b/webrtc/system_wrappers/interface/aligned_array.h
index 0acf53f..8278af2 100644
--- a/webrtc/system_wrappers/interface/aligned_array.h
+++ b/webrtc/system_wrappers/interface/aligned_array.h
@@ -68,6 +68,14 @@
return Row(row)[col];
}
+ int rows() const {
+ return rows_;
+ }
+
+ int cols() const {
+ return cols_;
+ }
+
private:
int rows_;
int cols_;
@@ -78,4 +86,3 @@
} // 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 e5e556d..f25c717 100644
--- a/webrtc/system_wrappers/source/aligned_array_unittest.cc
+++ b/webrtc/system_wrappers/source/aligned_array_unittest.cc
@@ -51,5 +51,10 @@
}
}
-} // namespace webrtc
+TEST(AlignedArrayTest, CheckRowsCols) {
+ AlignedArray<bool> arr(10, 7, 128);
+ ASSERT_EQ(arr.rows(), 10);
+ ASSERT_EQ(arr.cols(), 7);
+}
+} // namespace webrtc