Last change
on this file since 18327 was 18327, checked in by GerdP, 2 years ago |
fix #21550: NPE in org.openstreetmap.josm.gui.tagging.presets.items.PresetListEntry.getCount
- add null check (patch by taylor.smock)
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.tagging.presets.items;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
---|
5 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
---|
6 |
|
---|
7 | import org.junit.jupiter.api.BeforeAll;
|
---|
8 | import org.junit.jupiter.api.Test;
|
---|
9 | import org.openstreetmap.josm.JOSMFixture;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Unit tests of {@link PresetListEntry} class.
|
---|
13 | */
|
---|
14 | class PresetListEntryTest {
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Setup test.
|
---|
18 | */
|
---|
19 | @BeforeAll
|
---|
20 | public static void setUp() {
|
---|
21 | JOSMFixture.createUnitTestFixture().init();
|
---|
22 | }
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/12416">#12416</a>.
|
---|
26 | */
|
---|
27 | @Test
|
---|
28 | void testTicket12416() {
|
---|
29 | assertTrue(new PresetListEntry("", null).getListDisplay(200).contains(" "));
|
---|
30 | }
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/21550">#21550</a>
|
---|
34 | */
|
---|
35 | @Test
|
---|
36 | void testTicket21550() {
|
---|
37 | final PresetListEntry entry = new PresetListEntry("", new Combo());
|
---|
38 | assertDoesNotThrow(entry::getCount);
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.