CppunitTest_desktop_lib: handle SignatureState::OK after loading
The purpose of DesktopLOKTest::testGetSignatureState_Signed() is to make
sure that in case we don't trust a cert and we add the necessary CAs,
then we trust the cert.
So just return early when we trust the cert already, it's not an
interesting failure.
Change-Id: I32f24b5464a0e14156292de2acda562025ded73f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98673
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 4eeb728..5b6947f 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2411,6 +2411,12 @@ void DesktopLOKTest::testGetSignatureState_Signed()
Scheduler::ProcessEventsToIdle();
pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
int nState = pDocument->m_pDocumentClass->getSignatureState(pDocument);
if (nState == 1)
{
// Already SignatureState::OK, then can't test the effect of trusting new CAs.
return;
}
CPPUNIT_ASSERT_EQUAL(int(4), nState);
std::vector<unsigned char> aCertificate;