summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-03-20 17:17:03 +0100
committerPhilip Rauwolf <rauwolf@itestra.de>2013-03-20 17:17:03 +0100
commit67519cb03bf1560273df7f09e1e3d09667cd1191 (patch)
tree63f1c015fa0052667fd372edc030e28785deb7ad
parentaf2ede880d75dd5b982acd338be3e5a3d9d9a3f3 (diff)
downloadgenivi-common-api-dbus-runtime-67519cb03bf1560273df7f09e1e3d09667cd1191.tar.gz
Extended DBusTestUtils2.0.2
-rw-r--r--src/test/DBusTestUtils.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/DBusTestUtils.h b/src/test/DBusTestUtils.h
index 8b0cbf9..a1140e4 100644
--- a/src/test/DBusTestUtils.h
+++ b/src/test/DBusTestUtils.h
@@ -6,6 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <dbus/dbus.h>
+#include <CommonAPI/DBus/DBusServiceRegistry.h>
inline char eliminateZeroes(char val) {
@@ -32,3 +33,43 @@ inline void printLibdbusMessage(DBusMessage* libdbusMessage) {
printLibdbusMessage(libdbusMessage, 0, dbus_message_get_body_length(libdbusMessage));
}
+inline std::string toString(CommonAPI::DBus::DBusServiceRegistry::DBusServiceState state) {
+ switch(state) {
+ case CommonAPI::DBus::DBusServiceRegistry::DBusServiceState::AVAILABLE:
+ return "AVAILABLE";
+ case CommonAPI::DBus::DBusServiceRegistry::DBusServiceState::NOT_AVAILABLE:
+ return "NOT_AVAILABLE";
+ case CommonAPI::DBus::DBusServiceRegistry::DBusServiceState::RESOLVED:
+ return "RESOLVED";
+ case CommonAPI::DBus::DBusServiceRegistry::DBusServiceState::RESOLVING:
+ return "RESOLVING";
+ case CommonAPI::DBus::DBusServiceRegistry::DBusServiceState::UNKNOWN:
+ return "UNKNOWN";
+ }
+}
+
+inline std::string toString(CommonAPI::AvailabilityStatus state) {
+ switch(state) {
+ case CommonAPI::AvailabilityStatus::AVAILABLE:
+ return "AVAILABLE";
+ case CommonAPI::AvailabilityStatus::NOT_AVAILABLE:
+ return "NOT_AVAILABLE";
+ case CommonAPI::AvailabilityStatus::UNKNOWN:
+ return "UNKNOWN";
+ }
+}
+
+inline std::string toString(CommonAPI::CallStatus state) {
+ switch(state) {
+ case CommonAPI::CallStatus::CONNECTION_FAILED:
+ return "CONNECTION_FAILED";
+ case CommonAPI::CallStatus::NOT_AVAILABLE:
+ return "NOT_AVAILABLE";
+ case CommonAPI::CallStatus::OUT_OF_MEMORY:
+ return "OUT_OF_MEMORY";
+ case CommonAPI::CallStatus::REMOTE_ERROR:
+ return "REMOTE_ERROR";
+ case CommonAPI::CallStatus::SUCCESS:
+ return "SUCCESS";
+ }
+}