aboutsummaryrefslogtreecommitdiff
path: root/tests/utils/gtest-print-helpers.h
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-10-21 14:19:54 +0000
committerBileto Bot <ci-train-bot@canonical.com>2016-10-21 14:19:54 +0000
commit3def83e1c5c34f63a3d36c4fff7f99a4d903a70f (patch)
tree337b9695c99dde56b25d6b20a20563adfb82bd41 /tests/utils/gtest-print-helpers.h
parent4f079d2faa6dd24f7ccd0566c4820a835fccce6a (diff)
parent7002fc4e6a6496fb5c0d3294540c957787689847 (diff)
downloadayatana-indicator-display-3def83e1c5c34f63a3d36c4fff7f99a4d903a70f.tar.gz
ayatana-indicator-display-3def83e1c5c34f63a3d36c4fff7f99a4d903a70f.tar.bz2
ayatana-indicator-display-3def83e1c5c34f63a3d36c4fff7f99a4d903a70f.zip
Fix test error in adbd-client-test
Approved by: unity-api-1-bot
Diffstat (limited to 'tests/utils/gtest-print-helpers.h')
-rw-r--r--tests/utils/gtest-print-helpers.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/utils/gtest-print-helpers.h b/tests/utils/gtest-print-helpers.h
new file mode 100644
index 0000000..60f42b4
--- /dev/null
+++ b/tests/utils/gtest-print-helpers.h
@@ -0,0 +1,18 @@
+
+#pragma once
+
+#include <src/greeter.h>
+
+inline void PrintTo(const Greeter::State& state, std::ostream* os) {
+ switch(state) {
+ case Greeter::State::ACTIVE: *os << "Active"; break;
+ case Greeter::State::INACTIVE: *os << "Inactive"; break;
+ case Greeter::State::UNAVAILABLE: *os << "Unavailable"; break;
+ }
+}
+
+inline std::ostream& operator<<(std::ostream& os, const Greeter::State& state) {
+ PrintTo(state, &os);
+ return os;
+}
+