summaryrefslogtreecommitdiffstats
path: root/src/disk_interface_test.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-06-19 23:00:35 (GMT)
committerNico Weber <nicolasweber@gmx.de>2014-06-19 23:00:35 (GMT)
commite88a8daa10bb27a0617c74f3bc6eec66823f3a99 (patch)
treeaa93589817d8552164f5a00edc89705b64b45745 /src/disk_interface_test.cc
parentfcca327e0c66dfec49af28f09f94b94ac49c5cb4 (diff)
downloadNinja-e88a8daa10bb27a0617c74f3bc6eec66823f3a99.zip
Ninja-e88a8daa10bb27a0617c74f3bc6eec66823f3a99.tar.gz
Ninja-e88a8daa10bb27a0617c74f3bc6eec66823f3a99.tar.bz2
make Stat() a const method
Diffstat (limited to 'src/disk_interface_test.cc')
-rw-r--r--src/disk_interface_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc
index 69fd1ab..f4e0bb0 100644
--- a/src/disk_interface_test.cc
+++ b/src/disk_interface_test.cc
@@ -147,7 +147,7 @@ struct StatTest : public StateTestWithBuiltinRules,
StatTest() : scan_(&state_, NULL, NULL, this) {}
// DiskInterface implementation.
- virtual TimeStamp Stat(const string& path);
+ virtual TimeStamp Stat(const string& path) const;
virtual bool WriteFile(const string& path, const string& contents) {
assert(false);
return true;
@@ -167,12 +167,12 @@ struct StatTest : public StateTestWithBuiltinRules,
DependencyScan scan_;
map<string, TimeStamp> mtimes_;
- vector<string> stats_;
+ mutable vector<string> stats_;
};
-TimeStamp StatTest::Stat(const string& path) {
+TimeStamp StatTest::Stat(const string& path) const {
stats_.push_back(path);
- map<string, TimeStamp>::iterator i = mtimes_.find(path);
+ map<string, TimeStamp>::const_iterator i = mtimes_.find(path);
if (i == mtimes_.end())
return 0; // File not found.
return i->second;