There were multiple reasons why the tests were flacky. First
Utils::reverseCompare had a bug. Now
std::lexicographical_compare(first.rbegin(), first.rend(),
second.rbegin(), second.rend())
is used.
Second the check StorageCache::checkEntries was not const. So it would
change the vector which it was iterating. So the iterator could be an
dangling.
Fixes: QDS-10197
Change-Id: I84fca6a2b24e1cae9fb85a01b6208de7e58240df
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
If you link to the internal Sqlite library you link actually twice. That
leads to strange bugs because you have an uninitialized object file. The
static linking workaround is now moved to cmake.
Change-Id: I51d966a623a18486ce5870d898999f3ce139f092
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The function is not used but triggers strange accesses to null pointer.
Task-number: QDS-10178
Change-Id: Iea51609f7b8956a98fe9391aef8edac899e14c03
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
There were problems with older google test versions which were found
instead. Now the google test version is always the same and there cannot
be "strange" compile bugs.
Change-Id: Ib3dc74d1abbe369fb37a4ee5616011d8e3696c01
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... with recent (namespaced) Qt dev.
[...]tests/unit/unittest/3rdparty/googletest/googletest/include/gtest/gtest-matchers.h:184:14: error: invalid conversion from 'const char*' to 'ushort' {aka 'short unsigned int'} [-fpermissive]
In file included from /data/dev/qt-6-ns/qtbase/include/QtCore/qstring.h:1,
from /data/dev/qt-6-ns/qtbase/include/QtCore/QString:1,
from /data/dev/creator-out/src/libs/utils/smallstringview.h:9,
from /data/dev/creator-out/src/libs/utils/smallstringliteral.h:8,
from /data/dev/creator-out/src/libs/utils/smallstring.h:8,
from /data/dev/creator-out/src/libs/utils/smallstringvector.h:8,
from /data/dev/creator-out/src/libs/utils/smallstringio.h:6,
from /data/dev/creator-out/tests/unit/unittest/gtest-creator-printing.h:7,
from /data/dev/creator-out/tests/unit/unittest/googletest.h:17,
from /data/dev/creator-out/tests/unit/unittest/externaldependenciesmock.h:6,
from /data/dev/creator-out/tests/unit/unittest/modulescanner-test.cpp:4:
a/dev/qt-6-ns/qtbase/src/corelib/text/qstring.h:1006:61: note: initializing argument 2 of 'bool Ns::operator==(const Ns::QString&, Ns::QChar)'
[104/1218] Building CXX object src/plugins/coreplugin/CMakeFiles/Core.dir/locator/executefilter.cpp.o^C
Change-Id: Id8d4533b9e53d7aa81edc64a99df31dd1d6ac5bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Instead of putting everything into one big target there are now
libraries which are used by the tests.
Change-Id: I15727924f76b5cb600b7e533e7a6b8701dba81e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
A majority prefers snake case for long names and because test names are
describtive they have to be long.
Change-Id: I898beb5c9f1b9ab7f7c285b6278454068744f5da
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
If an id is present in a binding expression and the node with that id is
removed we remove the expression is removed too.
Task-number: QDS-10018
Change-Id: I6c33005edcbcafbff7dd82af47977b238068eba1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Sometimes multiple nodes or properties has to be removed. In that case
there is also the possibilty that we want to bypass the model resource
management.
Task-number: QDS-9766
Change-Id: I6c3cb0f682a7579f23d72431f641e2f812e2c63c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This patch also includes a small update to skip creating 'shaderTool'
object in the json container if it doesn't exist in the qmlproject
file.
Task-number: QDS-9969
Change-Id: I1b8639c5e0a57aa77cbd417b51d57c1f4910613a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
The model is now deleting and changing the dependencies by itself. That
has the advantage of consistency. So if a node is now removed all the
dependecies will be deleted changing in the same way.
Task-number: QDS-9766
Change-Id: I1edf9ce172e51b9f52b62612ed2bb7386bf5b221
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The database has to be locked because otherwise it is not thread save.
Because Sqlite connections are already called in different threads this
has to be enforced. The easiest way to lock a database is to put it in a
transaction.
It should be ok without locking so long the connection is only called
from one thread but I prefer to enforce it because I have already seen
code was preparing a statement not on initialization stage where it is
highly unlikely that there is more than one thread pre connection but in
the middle of the code. Because preparing is much more expensive than a
lock I prefer to enfore a lock here.
Change-Id: Id0b47f8d615a6697bb807392cafbe976bdd37233
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
There are many callback which do not control the flow and want to be
called for all steps. For that case we assume that a callback without a
return value will continue always.
Change-Id: I706123f2c425ac8c937d4d60ab977dae5ea9b030
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
The lib is only built with Qt 6.4.3 and higher
Change-Id: I825bab26b90565d315fed4a3ad1a3e6adf726ac6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
As a node or property is removed there are now callbacks to generate
node, properties and expressions which should removed or adapt too.
Task-number: QDS-9766
Change-Id: I6d842006a6282af00ff644ffaa0f3102e14f13fa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Using a callable makes it possible to omit the commit call. It is now
called by the withDeferredTransaction and withImmediateTransaction
function.
Change-Id: I9b7bfa7e32f269fe8fcba2fe5e1218e73f5846d1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
https://www.sqlite.org/autoinc.html says that "If no negative ROWID
values are inserted explicitly, then automatically generated ROWID
values will always be greater than zero."
So zero is an invalid value.
This changes reflect on it and makes it an invalid value too. Null is a
special value in SQL and it could cast to zero by accident. To prevent
that ambiguty we make zero an invalid value too.
You can explicit add negative rowids but that has size overhead because
positive values can be compressed. So explicit not positive values are
not supported.
Change-Id: I417ea9fec1573cfd9f1a98134f8adc567021988c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Use SearchResultItem instead.
This change should reduce the remaining freeze described in
a9eb732ce6 even more.
Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>