summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOla Jeppsson <ola.jeppsson@gmail.com>2014-01-30 12:21:58 -0600
committerOla Jeppsson <ola.jeppsson@gmail.com>2014-01-30 12:21:58 -0600
commit7f169514518fa3124c26e5488ed3f7c90881c363 (patch)
tree06876d4b45b75be17f7e1b6382f33d92092f7ce5
parent96317d466ea26955ce26f658f162755b39d3352e (diff)
downloadgem5-7f169514518fa3124c26e5488ed3f7c90881c363.tar.xz
unittest: Fix build errors
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
-rw-r--r--src/unittest/SConscript3
-rw-r--r--src/unittest/initest.cc2
-rw-r--r--src/unittest/rangemaptest.cc6
-rw-r--r--src/unittest/stattest.cc46
-rw-r--r--src/unittest/symtest.cc2
5 files changed, 35 insertions, 24 deletions
diff --git a/src/unittest/SConscript b/src/unittest/SConscript
index 4cb14a290..14427bc9f 100644
--- a/src/unittest/SConscript
+++ b/src/unittest/SConscript
@@ -37,9 +37,7 @@ UnitTest('circletest', 'circletest.cc')
UnitTest('cprintftest', 'cprintftest.cc')
UnitTest('cprintftime', 'cprintftest.cc')
UnitTest('initest', 'initest.cc')
-UnitTest('lrutest', 'lru_test.cc')
UnitTest('nmtest', 'nmtest.cc')
-UnitTest('offtest', 'offtest.cc')
UnitTest('rangemaptest', 'rangemaptest.cc')
UnitTest('refcnttest', 'refcnttest.cc')
UnitTest('strnumtest', 'strnumtest.cc')
@@ -51,4 +49,3 @@ UnitTest('stattest', 'stattest.cc', stattest_py, stattest_swig, main=True)
UnitTest('symtest', 'symtest.cc')
UnitTest('tokentest', 'tokentest.cc')
-UnitTest('tracetest', 'tracetest.cc')
diff --git a/src/unittest/initest.cc b/src/unittest/initest.cc
index 077b59d36..7e103aa50 100644
--- a/src/unittest/initest.cc
+++ b/src/unittest/initest.cc
@@ -41,6 +41,8 @@ using namespace std;
char *progname;
+void usage();
+
void
usage()
{
diff --git a/src/unittest/rangemaptest.cc b/src/unittest/rangemaptest.cc
index 57b954b0a..6975f66ef 100644
--- a/src/unittest/rangemaptest.cc
+++ b/src/unittest/rangemaptest.cc
@@ -52,7 +52,7 @@ main()
{
AddrRangeMap<int> r;
- AddrRangeMap<int>::iterator i;
+ AddrRangeMap<int>::const_iterator i;
i = r.insert(RangeIn(10, 40), 5);
assert(i != r.end());
@@ -61,7 +61,7 @@ main()
i = r.find(RangeIn(20, 30));
assert(i != r.end());
- cout << i->first << " " << i->second << endl;
+ cout << i->first.to_string() << " " << i->second << endl;
i = r.find(RangeIn(55, 55));
assert(i == r.end());
@@ -74,7 +74,7 @@ main()
i = r.find(RangeIn(20, 30));
assert(i != r.end());
- cout << i->first << " " << i->second << endl;
+ cout << i->first.to_string() << " " << i->second << endl;
return 0;
}
diff --git a/src/unittest/stattest.cc b/src/unittest/stattest.cc
index 67eb5c323..20f2fd548 100644
--- a/src/unittest/stattest.cc
+++ b/src/unittest/stattest.cc
@@ -49,6 +49,13 @@ const char *m5MainCommands[] = {
using namespace std;
using namespace Stats;
+double testfunc();
+struct StatTest;
+StatTest & __stattest();
+void stattest_init();
+void stattest_run();
+
+
double
testfunc()
{
@@ -130,6 +137,9 @@ stattest_run()
void
StatTest::init()
{
+ EventQueue *q = getEventQueue(0);
+ curEventQueue(q);
+
cprintf("sizeof(Scalar) = %d\n", sizeof(Scalar));
cprintf("sizeof(Vector) = %d\n", sizeof(Vector));
cprintf("sizeof(Distribution) = %d\n", sizeof(Distribution));
@@ -419,7 +429,7 @@ StatTest::run()
s15[9].sample(1234);
s10.sample(1000000000);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s10.sample(100000);
s10.sample(100000);
s10.sample(100000);
@@ -494,50 +504,50 @@ StatTest::run()
s15[0].sample(1234);
s15[1].sample(4134);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[4].sample(1213);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[3].sample(1124);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[2].sample(1243);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[7].sample(1244);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[4].sample(7234);
s15[2].sample(9234);
s15[3].sample(1764);
s15[7].sample(1564);
s15[3].sample(3234);
s15[1].sample(2234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[5].sample(1234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[9].sample(4334);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[2].sample(1234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[4].sample(4334);
s15[6].sample(1234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[8].sample(8734);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[1].sample(5234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[3].sample(8234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[7].sample(5234);
s15[4].sample(4434);
s15[3].sample(7234);
s15[2].sample(1934);
s15[1].sample(9234);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[5].sample(5634);
s15[3].sample(1264);
s15[7].sample(5223);
s15[0].sample(1234);
s15[0].sample(5434);
s15[3].sample(8634);
- curTick(curTick() + ULL(1000000));
+ curEventQueue()->setCurTick(curTick() + ULL(1000000));
s15[1].sample(1234);
s4 = curTick();
@@ -546,7 +556,7 @@ StatTest::run()
s3 = 12;
s3++;
- curTick(curTick() + 9);
+ curEventQueue()->setCurTick(curTick() + 9);
s1 = 9;
s1 += 9;
@@ -621,7 +631,7 @@ StatTest::run()
s9.sample(10);
s9.sample(10);
- curTick(curTick() + 9);
+ curEventQueue()->setCurTick(curTick() + 9);
s4 = curTick();
s6.sample(100);
s6.sample(100);
diff --git a/src/unittest/symtest.cc b/src/unittest/symtest.cc
index a40210ba7..21176b9e9 100644
--- a/src/unittest/symtest.cc
+++ b/src/unittest/symtest.cc
@@ -35,6 +35,8 @@
using namespace std;
+void usage(const char *progname);
+
void
usage(const char *progname)
{