summaryrefslogtreecommitdiff
path: root/src/unittest/rangetest.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-10-02 11:26:59 -0700
committerNathan Binkert <nate@binkert.org>2008-10-02 11:26:59 -0700
commit52493b27202fb61aaae74779ebcd91ca8f2bbc2c (patch)
treeeafc46fbeb182b85c766910dfcef544df2e1723a /src/unittest/rangetest.cc
parent67a2918abc057f8f6d693d8acadd70bf9337cf44 (diff)
downloadgem5-52493b27202fb61aaae74779ebcd91ca8f2bbc2c.tar.xz
unittest: Cleanup unit tests. Follow style. Garbage Collect.
--HG-- rename : src/unittest/rangemaptest2.cc => src/unittest/rangemultimaptest.cc
Diffstat (limited to 'src/unittest/rangetest.cc')
-rw-r--r--src/unittest/rangetest.cc57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/unittest/rangetest.cc b/src/unittest/rangetest.cc
index b7a68ab44..eab2f39a8 100644
--- a/src/unittest/rangetest.cc
+++ b/src/unittest/rangetest.cc
@@ -38,39 +38,40 @@ using namespace std;
int
main()
{
- Range<int> r1(make_pair(9, 28));
- Range<unsigned> r2("0x1000:+0x100");
+ Range<int> r1(make_pair(9, 28));
+ Range<unsigned> r2("0x1000:+0x100");
- cout << r1 << "\n"
- << r2 << "\n";
+ cout << r1 << "\n"
+ << r2 << "\n";
-#define RANGETEST(X, C, Y) \
- cout << X << " "#C" " << Y << " => " << ((X C Y) ? "true" : "false") << "\n"
+#define RANGETEST(X, C, Y) \
+ cout << X << " "#C" " << Y << " => " << \
+ ((X C Y) ? "true" : "false") << "\n"
#define TESTEM(X, Y) do { \
- RANGETEST(X, < , Y); \
- RANGETEST(X, <=, Y); \
- RANGETEST(X, > , Y); \
- RANGETEST(X, >=, Y); \
- RANGETEST(X, ==, Y); \
- RANGETEST(X, !=, Y); \
- RANGETEST(Y, < , X); \
- RANGETEST(Y, <=, X); \
- RANGETEST(Y, > , X); \
- RANGETEST(Y, >=, X); \
- RANGETEST(Y, ==, X); \
- RANGETEST(Y, !=, X); \
-} while (0)
+ RANGETEST(X, < , Y); \
+ RANGETEST(X, <=, Y); \
+ RANGETEST(X, > , Y); \
+ RANGETEST(X, >=, Y); \
+ RANGETEST(X, ==, Y); \
+ RANGETEST(X, !=, Y); \
+ RANGETEST(Y, < , X); \
+ RANGETEST(Y, <=, X); \
+ RANGETEST(Y, > , X); \
+ RANGETEST(Y, >=, X); \
+ RANGETEST(Y, ==, X); \
+ RANGETEST(Y, !=, X); \
+ } while (0)
- TESTEM(8, r1);
- TESTEM(9, r1);
- TESTEM(27, r1);
- TESTEM(28, r1);
+ TESTEM(8, r1);
+ TESTEM(9, r1);
+ TESTEM(27, r1);
+ TESTEM(28, r1);
- TESTEM(0x0fff, r2);
- TESTEM(0x1000, r2);
- TESTEM(0x10ff, r2);
- TESTEM(0x1100, r2);
+ TESTEM(0x0fff, r2);
+ TESTEM(0x1000, r2);
+ TESTEM(0x10ff, r2);
+ TESTEM(0x1100, r2);
- return 0;
+ return 0;
}