summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* put hbtree in a namespaceOswald Buddenhagen2013-03-132-2/+10
| | | | Change-Id: Ibf9ea22d79b362872075cf219f112bfa5e865b76
* remove obsolete DEPENDPATH assignmentsOswald Buddenhagen2012-12-166-6/+0
| | | | | | | | qmake now add CONFIG+=depend_includepath by default, making manual DEPENDPATH setup unnecessary. Change-Id: I20c8e552abdc507c3a6a468e7b2740b2c14c0a4b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* make use of qt_headersclean.prfOswald Buddenhagen2012-12-132-58/+2
| | | | | | Change-Id: I8efef39364a2d2c92cbcfab766831241013abba3 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
* use qputenv instead of ::setenvJamey Hicks2012-10-142-14/+14
| | | | | Change-Id: I9d24e1d0d0d15da8f4f3995d12ff5b5e793aef12 Reviewed-by: Kevin Simons <kevin.b.simons@gmail.com>
* Remove append-only btreeJamey Hicks2012-10-114-1521/+1
| | | | | Change-Id: I2d08fbbd4971bb980a2ed5fa65d38e53d9ba1c32 Reviewed-by: Kevin Simons <kevin.b.simons@gmail.com>
* Removed old deprecated c++ api.Denis Dzyubenko2012-10-1110-1223/+3
| | | | | | | This also removed old-style qml api that was using the old c++ api internally. Change-Id: Iee809bfacb4efeb31e625156420542247354dff7 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2448-1157/+1157
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I8e8328d8df56e83f13b19858434aeb6e5f888f30 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* don't take addresses of temporary arraysOswald Buddenhagen2012-08-061-3/+5
| | | | | | | for gcc 4.7, this is an error Change-Id: Ia65da9f5547bab983e20e34f02bdc0c5f37e2270 Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
* Set the Qt API level to compatibility mode in all tests and in one lib.Thiago Macieira2012-08-0126-0/+29
| | | | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. In QtJson's case, it's using old itemviews API in one library and those cases haven't been ported yet. Task-number: QTBUG-25053 Change-Id: If732cdc29097fe3a3117b8ed2b392f6f154360ef Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Test that the package configs for QtJsonDb work.Stephen Kelly2012-07-235-0/+90
| | | | | Change-Id: I739be37d8d9edcd19473d8033ed0fa4879f088ea Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* switch to new-style configure testsOswald Buddenhagen2012-06-271-1/+1
| | | | | | | Change-Id: I6e22f8b74d769315d635738dcdef038e61c80e0f Reviewed-by: Jing Bai <jing.t.bai@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* build system cleanupsOswald Buddenhagen2012-06-279-27/+18
| | | | | | | | | | | | | | - load(qt_module) => load(qt_build_config) - remove: - CONFIG+=module (obsolete) - pointless CONFIG+=create_prl - pointless setting of QMAKE_FRAMEWORK_BUNDLE_NAME - code relating to module version headers (automated now) - %mastercontent assignment (automated now) - qmake -project boilerplate Change-Id: I036d7e737b4458309067c383642cddfb90599f62 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Use consistent naming of partitions in testJo Asplin2012-06-131-4/+4
| | | | | | | | Partition names within the same case should have the same suffix. Change-Id: Ib4ff0fbcd823ce8fe44a80a540087c79bafb6b9a Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
* Make sure invalid partition function calls work propertlyAli Akhtarzada2012-06-131-0/+41
| | | | | | | | Make sure the return values are what is expected and that there is no seg faulting Change-Id: I344835bca44ba0277813ae2465b79f286fd11f37 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Fixes access to private partitions from multiple threads.Denis Dzyubenko2012-06-111-0/+135
| | | | | | | | | Multiple QJsonDbConnection instances (possibly living in different threads) should be able to safely access same or different private partitions. Change-Id: Idfb435784dd173ed661835f0f20986d1c50e0d7a Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* Fix a crash in query modelTapani Mikola2012-06-112-0/+66
| | | | | | | | Query model (and list model that uses it) was crashing, if query was changed while the model had pending queries. Change-Id: Ibaa5c72696d201200ba4e5c53d17594625df3b97 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Fixed subscription to a notification without explicitly specifying _typeDenis Dzyubenko2012-06-111-0/+32
| | | | | | | | | | | | If the don't know the _type we cannot figure out the object table the object is stored in, so for now lets assume it is the main object table. This will still be broken if the assumption is wrong and the query like [?_uuid="{123}"] is actually against a view object, but this should be fixed in one of the next patches where we remove the concept of object tables and store all objects in one main object table. Change-Id: Icc259cc857b691acca3f316d7dea29244616ffe3 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Added a signal QJsonDbReadObjectRequest::objectUnavailable()Denis Dzyubenko2012-06-081-0/+40
| | | | | | | | | | | | There was already a convenience signal that is emitted when object is found, however when object is not found in the database, nothing but finished() was emitted with zero results, which made the convenience api not convenient to use :) Change-Id: I3ea18ac37bbfd60a090b2f9f5b662df30133437e Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Jing Bai <jing.t.bai@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Removed some redundant codeJo Asplin2012-06-081-2/+2
| | | | | Change-Id: I4b39adcb17376a1c1be2bf3610b9d31eb05b3d3a Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
* Ensure default partition on non-removable mediumJo Asplin2012-06-083-119/+215
| | | | | | | | | | | | | | | | This patch modifies the behavior introduced by 53df42aee7db1b4f8446c63939d2cb3b7c553078 as follows: Upon loading a partition definition that has both the removable and default properties set to true, the daemon now sets the default property to false instead of exiting. If all partitions are marked as removable, the daemon creates a new one (in CWD, assumed to be on a non-removable medium!) to serve as the default partition. Change-Id: Ia2911d5847040bef7a638d64e8102eba4c8c60a8 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Fixed created QJsonDbWatcher with invalid state numberDenis Dzyubenko2012-06-083-2/+60
| | | | | | | | | if the state number is too far in the future, or the partition is not available, or the watcher spans multiple object tables, report an error to the caller. Change-Id: I4b1e4fa2859b1e781f5b3d70e639c70fab1ae2db Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Add a benchmark that mimics the way how list model uses jsondbTapani Mikola2012-06-071-0/+33
| | | | | Change-Id: Ia5895aa11728a2c4e2f6478bc39540dfc393dff3 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Use correct include for message handlerKai Koehne2012-06-071-1/+1
| | | | | Change-Id: I074e4a84999ff22b547eedb19d9f6a9b28b002d8 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Removed unnecessary LIBS from autotestsDenis Dzyubenko2012-06-074-8/+0
| | | | | Change-Id: I9cd02837532e36b594a6cb01c6f620e175ce2844 Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
* Enable JS injection in Json DbGuenter Schwann2012-06-064-0/+99
| | | | | Change-Id: I0a0a4497fda098d9bbe6f97d32bcfd4f2a872137 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Update all the eager views that depend on a source object changeJamey Hicks2012-06-062-0/+101
| | | | | | | | | | | | | This previous change to this part of the code was to prevent a given object change from being processed multiple times. However, I put the break in the wrong level of the loop, so only the first eager view depending on that source type would be updated, and others would just be marked as updated without being processed. Fixes Bug #16440. Change-Id: I1634a249e4ec6923100950fc5f45e449588b01d2 Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
* Use JsonDbCachingListModel to provide also JsonDbListModelTapani Mikola2012-06-052-128/+98
| | | | | | | | | | | | | | | | | | | No sense to maintain two implementations of the same functionality. JsonDBListModel was also blocking the ui way too much. Added (deprecated) methods & properties to caching list model to support JsonDbListModel. Setters were not implemented as it is a bad idea anyway and Partition.update should be used. After that renamed caching list model as JsonDBListModel. Changed also documentation accordingly. Incompatibilities: Setters are not supported and data() is async (=can return undefined + signal dataChanged later on when real data is available) Change-Id: I641d80361db728a3cdf1584e75ad18f22d9223a8 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Get rid of debug clutter in parition auto testsAli Akhtarzada2012-06-051-10/+19
| | | | | Change-Id: I25bdc36b070ea5f0e96da375bedbc1444759b994 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Changed HBtree to take advisory lock on each open of the db file.Denis Dzyubenko2012-06-041-1/+13
| | | | | | | | | | | | This changes btree to hold the advisory lock the whole time the btree file is kept open and accessed. The current implementation does not support concurrent access from multiple processes (or even from multiple file descriptors in the same process) - neither for writes nor for reads. Holding the lock on the file should ensure that if somehow multiple processes try to open the same database file, we don't just corrupt the db file, but gracefully fail to open it. Change-Id: Ib0c6e3aec0e087fedbfbb859758773182e74e46f Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* Don't mess up JSONDB_SOCKET environment variableJo Asplin2012-06-041-3/+15
| | | | | | | | | | | | | TestQJsonDbRequest::dontAllowDefaultAndRemovablePartition() launches a secondary test daemon that updates the global JSONDB_SOCKET environment variable as a side effect. It therefore needs to restore it back to the primary value after each call. Also eliminate runtime warnings due to the path not being explicitly set in the partition definition. Change-Id: I2a201d4f4fff419f0f6d04582c4c4210ea0094f0 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Autotest for storage system.Carlos Manuel Duclos Vergara2012-06-043-1/+279
| | | | | | | | The purpose of this autotest is to check different storage conditions, including out of space and device errors. Change-Id: I47bf94ea7f3f9c41bfc1f1036f6047f5e214e9d4 Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
* Add new private QJsonDbQueryModel class to client.Cristiano di Flora2012-06-043-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change separates the cachinglistmodel logic from the implementation of qml-specific aspects of the jsondbcachinglistmodel. The code is migrated into new private classes in client and reused by the imports/jsondb models. The new classes include functionality of the following components previously embedded in the qml jsondb plugin: - JsonDbCachingListModel - modelutils - modelcache In the new setup, the QJsonDbQueryModel class implements the functionality previously provided by the src/imports/jsondb JsonDbCachingListModel and JsonDbCachingListModelPrivate classes. Modelutils and modelcache helpers are now also part of the private API in client. No functional / performance regression is observed after running models tests and benchmarks on top of this. The idea is to make QJsonDbQueryModel part of the public C++ api after a few rounds of reviewes & iterations. Change-Id: Ia6e2368a4cb7c7485087e714642e00ff686945b7 Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
* Refactoring and bug fixes in TestHelperJo Asplin2012-06-042-81/+39
| | | | | | | | | | | | | | | | This patch contains the following improvements in the code that launches the test daemon: - Introducing a _helper function to eliminate code duplication in launchJsonDbDaemon() and launchJsonDbDaemonDetached() - Fixing two bugs when launching the test daemon in detached mode: - valgrind didn't work - a null-pointer access would have happened if the working directory was explicitly set Change-Id: I761ecfb2833d79263bed69eea2dd537c37f51099 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Implemented Flush request for private partitions.Denis Dzyubenko2012-06-011-0/+15
| | | | | Change-Id: I29d8b4df901b7739ef6760755d16998377b696bd Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Fixed to use new api qInstallMessageHandler.Denis Dzyubenko2012-06-011-2/+2
| | | | | | Change-Id: If4eae928e8a21b76de481daf3905f6de4a46456f Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
* Don't allow a removable partition to be defaultJo Asplin2012-06-013-16/+145
| | | | | | | | | | | | | | | Only non-removable partitions should be allowed to be used as the default partition. This patch enforces this policy by having the daemon exiting with an error message once it sees that 1) at least one partition is explicitly specified as both default and removable, or 2) all partitions are specified as removable (thus making it impossible to auto-select a valid default partition) Change-Id: I7084c228c6eb9db7bef44cae75a4d5a7c58299e9 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Added a benchmark to measure performance with many active watchers.Denis Dzyubenko2012-05-301-0/+31
| | | | | Change-Id: I059419b63d18ce89b865e91a2e60e90b4c806604 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Add option to enforce javascript strict modeJamey Hicks2012-05-301-1/+1
| | | | | | | | | | | | | Add JsonDbSettings::useStrictMode() to control whether jsondb enforces javascript strict mode. To enable: JSONDB_USE_STRICT_MODE=true jsondb Fixes Bug #16114 Change-Id: I01891984d4a2d48a4aaa1b1294d8c993b7b12608 Reviewed-by: Jing Bai <jing.t.bai@nokia.com>
* extend autotest timeout limit and fix packingBai Jing2012-05-292-7/+3
| | | | | | Change-Id: I95d81cbf365c186325e8ac23901fb4e506ab3766 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Ali Akhtarzada <ali.akhtarzada@nokia.com>
* Changed behavior of QJsonDbConnection::defaultConnection().Denis Dzyubenko2012-05-291-0/+15
| | | | | | | | It is much more convenient if it is safe to assume that the returned default connection is already connected, or will be autotomatically connected. Change-Id: I5e0d89ad34f156b5cee5ca6e0f25eb79c32a2bca Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Changed QJsonDbWatcher to change its status to Inactive later.Denis Dzyubenko2012-05-291-0/+21
| | | | | | | | | | | QJsonDbWatcher was setting its status to Inactive before the deactivation request was processed by the server (and hence it was possible to receive notifications and emit notificationsAvailable() signal even though the status == Inactive). Fixed it to deactive asynchronously so that the status changes when the server replies to deactivation request. Change-Id: If2940e7afb9d1cb75d0579657f6f2c95e2c50099 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Fixed a crash in QJsonDbWatcherDenis Dzyubenko2012-05-291-0/+15
| | | | | | | | | When the watcher is added and then removed right away, there is an internal request in the queue that will trigger later and call a _q_onFinished slot in the watcher, which can hit the assert and crash. Change-Id: Ibe3cd42b3124328516bce716045597b0319d8364 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* remove duplicate section in tests.xmlBai Jing2012-05-291-4/+0
| | | | | Change-Id: I7687ae1e7aa02cdc296423d8e60046d5e118cc49 Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
* change the path to start tests and add missing testsBai Jing2012-05-292-18/+46
| | | | | Change-Id: Ic65f10f97e8556d1d80f51f506f12ca438e186db Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
* Revert "Added QJsonDbRequest::error() and errorString()."Tapani Mikola2012-05-291-13/+0
| | | | | | | | | This reverts commit deac81d4ef114ffc157467183d02d539618a14d1. Breaks the connect because of overloaded error (signal and function) Change-Id: If46e8be5f090ef97f5b832a86c0b81bcb4aa9cb7 Reviewed-by: Ian Monroe <ian.monroe@nokia.com> Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
* Fix auto tests build with gcc 4.7Anselmo L. S. Melo2012-05-263-0/+12
| | | | | | | | | | Due to changes in include files in gcc 4.7, the header unistd.h now has to be included in some situations. Change-Id: Ib7e56d2356c98973909494be9dc8ee414e6fbfbf Reviewed-by: Jing Bai <jing.t.bai@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
* Fix the real reason for testcase slownessTapani Mikola2012-05-261-3/+2
| | | | | | | And clean up one unused variable. Change-Id: I740ec41f7931d8a01d9827855d180b44fc5bd0aa Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Make a testcase run fasterTapani Mikola2012-05-251-8/+9
| | | | | Change-Id: I4f224d8fd8990f91b383fc691f7e814a92eea1c2 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Added a test that reads from multiple private partitions.Denis Dzyubenko2012-05-257-25/+89
| | | | | | | | | For that to work I've added QJsonDbStandardPaths that has convenience functions for retrieving home directories for different users and a switch for using a prefix instead of real users, which can be used in autotests. Change-Id: Ibcbba2fe17498b722f5cbe33fc3a1c16f75f3283 Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
* Changed the way we find path to private partitions.Denis Dzyubenko2012-05-251-2/+2
| | | | | Change-Id: I2ee101126b494287ae8d4a62601ed49d510cf56a Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>