aboutsummaryrefslogtreecommitdiff
path: root/source/cy/cui
ModeNameSize
-rw-r--r--messages.po408455logplain
eature/pdfium-master'>feature/pdfium-master LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/unotest
AgeCommit message (Collapse)Author
2023-05-05loplugin:unnecessarygetstrStephan Bergmann
The plugin in its current form is probably not intending to find these cases. But it happened to do so on macOS with libc++, where the std::basic_string ctors taking a final defaulted Allocator argument are instead implemented by a pair of overloaded ctors, one taking no Allocator at all (see 671d1c6cd14b28b5960ad56086299bd69533dfd8 "Adapt loplugin:unnecessarygetstr to libc++"). But these changes here are useful regardless, so lets leave it at that. Change-Id: I2776671e2953182bdcad36432951a75f82412ebb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151410 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-21qa: call ProcessEventsToIdle inside dispatchCommandXisco Fauli
Change-Id: I909e6f334f4a659282141a97ccb3ffdea6ecc364 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147397 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-21tdf#153752: SbxObject::Execute: extra characters in Option Compatible modeMike Kaganski
Change-Id: Ib3e4bd9eb9a249123a686f2434ded7b529fb050f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147345 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-12-10Introduce CPPUNIT_PROPAGATE_EXCEPTIONS environment variableStephan Bergmann
Often a developer debugging a failing CppUnit test wants a core dump with the place where an uncaught exception is thrown. So if the newly introduced CPPUNIT_PROPAGATE_EXCEPTIONS environment variable is set (to any value), disable all the protectors that would otherwise catch such exceptions (and just report some limited information about them). Change-Id: I3052f71c0787583c496279a6f5b35a0299c357b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143882 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-06tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macrojsala
Also change some range based for. Change-Id: I32c5cbe0033c40cde3f1fc86ec8af90e558f2652 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141666 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-11-03swmodeltestbase: remove duplicated codeXisco Fauli
parseExportStream is already in MacrosTest Change-Id: Ibde88b176db1521966b6877bda90e06c278c397d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142218 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-10-11Deduplicate O(U)StringConcatenationMike Kaganski
And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-29split utl::TempFile into fast and named variantsNoel Grandin
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-29Verify signing certificate cryptographically before use in testsMike Kaganski
Documents signed using an invalid (e.g., not having a trusted root) certificate give signatures that obviously can't pass validity tests. Change-Id: Id4b097516e06c548ea42cad65d76bbd8a6853cc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137620 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-29Better valid certificate check, consider filter dataMike Kaganski
Otherwise, testSignCertificateSubjectName that has an explicit certificate subject name requirement would fail when user has other valid certificates, but not this one. Change-Id: Ic3c440a8316314c922a53a51085a3e829f235f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137593 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-29unotest: fix NSS initialization for CentOS7 system NSSMichael Stahl
When given an unprefixed path, CentOS7 system NSS 3.67 apparently ignores the nice unit test database and creates a legacy "dbm:" one in the same directory, which is of course empty. This causes: xmlsecurity/qa/unit/signing/signing.cxx:570:aaa_testODFX509CertificateChain::TestBody equality assertion failed - Expected: 0 - Actual : 1 The intermediate/root CA certificates are read from the signature and added with CERT_NewTempCertificate(), which then does a lookup in the database to find the trust flags of the certificate: 0 nssTrust_GetCERTCertTrustForCert () at pki3hack.c:610 1 fill_CERTCertificateFields () at pki3hack.c:819 2 stan_GetCERTCertificate () at pki3hack.c:926 3 STAN_GetCERTCertificate () at pki3hack.c:973 4 add_cert_to_cache () at tdcache.c:721 5 nssTrustDomain_AddCertsToCache () at tdcache.c:849 6 cert_createObject () at pkibase.c:1023 7 nssPKIObjectCollection_GetObjects () at pkibase.c:853 8 nssPKIObjectCollection_GetCertificates () at pkibase.c:1077 9 nssTrustDomain_FindCertificateByIssuerAndSerialNumber () at trustdomain.c:796 10 nssTrustDomain_FindCertificateByEncodedCertificate () at trustdomain.c:839 11 NSSTrustDomain_FindCertificateByEncodedCertificate () at trustdomain.c:852 12 CERT_NewTempCertificate () at stanpcertdb.c:366 13 __CERT_NewTempCertificate () at stanpcertdb.c:474 14 SecurityEnvironment_NssImpl::verifyCertificate() () at xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:524 Change-Id: If334d056a9e13ad806e3ea1a03d395d606fd3d84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133622 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-01Fix the test failing when invalid certificate is in cert storeMike Kaganski
testSigningMultipleTimes_ODT was failing for me locally because of an expired certificate present in my store. Change-Id: Ie3dfb9ee1a110259ba747a03fc28c205df2eea91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130743 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-28Fix the tests failing when invalid certificate is in cert storeMike Kaganski
Change-Id: I72055c814a11a76c4934610bcad9c24aae21164e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130690 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-03Fix --disable-scripting for DESKTOP buildJan-Marek Glogowski
Unfortunatly we cannot add --disable-scripting to sub_conf_defaults, because Java currently has no equivalent to the PYTHON_FOR_BUILD setting. Change-Id: I89938a17307a363f5de808200914940503312829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126186 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-02PPTX export: handle theme colors from the doc model for shape textMiklos Vajna
As a start, do this only in case there are no effects used. If there is no theme color or there are effects, fall back to the old code. Also move parseExportStream() from SdModelTestBaseXML up to MacrosTest, so oox/ test code can use it as well. Change-Id: Ia76581dcef110341f6c3e60f22c34818ed0dcabc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126215 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-12Fix (mis-)uses of temporary O[U]StringLiteralStephan Bergmann
...as sub-expressions of ternary operators, which happened to keep compiling after 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String" and e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString" because both branches are of the same type O[U]StringLiteral<N>, and which didn't cause any issues because no dangling pointers to those temporary objects escaped the surrounding full expressions. This was found with an experimental build with VS 2022 with --enable-latest-c++, which would support HAVE_CPP_CONSTEVAL after some linking fix in the configure.ac detection code (which is forthcoming in a later commit) and flagged all these uses in ternary operators as error C7595 "call to immediate function is not a constant expression". That error looks bogus (and it also caused a false > sd/source/ui/unoidl/unoobj.cxx(742): error C7595: 'Color::Color': call to immediate function is not a constant expression so HAVE_CPP_CONSTEVAL will need to remain undefined for VS 2022 until that compiler bug is fixed), but it nicely found all these cases that should arguably be cleaned up. Change-Id: I81de94e8af5a6c50e5fe7dfa1a4b253e0c2a68f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125082 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-18xmlsecurity: fix new tests on WNTMichael Stahl
Tests added in commit 40d70d427edddb589eda64fafc2e56536953d274 don't actually run on WNT but that wasn't obvious because commit 149df1fec6472e30582162e17e04c75aee91d26a prevented running them in Jenkins on master, they failed only in the libreoffice-7-1 backport. xmlsecurity/qa/unit/signing/signing.cxx(631) : error : Assertion Test name: testODFDoubleX509Certificate::TestBody assertion failed - Expression: (nActual == SignatureState::NOTVALIDATED || nActual == SignatureState::OK) - 2 This is an oddity where NSS claims the signature in the document is valid but CryptoAPI claims it is invalid; the hashes passed into the validation functions are the same. Just allow BROKEN as an additional result value on WNT. xmlsecurity/qa/unit/signing/signing.cxx(550) : error : Assertion Test name: testODFX509CertificateChain::TestBody equality assertion failed - Expected: 0 - Actual : 1 The problem here is that with NSS the tests use a custom NSS database in test/signing-keys so we need to make these certificates available for CryptoAPI too. The following one-liner converts the NSS database to a PKCS#7 that can be loaded by CrytpAPI: > openssl crl2pkcs7 -nocrl -certfile <(certutil -d sql:test/signing-keys -L | awk '/^[^ ].*,[^ ]*,/ { printf "%s", $1; for (i = 2; i < NF; i++) { printf " %s", $i; } printf "\n"; }' | while read name; do certutil -L -d sql:test/signing-keys -a -n "${name}" ; done) > test/signing-keys/test.p7b Then one might naively assume that something like this would allow these certificates to be added temporarily as trusted CAs: + HCERTSTORE hRoot = CertOpenSystemStoreW( 0, L"Root" ) ; + HCERTSTORE const hExtra = CertOpenStore( + CERT_STORE_PROV_FILENAME_A, + PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, + NULL, + CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG, + path); + if (hExtra != NULL && hRoot != NULL) + { + BOOL ret = CertAddStoreToCollection( + hRoot, + hExtra, + CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, + 0); + SAL_DEBUG("XXX hExtra done " << ret); + } There is no error from this, but it doesn't work. Instead, check if CertGetCertificateChain() sets the CERT_TRUST_IS_UNTRUSTED_ROOT flag and then look up the certificate manually in the extra PKCS#7 store. Change-Id: Ic9865e0b5783211c2128ce0327c4583b7784ff62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123667 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-15test: upgrade test NSS database from dbm: to sql:Michael Stahl
Fedora nss-3.69.0-1.fc34.x86_64 and Debian libnss3:amd64 2:3.70-1 no longer support the old BerekelyDB databases, so convert them to the new SQLite format for the benefit of --with-system-nss builds. This worked to do the upgrade: > certutil -N -d sql:test/new --empty-password > LD_LIBRARY_PATH=instdir/program workdir/UnpackedTarball/nss/dist/out/bin/certutil --merge -d sql:test/new --source-dir dbm:test/signing-keys Builds would fail running tests added in commit 40d70d427edddb589eda64fafc2e56536953d274 signing.cxx:551:Assertion Test name: testODFX509CertificateChain::TestBody equality assertion failed - Expected: 0 - Actual : 1 Change-Id: I00aa20703e117ebf583c3331b84e966c2cfc78cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123586 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-03A more lightweight O[U]StringConcatenationStephan Bergmann
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-06make --disable-scripting compileCaolán McNamara
Change-Id: Ie2be232e062389b74408dd9f001b1cf4db7db7d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120123 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>