OSDN Git Service

Fix a size specification bug for the bandwidth test.
authorBen Cheng <bccheng@google.com>
Tue, 10 Nov 2015 09:33:40 +0000 (17:33 +0800)
committerBen Cheng <bccheng@google.com>
Wed, 11 Nov 2015 03:50:45 +0000 (11:50 +0800)
Change-Id: I38b5dc89edafd1768caa34158c2746c7ef35c31e

tests/memtest/bandwidth.cpp
tests/memtest/bandwidth.h

index 5ad7468..5ff6756 100644 (file)
@@ -136,7 +136,7 @@ BandwidthBenchmark *createBandwidthBenchmarkObject(arg_t values) {
         return NULL;
     }
 
-    if (!bench->setSize(values["size"].int_value)) {
+    if (!bench->setSize(size)) {
         printf("Failed to allocate buffers for benchmark.\n");
         return NULL;
     }
@@ -394,7 +394,7 @@ bool run_bandwidth_benchmark(int argc, char** argv, const char *name,
         if (!(*it)->canRun()) {
             continue;
         }
-        if (!(*it)->setSize(values["num_warm_loops"].int_value)) {
+        if (!(*it)->setSize(values["size"].int_value)) {
             printf("Failed creating buffer for bandwidth test.\n");
             return false;
         }
index e1dc81b..b43349c 100644 (file)
@@ -439,7 +439,7 @@ public:
             _buffer = NULL;
         }
 
-        if (_size == 0) {
+        if (size == 0) {
             _size = DEFAULT_SINGLE_BUFFER_SIZE;
         } else {
             _size = size;