diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-14 12:06:28 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-14 12:09:53 +0100 |
commit | 9ab76447cd7e1c61bc284c810734227438aa13c7 (patch) | |
tree | e8e3d450e66e7251d154715b0318e4de2ad1eb60 /qadevOOo | |
parent | a93db93c563c268786e834b816b03468e793f48a (diff) |
LinkUpdateMode property values must be in the range 0--2 or 0--3
...avoid setting bad values from generic qadevOOo property set tests, and throw
an IllegalArgumentException if bad values do get set. Found via
-fsanitize=enum. The TODO about ScLkUpdMode vs. LinkUpdateModes mismatch looks
worrying.
Change-Id: Ibc01845e7e3179dc693fe8c59c1f1ffad5282420
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/lib/MultiPropertyTest.java | 2 | ||||
-rw-r--r-- | qadevOOo/runner/util/ValueChanger.java | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/qadevOOo/runner/lib/MultiPropertyTest.java b/qadevOOo/runner/lib/MultiPropertyTest.java index b314ccf8626b..918d5e6f372e 100644 --- a/qadevOOo/runner/lib/MultiPropertyTest.java +++ b/qadevOOo/runner/lib/MultiPropertyTest.java @@ -454,7 +454,7 @@ public class MultiPropertyTest extends MultiMethodTest protected Object getNewValue(String propName, Object oldValue) throws java.lang.IllegalArgumentException { - return ValueChanger.changePValue(oldValue); + return ValueChanger.changePValue(oldValue, propName); } /** diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index 197de43c81d6..05b52329e0bb 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -58,9 +58,15 @@ public class ValueChanger { newValue = Long.valueOf(oldlong + 15); } else if (oldValue instanceof Short) { short n = ((Short) oldValue).shortValue(); - // css.form.component.{CheckBox,RadioButton} DefaultState properties - // must have values in the range 0--2: if ("DefaultState".equals(name) && n == 2) { + // css.form.component.{CheckBox,RadioButton} DefaultState + // properties must have values in the range 0--2: + --n; + } else if ("LinkUpdateMode".equals(name) && n >= 2) { + // css.document.Settings LinkUpdateMode property must have + // values in the css.document.LinkUpdateModes range (0--3), + // while css.sheet.XGlobalSheetSettings LinkUpdateMode property + // must have values in the range 0--2: --n; } else { ++n; |