summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-12-20 16:25:48 -0500
committerNathan Binkert <binkertn@umich.edu>2003-12-20 16:25:48 -0500
commit520442b01afb3742a6dde552b8d62351d2200aba (patch)
tree52cd2f5735eb6c50fd44b7d208f7d9266a2dd208 /test
parent598a24073385e421b1369637f64f06edd5a4d11e (diff)
downloadgem5-520442b01afb3742a6dde552b8d62351d2200aba.tar.xz
Fix a bunch of memory leak type bugs, and add some better
checking in places to make sure stuff is behaving properly. base/statistics.cc: separate the per stat check from the general stats check. We always want the general stuff to happen base/statistics.hh: - separate the per stat check from the general stats check. we always want the general stuff to happen - make every stat check that its bin is at least initialized - set the vector2d x and y coordinates in init to prevent an uninitialized memory access test/Makefile: don't need sim_time.o to test stats test/stattest.cc: don't make x and y the same on the 2d test so that we make sure that the two dimensions are correct --HG-- extra : convert_revision : 81320325056ac1c09f6842474fb6ee3bcc030a8e
Diffstat (limited to 'test')
-rw-r--r--test/Makefile2
-rw-r--r--test/stattest.cc7
2 files changed, 7 insertions, 2 deletions
diff --git a/test/Makefile b/test/Makefile
index 29d252df4..ceb3c9a1c 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -52,7 +52,7 @@ offtest: offtest.o
rangetest: rangetest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
-stattest: cprintf.o hostinfo.o misc.o sim_time.o statistics.o stattest.o str.o
+stattest: cprintf.o hostinfo.o misc.o statistics.o stattest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
strnumtest: strnumtest.o str.o
diff --git a/test/stattest.cc b/test/stattest.cc
index dea5295cc..7c171be80 100644
--- a/test/stattest.cc
+++ b/test/stattest.cc
@@ -115,7 +115,7 @@ main(int argc, char *argv[])
s13.init(4, 0, 99, 10);
s14.init(9);
s15.init(10);
- s16.init(2, 2);
+ s16.init(2, 9);
s1
.name("Stat01")
@@ -271,6 +271,11 @@ main(int argc, char *argv[])
s16[0][0] = 2;
s16[1][1] = 9;
s16[1][1] += 9;
+ s16[1][8] += 8;
+ s16[1][7] += 7;
+ s16[1][6] += 6;
+ s16[1][5] += 5;
+ s16[1][4] += 4;
s11 = 1;
s3 = 9;