Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -17,27 +17,27 @@
#include <vector>
#ifdef WITH_GL_MOCK
# include "base/scope_guard.hpp"
# include "drape/drape_tests/gl_mock_functions.hpp"
#include "base/scope_guard.hpp"
#include "drape/drape_tests/gl_mock_functions.hpp"
#endif
#ifdef OMIM_OS_IPHONE
# include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CoreFoundation.h>
#endif
#ifndef OMIM_UNIT_TEST_DISABLE_PLATFORM_INIT
# include "platform/platform.hpp"
#include "platform/platform.hpp"
#endif
#if defined(OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP) && !defined(OMIM_OS_IPHONE)
#include <QtCore/Qt>
#ifdef OMIM_OS_MAC // on Mac OS X native run loop works only for QApplication :(
#include <QtWidgets/QApplication>
#define QAPP QApplication
#else
#include <QtCore/QCoreApplication>
#define QAPP QCoreApplication
#endif
#include <QtCore/Qt>
#ifdef OMIM_OS_MAC // on Mac OS X native run loop works only for QApplication :(
#include <QtWidgets/QApplication>
#define QAPP QApplication
#else
#include <QtCore/QCoreApplication>
#define QAPP QCoreApplication
#endif
#endif
namespace testing
@@ -50,7 +50,7 @@ void RunEventLoop()
{
#if defined(OMIM_OS_IPHONE)
CFRunLoopRun();
#elif defined (QAPP)
#elif defined(QAPP)
QAPP::exec();
#endif
}
@@ -100,18 +100,15 @@ void DisplayOption(ostream & os, char const * option, char const * description)
void DisplayOption(ostream & os, char const * option, char const * value, char const * description)
{
os << " " << setw(kOptionFieldWidth) << left << (string(option) + value) << " "
<< description << '\n';
os << " " << setw(kOptionFieldWidth) << left << (string(option) + value) << " " << description << '\n';
}
void Usage(char const * name)
{
cerr << "USAGE: " << name << " [options]\n\n";
cerr << "OPTIONS:\n";
DisplayOption(cerr, kFilterOption, "<ECMA Regexp>",
"Run tests with names corresponding to regexp.");
DisplayOption(cerr, kSuppressOption, "<ECMA Regexp>",
"Do not run tests with names corresponding to regexp.");
DisplayOption(cerr, kFilterOption, "<ECMA Regexp>", "Run tests with names corresponding to regexp.");
DisplayOption(cerr, kSuppressOption, "<ECMA Regexp>", "Do not run tests with names corresponding to regexp.");
DisplayOption(cerr, kDataPathOptions, "<Path>", "Path to data files.");
DisplayOption(cerr, kResourcePathOptions, "<Path>", "Path to resources, styles and classificators.");
DisplayOption(cerr, kListAllTestsOption, "List all the tests in the test suite and exit.");
@@ -215,19 +212,13 @@ int main(int argc, char * argv[])
}
int testIndex = 0;
for (TestRegister *test = TestRegister::FirstRegister(); test; ++testIndex, test = test->m_next)
for (TestRegister * test = TestRegister::FirstRegister(); test; ++testIndex, test = test->m_next)
{
auto const & testname = testnames[testIndex];
if (g_testingOptions.m_filterRegExp &&
!regex_search(testname.begin(), testname.end(), filterRegExp))
{
if (g_testingOptions.m_filterRegExp && !regex_search(testname.begin(), testname.end(), filterRegExp))
continue;
}
if (g_testingOptions.m_suppressRegExp &&
regex_search(testname.begin(), testname.end(), suppressRegExp))
{
if (g_testingOptions.m_suppressRegExp && regex_search(testname.begin(), testname.end(), suppressRegExp))
continue;
}
LOG(LINFO, ("Running", testname));
if (!g_lastTestOK)
@@ -257,7 +248,7 @@ int main(int argc, char * argv[])
++numFailedTests;
}
}
catch (TestFailureException const & )
catch (TestFailureException const &)
{
testResults[testIndex] = false;
++numFailedTests;
@@ -284,10 +275,8 @@ int main(int argc, char * argv[])
{
LOG(LINFO, (numFailedTests, " tests failed:"));
for (size_t i = 0; i < testnames.size(); ++i)
{
if (!testResults[i])
LOG(LINFO, (testnames[i]));
}
LOG(LINFO, ("Some tests FAILED."));
return STATUS_FAILED;
}
@@ -297,4 +286,7 @@ int main(int argc, char * argv[])
}
} // namespace testing
int main(int argc, char * argv[]) { return ::testing::main(argc, argv); }
int main(int argc, char * argv[])
{
return ::testing::main(argc, argv);
}