QVERIFY/QCOMPARE are meant to be called in the test function so that on
failure they just can "return" and thus skip subsequent code. Since we
use reusable test code in the test functions (the *TestCase classes), we
need to ensure that on failure no further test code is executed.
This mostly inlines the run function of the test classes into the
constructor.
Change-Id: I320ee032bdde0174ddfe3fdf3f9e18e19abf1d7f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Move common functionality of the 12 test classes into base classes.
Change-Id: If64d3cec876807ac6f991151189860a99b8ff4ca
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Needed for easier diff for upcoming refactoring...
Change-Id: I779b25d09a03fc1ed54e2ba35946678a5e863265
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
When a class was directly assigned to a variable the definition was
misplaced right after the variable.
Task-number: QTCREATORBUG-10303
Change-Id: I2cdfee784b085d856d7ff5ebe62bf791b9a6754e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Rewrites post increment/decrement operators (++ and --) as pre
increment/decrement operators and moves non string/numeric literals and
non id expressions from loops condition to loops initializer.
Change-Id: Id95334b6df6fcaa9af436cc1d2d0982d38bf8fe2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Starting with commit 243a625 EditorManager::closeEditors() does not
delete the editors anymore, but calls deleteLater(). When the call
returns, all kind of checks fail since the editor widget destructor was
not yet called.
Fixed by providing and calling Core::Tests::closeAndDeleteEditors(),
which explicitly sends QEvent::DeferredDelete to the widget.
Change-Id: I3287abbe74ccf7d7a18b997a847701c8be17cb55
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This speeds up the quick fix InsertDefFromDecl on function declarations
in classes containing Q_OBJECT.
Task-number: QTCREATORBUG-9877
Change-Id: I0af16f17f40735040b7158a3191c13db3433edf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Now the used QuickFixFactory InsertVirtualMethods is configured to not
generate any pop ups.
Change-Id: I36d297678d87e6fb2eb0a73fea6384f0eb7e21f0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* Affected quick fixes: InsertDefFromDecl, MoveFuncDefOutside
* Fix also reformating pointer declaration of operator functions for
qualified name ids
Change-Id: I6a7578f496221557d103f5fdbb5dacc9540ee779
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Now InsertDefFromDecl finds the right implementation file and the speed
of match() is improved.
Task-number: QTCREATORBUG-9627
Change-Id: Ibff824f52124e8cc10ccb6a97c133e11565473db
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Consequent use of insertLocationForMethodDefinition respects the
surrounding namespace when moving/inserting definitions.
Task-number: QTCREATORBUG-2676
Task-number: QTCREATORBUG-9332
Change-Id: I6d83cf84d844dd4773900d03563581c88befa7b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
With this patch it is checked if the function/new-expression is used in
a function call or return statement the whole AST down to the
translation unit.
Task-number: QTCREATORBUG-9525
Change-Id: I34b30ee64b9436c9c9d2586c28fd22f148bee892
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
When triggering move or insert definition outside and no other class
symbol is found in the file, the definition is moved or inserted right
after the enclosing Class.
Change-Id: I74ffa872015753ba7372e21b868d3cf7fa49e84a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
For the quick fix AddIncludeForUndefinedIdentifier, if no class is found
via the locator, check the "Qt include paths" for a header file with the
same name as the class name.
Task-number: QTCREATORBUG-9538
Change-Id: I13c86844c2ff653fa479dc91eb109af2a6d76fae
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Now definitions are inserted at the same position inside the
implementation file for MoveFuncDefOutside and InsertDefFromDecl.
Task-number: QTCREATORBUG-9389
Change-Id: If823ffd15ec39a7bc2edb53519380cb9cabb4c55
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Now it is checked if the adjacent declaration is also defined and one
can define the destination file.
Change-Id: Ifff59c49fc2ab3e2f36f41df42ae4b7d7ff8dd35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
interface is already defined in the Windows 7 SDK headers.
Change-Id: Ic154d45017fc32dca1721f4a0f18456f370bd604
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
...to be consistent with inserting "Outside Class" and "in xxx.cpp".
Change-Id: I32a43153d5d3bdec9fae0be731484a26b108c438
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
...by detecting include groups (separated by new lines, include types
and same dir prefix).
Task-number: QTCREATORBUG-9317
Change-Id: I73e80fdc715104901cb2d4f5b15b4cab5d04d305
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Do not trigger for functions inside a function call.
Task-number: QTCREATORBUG-9510
Change-Id: I908483fe80ff3ac0f737b21061375e206c1b1d1d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Doing so resulted in an incorrect position for the EOF token when the
preprocessed output would be parsed. That in turn leads to incorrect
insertion positions for refactoring actions.
This is especially true when a file contains only preprocessor
directives: the EOF token would point to line 1 column 1, which is
usually not the place where code should be inserted.
Change-Id: I7d359aa7a6c04bc52c8b873fd49ad6afc3a77319
Reviewed-by: hjk <hjk121@nokiamail.com>
"Add Definition Inside/Outside Class" was wrongly shown when there was
already an definition outside the class.
Change-Id: I6409080c6a1a3abdd4511f7db14ecb4f63458411
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This quick fix inserts (pure) virtual functions of base classes to the
current class. For selecting the functions which should be inserted and
for choosing the insertion mode (only declarations or with definitions
inside, outside or in the implementation file) a dialog is shown.
Task-number: QTCREATORBUG-2210
Task-number: QTCREATORBUG-2692
Task-number: QTCREATORBUG-3908
Task-number: QTCREATORBUG-5868
Task-number: QTCREATORBUG-7982
Change-Id: I8e94905afcae4778986f4c3925a494e0c6b3b8ee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>