Skip to content

Commit 9a4da4e

Browse files
committed
GP-0: Fixing cycle group tests and help
1 parent b95350f commit 9a4da4e

File tree

3 files changed

+30
-23
lines changed

3 files changed

+30
-23
lines changed

Ghidra/Features/Base/src/main/help/help/topics/DataPlugin/Data.htm

+4-4
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ <H3>Drag from Data Type Manager</H3>
610610
</BLOCKQUOTE>
611611

612612
<H3><A name="DataCycleGroups"></A><A name="Cycle__byte_word_dword_qword"></A><A name=
613-
"Cycle__float_double"></A> <A name="Cycle__char_string_unicode"></A>Cycle Groups</H3>
613+
"Cycle__float_double_longdouble"></A> <A name="Cycle__char_string_unicode"></A>Cycle Groups</H3>
614614

615615
<BLOCKQUOTE>
616616
<P>Cycle Groups are an easy way to apply <I>basic</I> data types (byte, word, float,
@@ -638,15 +638,15 @@ <H3><A name="DataCycleGroups"></A><A name="Cycle__byte_word_dword_qword"></A><A
638638
<TR>
639639
<TD width="19%"><B>'</B> (single quote)&nbsp;</TD>
640640

641-
<TD width="81%">Ascii <IMG src="help/shared/arrow.gif"> String <IMG src=
642-
"help/shared/arrow.gif"> Unicode <IMG src="help/shared/arrow.gif"> Ascii</TD>
641+
<TD width="81%">Char <IMG src="help/shared/arrow.gif"> String <IMG src=
642+
"help/shared/arrow.gif"> Unicode <IMG src="help/shared/arrow.gif"> Char</TD>
643643
</TR>
644644

645645
<TR>
646646
<TD width="19%"><B>f</B>&nbsp;</TD>
647647

648648
<TD width="81%">Float <IMG src="help/shared/arrow.gif"> Double <IMG src=
649-
"help/shared/arrow.gif"> Float</TD>
649+
"help/shared/arrow.gif"> LongDouble <IMG src="help/shared/arrow.gif"> Float</TD>
650650
</TR>
651651
</TBODY>
652652
</TABLE>

Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/data/AbstractDataActionTest.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -86,7 +86,7 @@ protected static Set<String> createFormatTestSkipList() {
8686
protected static final String CHOOSE_DATA_TYPE = "Choose Data Type";
8787

8888
// CycleGroupAction's
89-
protected static final String CYCLE_FLOAT_DOUBLE = "Cycle: float,double";
89+
protected static final String CYCLE_FLOAT_DOUBLE_LONGDOUBLE = "Cycle: float,double,longdouble";
9090
protected static final String CYCLE_BYTE_WORD_DWORD_QWORD = "Cycle: byte,word,dword,qword";
9191
protected static final String CYCLE_CHAR_STRING_UNICODE = "Cycle: char,string,unicode";
9292

@@ -182,7 +182,7 @@ protected void checkActions(Set<DockingActionIf> actions, boolean enabled, Strin
182182
checkAction(actions, CHOOSE_DATA_TYPE, enabled, caseStr);
183183
checkAction(actions, DEFAULT_SETTINGS, enabled, caseStr);
184184
checkAction(actions, DATA_SETTINGS, enabled, caseStr);
185-
checkAction(actions, CYCLE_FLOAT_DOUBLE, enabled, caseStr);
185+
checkAction(actions, CYCLE_FLOAT_DOUBLE_LONGDOUBLE, enabled, caseStr);
186186
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, enabled, caseStr);
187187
checkAction(actions, CYCLE_CHAR_STRING_UNICODE, enabled, caseStr);
188188
checkAction(actions, DEFINE_BYTE, enabled, caseStr);
@@ -1248,7 +1248,7 @@ else if (dt instanceof Array) {
12481248
checkAction(actions, CREATE_ARRAY, false, caseName);
12491249
checkAction(actions, DEFAULT_SETTINGS, hasSettings, caseName);
12501250
checkAction(actions, DATA_SETTINGS, hasSettings, caseName);
1251-
checkAction(actions, CYCLE_FLOAT_DOUBLE, false, caseName);
1251+
checkAction(actions, CYCLE_FLOAT_DOUBLE_LONGDOUBLE, false, caseName);
12521252
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, false, caseName);
12531253
checkAction(actions, CYCLE_CHAR_STRING_UNICODE, false, caseName);
12541254
checkAction(actions, DEFINE_BYTE, false, caseName);
@@ -1292,7 +1292,7 @@ protected void checkOnUndefined(Set<DockingActionIf> actions) {
12921292
checkAction(actions, CREATE_ARRAY, true, caseName);
12931293
checkAction(actions, DEFAULT_SETTINGS, false, caseName);
12941294
checkAction(actions, DATA_SETTINGS, hasNormalUnitSelection, caseName);
1295-
checkAction(actions, CYCLE_FLOAT_DOUBLE, true, caseName);
1295+
checkAction(actions, CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true, caseName);
12961296
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, true, caseName);
12971297
checkAction(actions, CYCLE_CHAR_STRING_UNICODE, true, caseName);
12981298
checkAction(actions, DEFINE_BYTE, true, caseName);
@@ -1360,7 +1360,7 @@ protected void checkOnDefined(Set<DockingActionIf> actions, Class<?> expectedDat
13601360
checkAction(actions, DEFAULT_SETTINGS,
13611361
(!hasSelection || isSelectionJustSingleDataInstance(sel, d)) && hasSettings, caseName);
13621362
checkAction(actions, DATA_SETTINGS, hasNormalUnitSelection || hasSettings, caseName);
1363-
checkAction(actions, CYCLE_FLOAT_DOUBLE, onFloatDoubleData, caseName);
1363+
checkAction(actions, CYCLE_FLOAT_DOUBLE_LONGDOUBLE, onFloatDoubleData, caseName);
13641364
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, onByteWordData, caseName);
13651365
checkAction(actions, CYCLE_CHAR_STRING_UNICODE, onCharData, caseName);
13661366
checkAction(actions, DEFINE_BYTE, true, caseName);
@@ -1423,7 +1423,7 @@ protected void checkOnArray(Set<DockingActionIf> actions, DataType interiorDt, i
14231423
checkAction(actions, DEFAULT_SETTINGS,
14241424
hasSettings && (!hasSelection || isSelectionJustSingleDataInstance(sel, d)), caseName);
14251425
checkAction(actions, DATA_SETTINGS, hasSettings, caseName);
1426-
checkAction(actions, CYCLE_FLOAT_DOUBLE, true, caseName);
1426+
checkAction(actions, CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true, caseName);
14271427
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, true, caseName);
14281428
checkAction(actions, CYCLE_CHAR_STRING_UNICODE, true, caseName);
14291429
checkAction(actions, DEFINE_BYTE, true, caseName);
@@ -1471,7 +1471,7 @@ protected void checkOnStructure(Set<DockingActionIf> actions, int structSize) {
14711471
checkAction(actions, CREATE_ARRAY, true, caseName);
14721472
checkAction(actions, DEFAULT_SETTINGS, false, caseName);
14731473
checkAction(actions, DATA_SETTINGS, hasNormalUnitSelection, caseName);
1474-
checkAction(actions, CYCLE_FLOAT_DOUBLE, true, caseName);
1474+
checkAction(actions, CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true, caseName);
14751475
checkAction(actions, CYCLE_BYTE_WORD_DWORD_QWORD, true, caseName);
14761476
checkAction(actions, CYCLE_CHAR_STRING_UNICODE, true, caseName);
14771477
checkAction(actions, DEFINE_BYTE, true, caseName);

Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/data/DataAction4Test.java

+17-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
*
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -410,7 +410,7 @@ public void testFloatCycle() {
410410
gotoLocation(0x010069f2);
411411
assertTrue("Undefined data expected", !getContextData().isDefined());
412412

413-
doAction(CYCLE_FLOAT_DOUBLE, true);
413+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
414414

415415
Set<DockingActionIf> actions = getDataPluginActions();
416416
assertEquals(ACTION_COUNT, actions.size());
@@ -430,11 +430,15 @@ public void testFloatCycle() {
430430
doAction(RECENTLY_USED, true);
431431
checkOnDefined(actions, FloatDataType.class);
432432

433-
doAction(CYCLE_FLOAT_DOUBLE, true);
433+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
434434
actions = getDataPluginActions();
435435
checkOnDefined(actions, DoubleDataType.class);
436436

437-
doAction(CYCLE_FLOAT_DOUBLE, true);
437+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
438+
actions = getDataPluginActions();
439+
checkOnDefined(actions, LongDoubleDataType.class);
440+
441+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
438442
actions = getDataPluginActions();
439443
checkOnDefined(actions, FloatDataType.class);
440444

@@ -445,13 +449,16 @@ public void testFloatCycle() {
445449

446450
makeSelection(0x01006a00, 0x01006a12);
447451

448-
doAction(CYCLE_FLOAT_DOUBLE, true);
452+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
449453
checkDataType(0x01006a00, 0x01006a12, FloatDataType.class, 5, 0);
450454

451-
doAction(CYCLE_FLOAT_DOUBLE, true);
455+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
452456
checkDataType(0x01006a00, 0x01006a12, DoubleDataType.class, 3, 0);
453457

454-
doAction(CYCLE_FLOAT_DOUBLE, true);
458+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
459+
checkDataType(0x01006a00, 0x01006a12, LongDoubleDataType.class, 3, 0);
460+
461+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
455462
checkDataType(0x01006a00, 0x01006a12, FloatDataType.class, 5, 0);
456463

457464
clearSelection();
@@ -462,11 +469,11 @@ public void testFloatCycle() {
462469
actions = getDataPluginActions();
463470
checkOnUndefined(actions);
464471

465-
doAction(CYCLE_FLOAT_DOUBLE, true);
472+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
466473
actions = getDataPluginActions();
467474
checkOnDefined(actions, FloatDataType.class);
468475

469-
doAction(CYCLE_FLOAT_DOUBLE, true);
476+
doAction(CYCLE_FLOAT_DOUBLE_LONGDOUBLE, true);
470477
actions = getDataPluginActions();
471478
checkOnUndefined(actions);
472479

0 commit comments

Comments
 (0)