aboutsummaryrefslogtreecommitdiff
path: root/tests/utils/gtest-print-helpers.h
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-09-22 16:30:07 -0500
committerCharles Kerr <charles.kerr@canonical.com>2016-09-22 16:30:07 -0500
commitb7c135151300dee6d6cb433cd9df989d4f04935f (patch)
tree89e6097c31e509ddf5948280e2ec35fe4e670fb3 /tests/utils/gtest-print-helpers.h
parentfe6fe0ae1e87d46c6060045cc3b25865df4533bd (diff)
parent403fd0a388e565daf195729d9211ff03c23c93a0 (diff)
downloadayatana-indicator-display-b7c135151300dee6d6cb433cd9df989d4f04935f.tar.gz
ayatana-indicator-display-b7c135151300dee6d6cb433cd9df989d4f04935f.tar.bz2
ayatana-indicator-display-b7c135151300dee6d6cb433cd9df989d4f04935f.zip
sync with lp:~charlesk/indicator-display/lp-1572545-prompt-in-lockscreen
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;
+}
+