Obsolete Members for QTest

QTest 클래스의 다음 멤버들은 더 이상 사용되지 않는 것으로 지정되었습니다. 이 멤버들은 기존 소스 코드가 계속 작동하도록 유지하기 위해 제공됩니다. 새로운 코드에서는 이 멤버들을 사용하지 않는 것을 강력히 권장합니다.

함수

(deprecated in 6.4) bool compare_helper(bool success, const char *failureMsg, char *actualVal, char *expectedVal, const char *actual, const char *expected, const char *file, int line)
(deprecated in 6.3) void qWarn(const char *message, const char *file = nullptr, int line = 0)

매크로

(deprecated in 6.3) QVERIFY_EXCEPTION_THROWN(expression, exceptiontype)
(deprecated) QWARN(message)

함수 설명서

[deprecated in 6.4] bool QTest::compare_helper(bool success, const char *failureMsg, char *actualVal, char *expectedVal, const char *actual, const char *expected, const char *file, int line)

이 함수는 6.4 버전부터 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

이 함수는 QTest::qCompare의 다양한 특수화 클래스에서 호출되어 실패를 보고할지 여부를 결정하고, 상세한 테스트 출력을 생성합니다.

failureMsg 매개변수는 null일 수 있으며, 이 경우 비교가 실패하면 기본 메시지가 출력됩니다. 비교가 성공하면 failureMsg는 출력되지 않습니다.

이 함수를 사용하는 것은 최적의 방법이 아닙니다. 비교가 실패할 때만 사용되더라도 actualVal 와 expectedVal 의 문자열 표현을 미리 계산해야 하기 때문입니다. 이러한 경우에는 qxp::function_ref()를 인수로 받는 compare_helper() 오버로드를 사용하는 것이 좋습니다.

호출자가 비교된 값을 표시하는 사용자 정의 실패 메시지를 생성하거나, 해당 값을 문자열로 변환할 수 없는 경우에는 actualVal 및 expectedVal 매개변수를 받지 않는 이 함수의 오버로드를 사용하십시오.

[deprecated in 6.3] void QTest::qWarn(const char *message, const char *file = nullptr, int line = 0)

이 함수는 6.3 버전부터 더 이상 사용되지 않습니다. 새로운 코드에서는 이 함수를 사용하지 않는 것을 강력히 권장합니다.

대신 ` qWarning()`를 사용하십시오.

매크로 문서

[deprecated in 6.3] QVERIFY_EXCEPTION_THROWN(expression, exceptiontype)

이 매크로는 6.3 버전부터 더 이상 권장되지 않습니다. 새로운 코드에서는 이 매크로를 사용하지 않는 것이 좋습니다.

대신 ` QVERIFY_THROWS_EXCEPTION(exceptiontype, expression) `을 사용하십시오.

[deprecated] QWARN(message)

이 매크로는 더 이상 권장되지 않습니다. 새로운 코드에서는 이 매크로를 사용하지 말 것을 강력히 권장합니다.

대신 qWarning()을 사용하십시오.

테스트 로그에 message 를 경고 메시지로 추가합니다. 이 매크로는 테스트 내 어디서나 사용할 수 있습니다.

참고: 이 매크로는 스레드 안전합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.