summaryrefslogtreecommitdiff
path: root/src/unittest/rangemaptest.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-09-19 06:15:44 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-09-19 06:15:44 -0400
commitffb6aec603c38e16ae91ea975c16fc3e8fb337e5 (patch)
treefdf6e12bea9788f46589a9bcb15a8fe67581786f /src/unittest/rangemaptest.cc
parentc34df76272c17401955f6daf30ca9c7e7671ae56 (diff)
downloadgem5-ffb6aec603c38e16ae91ea975c16fc3e8fb337e5.tar.xz
AddrRange: Transition from Range<T> to AddrRange
This patch takes the final plunge and transitions from the templated Range class to the more specific AddrRange. In doing so it changes the obvious Range<Addr> to AddrRange, and also bumps the range_map to be AddrRangeMap. In addition to the obvious changes, including the removal of redundant includes, this patch also does some house keeping in preparing for the introduction of address interleaving support in the ranges. The Range class is also stripped of all the functionality that is never used. --HG-- rename : src/base/range.hh => src/base/addr_range.hh rename : src/base/range_map.hh => src/base/addr_range_map.hh
Diffstat (limited to 'src/unittest/rangemaptest.cc')
-rw-r--r--src/unittest/rangemaptest.cc42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/unittest/rangemaptest.cc b/src/unittest/rangemaptest.cc
index af00e4e58..57b954b0a 100644
--- a/src/unittest/rangemaptest.cc
+++ b/src/unittest/rangemaptest.cc
@@ -1,4 +1,16 @@
/*
+ * Copyright (c) 2012 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2006 The Regents of The University of Michigan
* All rights reserved.
*
@@ -31,46 +43,38 @@
#include <cassert>
#include <iostream>
-#include "base/range_map.hh"
-#include "base/types.hh"
+#include "base/addr_range_map.hh"
using namespace std;
int
main()
{
- range_map<Addr,int> r;
+ AddrRangeMap<int> r;
- range_map<Addr,int>::iterator i;
+ AddrRangeMap<int>::iterator i;
- i = r.insert(RangeIn<Addr>(10,40),5);
+ i = r.insert(RangeIn(10, 40), 5);
assert(i != r.end());
- i = r.insert(RangeIn<Addr>(60,90),3);
+ i = r.insert(RangeIn(60, 90), 3);
assert(i != r.end());
- i = r.find(RangeIn(20,30));
+ i = r.find(RangeIn(20, 30));
assert(i != r.end());
cout << i->first << " " << i->second << endl;
- i = r.find(RangeIn(55,55));
+ i = r.find(RangeIn(55, 55));
assert(i == r.end());
- i = r.insert(RangeIn<Addr>(0,12),1);
+ i = r.insert(RangeIn(0, 12), 1);
assert(i == r.end());
- i = r.insert(RangeIn<Addr>(0,9),1);
+ i = r.insert(RangeIn(0, 9), 1);
assert(i != r.end());
- i = r.find(RangeIn(20,30));
+ i = r.find(RangeIn(20, 30));
assert(i != r.end());
cout << i->first << " " << i->second << endl;
+ return 0;
}
-
-
-
-
-
-
-
-