// Copyright (C) 2016 BogDan Vatra // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once #include #include #include #define ASSERT_STATE_GENERIC(State, expected, actual) \ AndroidGlobal::assertState(expected, actual, Q_FUNC_INFO) namespace Android { class AndroidGlobal { public: template static void assertState(State expected, State actual, const char *func) { assertState(QList() << expected, actual, func); } template static void assertState(const QList &expected, State actual, const char *func) { if (!expected.contains(actual)) { qWarning("Warning: Unexpected state %d in function %s.", actual, func); } } }; } // namespace Android