ref: 8659764a07873699794c2e5bd8bac25835d41270
parent: cf07d858095c404de131e29e2ae414d1892eb932
author: Johann <johannkoenig@google.com>
date: Tue Jun 6 08:05:14 EDT 2017
buffer.h: Use T for values Change-Id: I2da4110e843b6e361028b921c24b6ca2ea9077d9
--- a/test/buffer.h
+++ b/test/buffer.h
@@ -47,7 +47,7 @@
int stride() const { return stride_; }
// Set the buffer (excluding padding) to 'value'.
- void Set(const int value);
+ void Set(const T value);
// Set the buffer (excluding padding) to the output of ACMRandom function 'b'.
void Set(ACMRandom *rand_class, T (ACMRandom::*rand_func)());
@@ -63,11 +63,11 @@
bool HasPadding() const;
// Sets all the values in the buffer to 'padding_value'.
- void SetPadding(const int padding_value);
+ void SetPadding(const T padding_value);
// Checks if all the values (excluding padding) are equal to 'value' if the
// Buffers are the same size.
- bool CheckValues(const int value) const;
+ bool CheckValues(const T value) const;
// Check that padding matches the expected value or there is no padding.
bool CheckPadding() const;
@@ -98,7 +98,7 @@
const int left_padding_;
const int right_padding_;
const int bottom_padding_;
- int padding_value_;
+ T padding_value_;
int stride_;
int raw_size_;
T *raw_buffer_;
@@ -110,7 +110,7 @@
}
template <typename T>
-void Buffer<T>::Set(const int value) {
+void Buffer<T>::Set(const T value) {
T *src = TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
@@ -206,7 +206,7 @@
}
template <typename T>
-void Buffer<T>::SetPadding(const int padding_value) {
+void Buffer<T>::SetPadding(const T padding_value) {
padding_value_ = padding_value;
T *src = raw_buffer_;
@@ -216,7 +216,7 @@
}
template <typename T>
-bool Buffer<T>::CheckValues(const int value) const {
+bool Buffer<T>::CheckValues(const T value) const {
T *src = TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {