2017-11-27 14:13:55 +01:00
|
|
|
/**
|
2019-06-11 20:18:37 +02:00
|
|
|
* (C) 2016 - 2017 KISTLER INSTRUMENTE AG, Winterthur, Switzerland
|
|
|
|
|
* (C) 2016 - 2019 Stanislav Angelovic <angelovic.s@gmail.com>
|
2017-11-27 14:13:55 +01:00
|
|
|
*
|
2020-07-18 20:16:57 +02:00
|
|
|
* @file Defs.h
|
2017-11-27 14:13:55 +01:00
|
|
|
*
|
|
|
|
|
* Created on: Jan 2, 2017
|
|
|
|
|
* Project: sdbus-c++
|
|
|
|
|
* Description: High-level D-Bus IPC C++ library based on sd-bus
|
|
|
|
|
*
|
|
|
|
|
* This file is part of sdbus-c++.
|
|
|
|
|
*
|
|
|
|
|
* sdbus-c++ is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 2.1 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* sdbus-c++ is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* along with sdbus-c++. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef SDBUS_CPP_INTEGRATIONTESTS_DEFS_H_
|
|
|
|
|
#define SDBUS_CPP_INTEGRATIONTESTS_DEFS_H_
|
|
|
|
|
|
|
|
|
|
#include "sdbus-c++/Types.h"
|
2021-12-20 10:00:29 +01:00
|
|
|
#include <chrono>
|
|
|
|
|
#include <ostream>
|
2017-11-27 14:13:55 +01:00
|
|
|
|
2020-07-18 20:16:57 +02:00
|
|
|
namespace sdbus { namespace test {
|
|
|
|
|
|
2019-03-28 18:25:31 +01:00
|
|
|
const std::string INTERFACE_NAME{"org.sdbuscpp.integrationtests"};
|
2021-10-14 16:08:38 +02:00
|
|
|
const std::string BUS_NAME = INTERFACE_NAME;
|
2021-10-14 15:53:51 +02:00
|
|
|
const std::string MANAGER_PATH {"/org/sdbuscpp/integrationtests"};
|
|
|
|
|
const std::string OBJECT_PATH {"/org/sdbuscpp/integrationtests/ObjectA1"};
|
|
|
|
|
const std::string OBJECT_PATH_2{"/org/sdbuscpp/integrationtests/ObjectB1"};
|
2017-11-27 14:13:55 +01:00
|
|
|
|
|
|
|
|
constexpr const uint8_t UINT8_VALUE{1};
|
|
|
|
|
constexpr const int16_t INT16_VALUE{21};
|
|
|
|
|
constexpr const uint32_t UINT32_VALUE{42};
|
|
|
|
|
constexpr const int32_t INT32_VALUE{-42};
|
|
|
|
|
constexpr const int32_t INT64_VALUE{-1024};
|
|
|
|
|
|
|
|
|
|
const std::string STRING_VALUE{"sdbus-c++-testing"};
|
|
|
|
|
const sdbus::Signature SIGNATURE_VALUE{"a{is}"};
|
|
|
|
|
const sdbus::ObjectPath OBJECT_PATH_VALUE{"/"};
|
2019-06-08 21:35:22 +02:00
|
|
|
const int UNIX_FD_VALUE = 0;
|
2017-11-27 14:13:55 +01:00
|
|
|
|
2019-05-29 22:28:15 +02:00
|
|
|
const std::string DEFAULT_STATE_VALUE{"default-state-value"};
|
|
|
|
|
const uint32_t DEFAULT_ACTION_VALUE{999};
|
|
|
|
|
const bool DEFAULT_BLOCKING_VALUE{true};
|
|
|
|
|
|
2017-11-27 14:13:55 +01:00
|
|
|
constexpr const double DOUBLE_VALUE{3.24L};
|
|
|
|
|
|
2021-12-20 10:00:29 +01:00
|
|
|
/** Duration stream operator for human readable gtest value output.
|
|
|
|
|
*
|
|
|
|
|
* Note that the conversion to double is lossy if the input type has 64 or more bits.
|
|
|
|
|
* This is ok for our integration tests because they don't have very
|
|
|
|
|
* accurate timing requirements.
|
|
|
|
|
*
|
|
|
|
|
* @return human readable duration in seconds
|
|
|
|
|
*/
|
|
|
|
|
template< class Rep, class Period >
|
|
|
|
|
static std::ostream& operator<<(std::ostream& os, const std::chrono::duration<Rep, Period>& d)
|
|
|
|
|
{
|
|
|
|
|
auto seconds = std::chrono::duration_cast<std::chrono::duration<double>>(d);
|
|
|
|
|
return os << seconds.count() << " s";
|
|
|
|
|
}
|
2020-07-18 20:16:57 +02:00
|
|
|
}}
|
|
|
|
|
|
2017-11-27 14:13:55 +01:00
|
|
|
#endif /* SDBUS_CPP_INTEGRATIONTESTS_DEFS_H_ */
|