/icon-themes/sifr_dark_svg/dbaccess/

re' title='lo/core Git repository'/>
summaryrefslogtreecommitdiff
path: root/configmgr/qa/unit
AgeCommit message (Collapse)Author
2024-05-07loplugin:ostr in configmgrNoel Grandin
Change-Id: If1caaee8e54b5861e1435e900b3ae7bd90ecae5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167237 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2023-05-24Fix CppunitTest_configmgr_unit for --disable-report-builderStephan Bergmann
...after abd630e81bc150d05e4129cc22752ecf461777c7 "Allow all hierarchical path segments to be ['...'] quoted", which failed as the checked MimeTypeClassIDRelations group is conditional on install:module="reportbuilder". (See the comments at <https://gerrit.libreoffice.org/c/core/+/151673/2#message-f029dd1877f8a946647456ed73a7b60f6dfc0e8f> "Allow all hierarchical path segments to be ['...'] quoted".) It looks like there is no other, non-conditional property with a slash in its name, so the test now just tests the ['...'] syntax on an otherwise unproblematic property name. (Alternatively, we could have extended the configuration data used by unit tests with such a problematicaly named property.) Change-Id: I820004a5b824326d86e67c158994f13e71ba135e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152184 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-11Allow all hierarchical path segments to be ['...'] quotedStephan Bergmann
...and not just set elements. <https://gerrit.libreoffice.org/c/core/+/151660> "tdf#104005 Don't allow changing finalized properties" found that some existing property names include "/", which makes them unusable with e.g. getPropertyByHierarchicalName. The most obvious solution is to allow ['...'] quoting (without a leading template name, though) for all kinds of hierarchical path segments. (In theory, that would cause backwards incompatibility, as e.g. a property named ['foo'] could no longer be referenced by a ['foo'] path segment (it would need to be referenced by a ['[&apos;foo&apos;]'] path segment instead). But in practice, that path segment ['foo'] would have been rejected in the past anyway, as it did not reference a set element.) To make this work, the meaning of the setElement out-parameter of configmgr::Data::parseSegment is changed to only be true if the segment uses ['...'] notation including a leading (non-empty) template name. What this change does not (yet) address is writing out such quoted (group or set) names in the hierarchical paths written out in configmgr::writeModFile, where necessary. (It never writes out names of properties as parts of hierarchical names, so this wouldn't be an issue for the existing problematic properties containing "/" in their names, anyway.) Change-Id: I635d823c7bbb6b8ac5869c7e0130ba8cfd329599 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151673 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-17Verify that zh-Hant-TW locale works in configmgr as intendedStephan Bergmann
...after b52117c0be97c45824d2897657084f8ac7e9bf42 "Try an override locale as first fallback" Change-Id: I23d8459fff4d76fd9d542d098953bf97cf5397a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147219 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-17Verify that es-419 locale works in configmgr as intendedStephan Bergmann
...after a9b97301ba75a74e6671a6b9829f7044e85db6af "Do not add empty language tag to fallback strings" Change-Id: Ie42929c2ce6331012358f72026ae774b9dd0e369 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147207 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-16Do not add empty language tag to fallback stringsEike Rathke
This happened for known tags like es-419 but unhandled in simpleExtract(), which actually should be implemented as now a few are mapped as known tags. Prevent adding such empty string. For that, adjust configmgr/qa/unit/test.cxx to test for the expected "en-US" instead of "default". Change-Id: I05f8e35a9d88b42d45e1f2a90aecec5f4470cc79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147135 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-02-16Improve testLocalizedPropertyStephan Bergmann
c3bd52f81bf733a0b9b0560794a54b2ac1e0f444 "Use the (first segment of the) original locale value for the workaround again" had stated: "The added test code unfortunately doesn't actually test this piece of code, and somewhat unexpectedly receives the "default" value from the empty string locale default, rather than the "en-US" value from the higher precedence "en-US" locale default, because `aFallbacks` happens to contain an empty string, so we already leave Access::getChild early in the 'Find the best match using the LanguageTag fallback mechanism, excluding the original tag' block." But, of course, the relevant code can well be tested after all, using a localized property that does not have a default no-xml:lang value. (And add a TODO comment about the unexpected "default" vs. "en-US" in the original test code, in case the LanguageTag::getFallbackStrings behavior ever changes and the test starts to fail.) Change-Id: I526a830a5929b6b5ad17ba57af5943954b07b86a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147137 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-15Use the (first segment of the) original locale value for the workaround againStephan Bergmann
cf7c9599e776eba8e14614cecb528d3da5778190 "Make comphelper/configuration.hxx work for localized properties", which had originally introduced this code, had been careful to ensure that the > assert( > !locale.isEmpty() && locale.indexOf('-') == -1 && > locale.indexOf('_') == -1); would always hold here (it had already removed all trailing "-..." and "_..." segments, but had made sure to stop before `locale`, which is known to initially be no non-empty, would have become empty, by treating a leading "-" or "_" not as a segment delimiter, but rather as a first segment). dfc28be2487c13be36a90efd778b8d8f179c589d "configmgr: Use a proper LanguageTag-based locale fallback mechanism" had changed that, instead setting `locale` to some value obtained from `LanguageTag::getFallbackStrings`, which might or might not satisfy the assert. But there was no good reason for that part of dfc28be2487c13be36a90efd778b8d8f179c589d in the first place: The workaround (as explained in the leading code comment) was meant to be carried out with the first segment of the original `locale` value, not with some fallback value. So put back here the computation of that first segment of the original `locale` value. (And drop the misleading empty line that dfc28be2487c13be36a90efd778b8d8f179c589d had, for no good reason, introduced between the workaround's leading code comment and its actual code.) However, it turns out that there was one flaw in cf7c9599e776eba8e14614cecb528d3da5778190: When the original `locale` starts with "-" or "_", the resulting `locale` representing the first segment will be "-" or "_", so the `locale.indexOf('-') == -1 && locale.indexOf('_') == -1` part of the assert would be false. But that wouldn't be an issue for the following code (the only issue would be if `locale` had become empty, in which case the `name2.startsWiht(locale)` check would trivially become true, and that for loop would erroneously pick the child with the empty `name2`), and that part of the assert had merely been there to reinforce that `locale` had indeed been stripped down to the first segment. A correct version of the assert would have used `locale.indexOf('-', 1) == -1 && locale.indexOf('_', 1) == -1` instead, but as the code now makes it obvious anyway that `locale` has been cut down here to the first segment, we can just as well simplify the assert to just the `!locale.isEmpty()` part. (The added test code unfortunately doesn't actually test this piece of code, and somewhat unexpectedly receives the "default" value from the empty string locale default, rather than the "en-US" value from the higher precedence "en-US" locale default, because `aFallbacks` happens to contain an empty string, so we already leave Access::getChild early in the "Find the best match using the LanguageTag fallback mechanism, excluding the original tag" block.) Change-Id: Ib92e714c9db4879be058529ec905e631df975424 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147113 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-15Add a rudimentary test for localized propertiesStephan Bergmann
Change-Id: I9abe06e6f1f2b6b39cbbf07043dd9c5062ff0460 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147108 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-15Remove unused configmgr/qa/unit/urebootstrap.iniStephan Bergmann
...left behind by 6a370f580aaf060004536dfc8ca877c9a2114c66 "configmgr: remove unused old dmake file" Change-Id: I9209b672f0b3242f6801935722b3108ef692787a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147096 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>