Apply cmake-format and clang-format
This commit is contained in:
parent
75c0f5b74d
commit
1bf58bf38d
|
@ -78,9 +78,9 @@ public:
|
|||
void tearDown() override;
|
||||
|
||||
private:
|
||||
template <typename Action, typename... Signalinfo> void waitForConnection(Action action, int timeout, const Signalinfo &... signalInfo);
|
||||
template <typename Action, typename... Signalinfo> void waitForConnection(Action action, int timeout, const Signalinfo &...signalInfo);
|
||||
template <typename Action, typename FailureSignalInfo, typename... Signalinfo>
|
||||
void waitForConnectionOrFail(Action action, int timeout, const FailureSignalInfo &failureSignalInfo, const Signalinfo &... signalInfo);
|
||||
void waitForConnectionOrFail(Action action, int timeout, const FailureSignalInfo &failureSignalInfo, const Signalinfo &...signalInfo);
|
||||
template <typename Signal, typename Handler = function<void(void)>>
|
||||
SignalInfo<Signal, Handler> connectionSignal(
|
||||
Signal signal, const Handler &handler = function<void(void)>(), bool *correctSignalEmitted = nullptr);
|
||||
|
@ -154,7 +154,7 @@ void ConnectionTests::tearDown()
|
|||
* \brief Variant of waitForSignal() where the sender is the connection and the action is a method of the connection.
|
||||
*/
|
||||
template <typename Action, typename... SignalInfo>
|
||||
void ConnectionTests::waitForConnection(Action action, int timeout, const SignalInfo &... signalInfo)
|
||||
void ConnectionTests::waitForConnection(Action action, int timeout, const SignalInfo &...signalInfo)
|
||||
{
|
||||
waitForSignals(bind(action, &m_connection), timeout, signalInfo...);
|
||||
}
|
||||
|
@ -163,8 +163,7 @@ void ConnectionTests::waitForConnection(Action action, int timeout, const Signal
|
|||
* \brief Variant of waitForSignalOrFail() where the sender is the connection and the action is a method of the connection.
|
||||
*/
|
||||
template <typename Action, typename FailureSignalInfo, typename... SignalInfo>
|
||||
void ConnectionTests::waitForConnectionOrFail(
|
||||
Action action, int timeout, const FailureSignalInfo &failureSignalInfo, const SignalInfo &... signalInfo)
|
||||
void ConnectionTests::waitForConnectionOrFail(Action action, int timeout, const FailureSignalInfo &failureSignalInfo, const SignalInfo &...signalInfo)
|
||||
{
|
||||
waitForSignalsOrFail(bind(action, &m_connection), timeout, failureSignalInfo, signalInfo...);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ foreach (LANGUAGE C CXX)
|
|||
else ()
|
||||
set(CGO_${LANGUAGE}FLAGS "${CMAKE_${LANGUAGE}_FLAGS_INIT} ${CMAKE_${LANGUAGE}_FLAGS_${CMAKE_BUILD_TYPE_UPPER}_INIT}")
|
||||
endif ()
|
||||
endforeach()
|
||||
endforeach ()
|
||||
set(CGO_LDFLAGS_OVERRIDE
|
||||
""
|
||||
CACHE STRING "overrides the 'CGO_LDFLAGS' variable")
|
||||
|
@ -171,10 +171,10 @@ add_custom_command(
|
|||
OUTPUT "${SYNCTHINGINTERNAL_LIBRARY_PATH}" "${SYNCTHINGINTERNAL_HEADER_PATH}"
|
||||
COMMAND
|
||||
"CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "AR=${CMAKE_C_COMPILER_AR}" "GOOS=${GO_TARGET_OS}"
|
||||
"CGO_CFLAGS=${CGO_CFLAGS}" "CGO_CXXFLAGS=${CGO_CXXFLAGS}" "CGO_LDFLAGS=${CGO_LDFLAGS}" "GOARCH=${GO_TARGET_ARCH}" "CGO_ENABLED=1"
|
||||
"GO111MODULE=on" "GOPATH=${GO_DEVELOPMENT_PATH}" "GOFLAGS=${GO_FLAGS}" "${GO_BIN}" build -v -buildmode c-archive -o
|
||||
"${SYNCTHINGINTERNAL_LIBRARY_PATH}" -ldflags "${GO_LINKER_FLAGS}" ./c-bindings && "${CMAKE_RANLIB}"
|
||||
"${SYNCTHINGINTERNAL_LIBRARY_PATH}"
|
||||
"CGO_CFLAGS=${CGO_CFLAGS}" "CGO_CXXFLAGS=${CGO_CXXFLAGS}" "CGO_LDFLAGS=${CGO_LDFLAGS}" "GOARCH=${GO_TARGET_ARCH}"
|
||||
"CGO_ENABLED=1" "GO111MODULE=on" "GOPATH=${GO_DEVELOPMENT_PATH}" "GOFLAGS=${GO_FLAGS}" "${GO_BIN}" build -v
|
||||
-buildmode c-archive -o "${SYNCTHINGINTERNAL_LIBRARY_PATH}" -ldflags "${GO_LINKER_FLAGS}" ./c-bindings &&
|
||||
"${CMAKE_RANLIB}" "${SYNCTHINGINTERNAL_LIBRARY_PATH}"
|
||||
DEPENDS ${SRC_FILES_SYNCTHING}
|
||||
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
||||
COMMENT "Building Syncthing itself")
|
||||
|
|
|
@ -278,7 +278,7 @@ template <typename SignalInfo> inline void connectSignalInfoToLoop(QEventLoop *l
|
|||
* \brief Connects the specified signal info the \a loop via SignalInfo::connectToLoop().
|
||||
*/
|
||||
template <typename SignalInfo, typename... Signalinfo>
|
||||
inline void connectSignalInfoToLoop(QEventLoop *loop, const SignalInfo &firstSignalInfo, const Signalinfo &... remainingSignalinfo)
|
||||
inline void connectSignalInfoToLoop(QEventLoop *loop, const SignalInfo &firstSignalInfo, const Signalinfo &...remainingSignalinfo)
|
||||
{
|
||||
connectSignalInfoToLoop(loop, firstSignalInfo);
|
||||
connectSignalInfoToLoop(loop, remainingSignalinfo...);
|
||||
|
@ -296,7 +296,7 @@ template <typename SignalInfo> inline bool checkWhetherAllSignalsEmitted(const S
|
|||
* \brief Checks whether all specified signals have been emitted.
|
||||
*/
|
||||
template <typename SignalInfo, typename... Signalinfo>
|
||||
inline bool checkWhetherAllSignalsEmitted(const SignalInfo &firstSignalInfo, const Signalinfo &... remainingSignalinfo)
|
||||
inline bool checkWhetherAllSignalsEmitted(const SignalInfo &firstSignalInfo, const Signalinfo &...remainingSignalinfo)
|
||||
{
|
||||
return firstSignalInfo && checkWhetherAllSignalsEmitted(remainingSignalinfo...);
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ template <typename SignalInfo> inline QByteArray failedSignalNames(const SignalI
|
|||
* \brief Returns the names of all specified signal info which haven't been emitted yet as comma-separated string.
|
||||
*/
|
||||
template <typename SignalInfo, typename... Signalinfo>
|
||||
inline QByteArray failedSignalNames(const SignalInfo &firstSignalInfo, const Signalinfo &... remainingSignalinfo)
|
||||
inline QByteArray failedSignalNames(const SignalInfo &firstSignalInfo, const Signalinfo &...remainingSignalinfo)
|
||||
{
|
||||
const QByteArray firstSignalName = failedSignalNames(firstSignalInfo);
|
||||
if (!firstSignalName.isEmpty()) {
|
||||
|
@ -332,7 +332,7 @@ inline QByteArray failedSignalNames(const SignalInfo &firstSignalInfo, const Sig
|
|||
* required connections can not be established.
|
||||
* \returns Returns true if all \a signalinfo have been omitted before the \a timeout exceeded.
|
||||
*/
|
||||
template <typename Action, typename... Signalinfo> bool waitForSignals(Action action, int timeout, const Signalinfo &... signalinfo)
|
||||
template <typename Action, typename... Signalinfo> bool waitForSignals(Action action, int timeout, const Signalinfo &...signalinfo)
|
||||
{
|
||||
return waitForSignalsOrFail(action, timeout, dummySignalInfo(), signalinfo...);
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ template <typename Action, typename... Signalinfo> bool waitForSignals(Action ac
|
|||
* \returns Returns true if all \a signalinfo have been omitted before \a failure as been emitted or the \a timeout exceeded.
|
||||
*/
|
||||
template <typename Action, typename SignalInfo, typename... Signalinfo>
|
||||
bool waitForSignalsOrFail(Action action, int timeout, const SignalInfo &failure, const Signalinfo &... signalinfo)
|
||||
bool waitForSignalsOrFail(Action action, int timeout, const SignalInfo &failure, const Signalinfo &...signalinfo)
|
||||
{
|
||||
// use loop for waiting
|
||||
QEventLoop loop;
|
||||
|
|
Loading…
Reference in New Issue