55
55
import ghidra .program .model .symbol .*;
56
56
import ghidra .program .util .ProgramSelection ;
57
57
import ghidra .test .*;
58
+ import ghidra .util .Msg ;
58
59
import ghidra .util .task .TaskMonitor ;
59
60
60
61
public class Function1Test extends AbstractGhidraHeadedIntegrationTest {
@@ -354,6 +355,7 @@ public void testRevertThunkFunction() throws Exception {
354
355
Function func = createThunk (addr ("0x10030d2" ), "comdlg32.dll::CommDlgExtendedError" , true );
355
356
356
357
assertTrue (cb .goToField (addr ("0x10030d2" ), "Function Signature" , 0 , 0 ));
358
+ assertTrue (func .isThunk ());
357
359
358
360
performAction (revertThunk , cb .getProvider (), false );
359
361
@@ -369,6 +371,19 @@ public void testRevertThunkFunction() throws Exception {
369
371
370
372
undo (program );// undo changed function
371
373
374
+ if (!func .isThunk ()) {
375
+
376
+ Msg .debug (this , "\n \t >>> test will fail...waiting a bit to see if it is timing" );
377
+ waitForValueWithoutFailing (() -> {
378
+
379
+ Msg .debug (this , "\t checking again..." );
380
+ if (!func .isThunk ()) {
381
+ return null ; // not ready
382
+ }
383
+ return true ;
384
+ });
385
+ }
386
+
372
387
assertTrue (func .isThunk ());
373
388
assertEquals ("CommDlgExtendedError" , func .getName ());
374
389
@@ -886,8 +901,8 @@ public void testArray() throws Exception {
886
901
Variable [] vars = function .getLocalVariables (VariableFilter .STACK_VARIABLE_FILTER );
887
902
tx (program , () -> {
888
903
DataType byteDT = program .getDataTypeManager ()
889
- .addDataType (new ByteDataType (),
890
- DataTypeConflictHandler .DEFAULT_HANDLER );
904
+ .addDataType (new ByteDataType (),
905
+ DataTypeConflictHandler .DEFAULT_HANDLER );
891
906
vars [1 ].setDataType (byteDT , SourceType .ANALYSIS );
892
907
});
893
908
@@ -1278,6 +1293,7 @@ public void testInvalidDataTypeSize() throws Exception {
1278
1293
// the following text (this is only a part of the status message, but is enough
1279
1294
// to verify the test):
1280
1295
assertTrue (dialog .getStatusText ().contains ("doesn't fit within" ));
1296
+ close (dialog );
1281
1297
}
1282
1298
1283
1299
//==================================================================================================
0 commit comments