1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3#include <QTest>
4
5// dummy class
6class MyObject
7{
8 public:
9 int isReady();
10};
11
12// dummy function
13int myNetworkServerNotResponding()
14{
15 return 1;
16}
17
18int MyObject::isReady()
19{
20//! [1]
21 int i = 0;
22 while (myNetworkServerNotResponding() && i++ < 50)
23 QTest::qWait(ms: 250);
24//! [1]
25return 1;
26}
27

source code of qtbase/src/testlib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp