Make FakeHardware the default for all unit tests.
Previously, unit tests by default ran with a MockSystemState
that used the Hardware class instead of the FakeHardware mock.
This changes to make all tests use the FakeHardware mock
unconditionally.
BUG=None
TEST=unit tests
Change-Id: I9d70aec0d59c5913968e4d37f1d4a2a28e854920
Reviewed-on: https://chromium-review.googlesource.com/174915
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
diff --git a/mock_system_state.h b/mock_system_state.h
index de0caef..e18c403 100644
--- a/mock_system_state.h
+++ b/mock_system_state.h
@@ -15,7 +15,7 @@
#include "update_engine/mock_p2p_manager.h"
#include "update_engine/mock_payload_state.h"
#include "update_engine/clock.h"
-#include "update_engine/hardware.h"
+#include "update_engine/fake_hardware.h"
#include "update_engine/prefs_mock.h"
#include "update_engine/system_state.h"
@@ -97,6 +97,10 @@
hardware_ = hardware;
}
+ inline FakeHardware* get_fake_hardware() {
+ return &default_hardware_;
+ }
+
inline void set_prefs(PrefsInterface* prefs) {
prefs_ = prefs;
}
@@ -142,7 +146,7 @@
// These are the other object we own.
Clock default_clock_;
- Hardware default_hardware_;
+ FakeHardware default_hardware_;
OmahaRequestParams default_request_params_;
// These are pointers to objects which caller can override.