diff options
Diffstat (limited to 'src/test/DBusSerializableStructTest.cpp')
-rw-r--r-- | src/test/DBusSerializableStructTest.cpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/src/test/DBusSerializableStructTest.cpp b/src/test/DBusSerializableStructTest.cpp deleted file mode 100644 index e306319..0000000 --- a/src/test/DBusSerializableStructTest.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (C) 2013 BMW Group - * Author: Manfred Bathelt (manfred.bathelt@bmw.de) - * Author: Juergen Gehring (juergen.gehring@bmw.de) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <iostream> - -#include <common-api-dbus/dbus-message.h> - -#include "TestDBusSerializableStruct.h" - - -#define COMMON_API_TEST_TEST_STRUCT_SIGNATURE "(ud)" -#define COMMON_API_TEST_TEST_STRUCT_ARRAY_SIGNATURE "a" COMMON_API_TEST_TEST_STRUCT_SIGNATURE - -#define COMMON_API_TEST_TEST_STRUCT_EXTENDED_SIGNATURE "(uds)" -#define COMMON_API_TEST_TEST_STRUCT_EXTENDED_ARRAY_SIGNATURE "a" COMMON_API_TEST_TEST_STRUCT_EXTENDED_SIGNATURE - - -namespace common { -namespace api { -namespace test { - - -TestStruct::TestStruct(const uint32_t& fromIntValue, const double& fromDoubleValue): - intValue(fromIntValue), - doubleValue(fromDoubleValue) { -} - -common::api::dbus::DBusInputMessageStream& TestStruct::readFromDBusInputMessageStream( - common::api::dbus::DBusInputMessageStream& inputMessageStream) { - return inputMessageStream >> intValue - >> doubleValue; -} - -common::api::dbus::DBusOutputMessageStream& TestStruct::writeToDBusOutputMessageStream( - common::api::dbus::DBusOutputMessageStream& outputMessageStream) const { - return outputMessageStream << intValue - << doubleValue; -} - - -TestStructExtended::TestStructExtended(const uint32_t& fromIntValue, const double& fromDoubleValue, const std::string& fromStringValue): - TestStruct(fromIntValue, fromDoubleValue), - stringValue(fromStringValue) { -} - -common::api::dbus::DBusInputMessageStream& TestStructExtended::readFromDBusInputMessageStream( - common::api::dbus::DBusInputMessageStream& inputMessageStream) { - return TestStruct::readFromDBusInputMessageStream(inputMessageStream) >> stringValue; -} - -common::api::dbus::DBusOutputMessageStream& TestStructExtended::writeToDBusOutputMessageStream( - common::api::dbus::DBusOutputMessageStream& outputMessageStream) const { - return TestStruct::writeToDBusOutputMessageStream(outputMessageStream) << stringValue; -} - -} //namespace test -} //namespace api -} //namespace common - - -int main(void) { - using namespace common::api::test; - - TestStructExtended testStructExtended(123, 456.789, "TestStructExtended"); - - common::api::dbus::DBusMessage message = common::api::dbus::DBusMessage::createMethodCall( - "com.bmw.test.TestStruct", - "/com/bmw/test/TestStruct", - "com.bmw.test.TestStruct", - "SingleTestStruct", - COMMON_API_TEST_TEST_STRUCT_EXTENDED_SIGNATURE); - - common::api::dbus::DBusOutputMessageStream outStream(message); - outStream << testStructExtended; - outStream.flush(); -} |