port library

This commit is contained in:
2024-03-07 17:57:05 +02:00
parent 5fd3a4a21a
commit 0fcfb7d7e4
38 changed files with 208 additions and 139 deletions

View File

@ -13,16 +13,16 @@ include_directories(
${PROJECT_TRDPARTY_DIR}
${Qt_INCLUDE}
${Qt5Test_INCLUDE_DIRS}
${Kf5_INCLUDE}
${Kf6_INCLUDE}
)
# library
set(AWTESTLIBRARY_HEADERS awtestlibrary.h)
set(AWTESTLIBRARY_SOURCES awtestlibrary.cpp)
add_library(${SUBPROJECT}-awtest STATIC ${AWTESTLIBRARY_SOURCES} ${AWTESTLIBRARY_HEADERS})
target_link_libraries(${SUBPROJECT}-awtest ${Qt_LIBRARIES} ${Qt5Test_LIBRARIES} ${Kf5_LIBRARIES})
target_link_libraries(${SUBPROJECT}-awtest ${Qt_LIBRARIES} ${Qt5Test_LIBRARIES} ${Kf6_LIBRARIES})
set(LIBRARY_TEST_SET ${SUBPROJECT}-awtest ${PROJECT_LIBRARY} ${PROJECT_MONITORSOURCES}
${Qt_LIBRARIES} ${Kf5_LIBRARIES} ${Qt5Test_LIBRARIES})
${Qt_LIBRARIES} ${Kf6_LIBRARIES} ${Qt5Test_LIBRARIES})
# modules
set(TEST_MODULES

View File

@ -18,6 +18,7 @@
#include "testawpatternfunctions.h"
#include <QRegularExpression>
#include <QtTest>
#include "awpatternfunctions.h"
@ -57,7 +58,7 @@ void TestAWPatternFunctions::test_findKeys()
QStringList allKeys;
for (int i = 0; i < count; i++) {
auto key = AWTestLibrary::randomString(1, 20);
while (allKeys.indexOf(QRegExp(QString("^%1.*").arg(key))) != -1)
while (allKeys.indexOf(QRegularExpression(QString("^%1.*").arg(key))) != -1)
key = AWTestLibrary::randomString(1, 20);
allKeys.append(key);
}