summaryrefslogtreecommitdiff
path: root/tests/libebook/client
Commit message (Collapse)AuthorAgeFilesLines
* M!84 - Correct typos of doesnt/dontДилян Палаузов2021-11-081-1/+1
| | | | Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/84
* Use `g_assert_true()` instead of `g_assert()` in the unit testsMilan Crha2021-09-2910-40/+40
| | | | | | The `g_assert()` can be disabled by `G_DISABLE_ASSERT` when compiling, which is not desired for the unit tests, thus use the `g_assert_true()` in the tests instead.
* M!72 - Typos its <=> it'sДилян Палаузов2021-07-111-2/+2
| | | | Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/72
* test-book-client-write-write: Fix occasional test failureMilan Crha2021-06-111-35/+50
| | | | | | | Let it use the global main loop, to avoid stale GSource-s being lost in the private context scheduled by GDBus, which could cause a crash due to the GDBusConnection not being finalized at the end of the test.
* I#309 - EContact: Inline locally stored image does not retain its mime typeMilan Crha2021-03-081-6/+33
| | | | | | | | This broke with commit 0394a3bd9cd0b0cbf3a9bc1eac70f5a4849f6df6 for the file backend, because the EContact's e_contact_inline_local_photos() could not decipher the original MIME type from the file extension. Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/309
* I#282 - tests: Avoid build/source directories in executablesMilan Crha2021-01-0527-55/+127
| | | | Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/282
* Add workaround for D-Bus property change into get-revision testsMilan Crha2019-05-231-0/+13
| | | | | | | Even with the previous commit there still could happen some issue with D-Bus property change notifications, thus add a workaround to the related book and calendar tests, because it's not a problem on the evolution-data-server side, but somewhere deeper.
* Change libebook and libedata-book APIsMilan Crha2019-05-1715-33/+30
| | | | | Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/83 and https://gitlab.gnome.org/GNOME/evolution-data-server/issues/85
* test-cal-client-get-revision could fail due to delayed D-Bus property change ↵Milan Crha2018-11-131-1/+1
| | | | | | | | | | | notification The test had been mostly working, except cases when the delivery of a D-Bus property change signal had been delayed. Then the value on the client side was not the same as the value on the server side. There's a very similar test for EBookClient, which does slightly more things, which gives D-Bus enough time to deliver the property change to the client, thus this change adds the component removal to address it.
* Address some of the compiler and static analyzers warningsMilan Crha2018-05-171-10/+20
|
* Bug 787266 - Failure in installed testsMilan Crha2017-09-111-0/+8
|
* Merge offline-cache changes into masterMilan Crha2017-05-172-25/+18
|
* Reorganize directory structureMilan Crha2016-10-111-5/+6
| | | | | Let's have it as it's common to be, which means top level src/ for sources, single data/ for data, and so on.
* Convert from autotools to CMakeMilan Crha2016-10-105-180/+147
|
* Let the 'make check' pass againMilan Crha2015-02-034-7/+12
| | | | | | | | | Couple related changes: a) no need to wait for a connected state in tests, it only makes thing slower b) have larger interval for finalize wait c) avoid memory leak (and test failure) in test-book-client-view-operations d) update ko_KR alphabet in test-book-client-cursor-operations e) skip test-book-client-cursor-operations from 'make check', due it being too slow
* Move authentication of backends back to the clientMilan Crha2015-02-022-5/+5
| | | | | | Since this change the client is responsible to provide credentials to use to authenticate backends (through ESource-s, to be more precise), unless the credentials are already saved.
* Add (failing) test for Evolution's address autocompletion queryDavid Woodhouse2014-09-121-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [00:21] <tristan> dwmw2, if you really think that, then it will have to be rethought again, but if we're gonna rethink it again - please add a failing test case to test-client-custom-summary.c before we even go down that road. Here you go :) Note: This fails because we're using an inner join of folder_id with folder_id_email_list on uid. Which means that records in folder_id which don't *have* an email address aren't considered for the search. This is the query: SELECT DISTINCT summary.uid, summary.vcard, summary.bdata FROM 'folder_id' AS summary JOIN 'folder_id_email_list' AS email_list ON +email_list.uid = summary.uid WHERE ((summary.nickname IS NOT NULL AND summary.nickname LIKE 'p%') OR (email_list.value IS NOT NULL AND email_list.value LIKE 'p%') OR ((summary.full_name IS NOT NULL AND summary.full_name LIKE 'p%') OR (summary.family_name IS NOT NULL AND summary.family_name LIKE 'p%') OR (summary.given_name IS NOT NULL AND summary.given_name LIKE 'p%') OR (summary.nickname IS NOT NULL AND summary.nickname LIKE 'p%')) OR (summary.file_as IS NOT NULL AND summary.file_as LIKE 'p%')); You actually need a LEFT OUTER JOIN there, if you're going to do it that way. The above query takes about 1350ms on my data set with 238121 records. If I change it to a LEFT OUTER JOIN, it looks like it will literally take hours, so I didn't let it finish. I'm not sure what the '+' sign in 'ON +email_list.uid = summary.uid' is supposed to do, but if I *remove* that to make it 'LEFT OUTER JOIN … ON email_list.uid = summary.uid' the query then completes in about 1650ms. I can improve that by restructuring the query to look like this: SELECT DISTINCT summary.uid, summary.vcard, summary.bdata FROM 'folder_id' AS summary JOIN 'folder_id_email_list' AS email_list ON +email_list.uid = summary.uid WHERE (email_list.value IS NOT NULL AND email_list.value LIKE 'p%') UNION SELECT summary.uid, summary.vcard, summary.bdata FROM 'folder_id' AS summary WHERE ((summary.nickname IS NOT NULL AND summary.nickname LIKE 'p%') OR ((summary.full_name IS NOT NULL AND summary.full_name LIKE 'p%') OR (summary.family_name IS NOT NULL AND summary.family_name LIKE 'p%') OR (summary.given_name IS NOT NULL AND summary.given_name LIKE 'p%') OR (summary.nickname IS NOT NULL AND summary.nickname LIKE 'p%')) OR (summary.file_as IS NOT NULL AND summary.file_as LIKE 'p%')); That runs in about 460ms on my data set. I can get it down to about 400ms by eliding some of the IS NOT NULL checks that seem rather gratuitous (although shouldn't sqlite do that for itself since it's a fairly bloody obvious optimisation?): SELECT DISTINCT summary.uid, summary.vcard, summary.bdata FROM 'folder_id' AS summary JOIN 'folder_id_email_list' AS email_list ON +email_list.uid = summary.uid WHERE (email_list.value LIKE 'p%') UNION SELECT summary.uid, summary.vcard, summary.bdata FROM 'folder_id' AS summary WHERE ((summary.nickname LIKE 'p%') OR (summary.full_name LIKE 'p%') OR (summary.family_name LIKE 'p%') OR (summary.given_name LIKE 'p%') OR (summary.nickname LIKE 'p%') OR (summary.file_as LIKE 'p%')); Finally, if I actually add indices on the fields that need them, such as file_as, nickname, etc., I can get the search time down to 5-10ms. This *only* works for my refactored queries using 'UNION', and not for the JOIN versions. Obviously the indices aren't useful on the results of the JOIN. (Note: we did already have an index on file_as_localized, but not file_as. And likewise for some other fields).
* Bug 735523 - test-book-client-custom-summary: Add 'exists' testsDavid Woodhouse2014-09-011-0/+24
| | | | ... for email and X509 certificates.
* Bug #727237 - Correct LGPL license information in sourcesMilan Crha2014-04-1426-32/+286
| | | | | | | | | | | | | | | | | | | I also added license information to source files where it was missing and changed the way the license block is organized. All the sources' license information comments follow the same pattern: /* [ Optional short file description ] * * [ Optional copyright notices] * * License information block * * [ Optional 'Authors:' section ] */ The LGPL is references consistently now; source files with main() function, like tests or D-Bus services, use 'program' in the license information block, while the other sources use 'library' word.
* Bug 721527 - License text contains obsolete FSF postal addressMatthew Barnes2014-01-078-88/+72
|
* Coding style and whitespace cleanups.Matthew Barnes2013-12-0820-715/+779
|
* Moved all libebook/client tests to have a namespaceTristan Van Berkom2013-12-0425-96/+96
| | | | Avoid naming conflicts when installing tests into ${pkglibexecdir}/installed-tests
* Install test vcards if --enable-installed-tests is configured.Tristan Van Berkom2013-12-032-1/+10
| | | | | Also, load the vcards from ${pkglibexecdir}/installed-tests/vcards in the case that TEST_INSTALLED_SERVICES is specified
* Use EDS_INSTALLED_TESTS macros to install testsTristan Van Berkom2013-12-021-0/+42
| | | | | This commit adds the usage of EDS_INSTALLED_TESTS and a few lines to all the test directories which can run installed.
* test-client-cursor-operations.c: Removed bogus test for invalid sexpTristan Van Berkom2013-12-011-37/+6
| | | | No search expression is invalid anymore.
* test-client-custom-summary: Added test for the 'x-evolution-any-field' NULL ↵Tristan Van Berkom2013-12-011-0/+22
| | | | | | special case x-evolution-any-field with a NULL value (or byte) means 'get all contacts'.
* Fixed test-client-cursor-createTristan Van Berkom2013-11-291-75/+6
| | | | There is no such thing anymore as an invalid query for the cursor.
* test-client-uid-only-view: Fixed testTristan Van Berkom2013-11-291-30/+4
| | | | | | | | Now we aren't filtering by fields of interest for contact changes, so disabled the part of the test which adds a contact. This can be reverted if we so decide to filter it manually in EDataBookView
* test-client-revision-view: Disabled part of the test.Tristan Van Berkom2013-11-291-31/+4
| | | | | | Initial changes are filtered by fields-of-interest, however change notifications are not filtered, this is because it's actually faster to just send the vcard as is.
* test-client-custom-summary: Added various testsTristan Van Berkom2013-11-291-84/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Added test for the underscore Before we used to only escape the '%' character in LIKE statements, but SQLite also recognizes the '_' as a single char wildcard and needs escaping. This test ensures that the underscore is properly handled. o Added query test which ORs the same field This helps to test the query optimizer in EBookBackendSqlite, which will optimize a query which ORs two multi attribute fields (like E_CONTACT_EMAIL). o Added tests for the NOT queries o Added tests for NOT, AND and OR and as well as some nested AND / OR tests which trigger the query optimizer in EBookBackendSqlite o Fix expectations for phone number matches, now that the phone number comparisons are fixed o Added --filter option. Pass a regular expression to filter which test cases should run o Added test which searches by UID (can trigger bugs if normalization is mistakenly done on the UIDs).
* test-client-cursor-operations.c: Test cursor in fallback modeTristan Van Berkom2013-11-291-72/+109
| | | | | | | | | | | | | Now test the cursor functionality in cases where the cursor is using sort fields not in the summary (and search expressions not in the summary). Also added --filter option, pass a regular expression to filter which test cases should run Also increased TIMEOUT tollerance. This needs fixing, backends are not shutting down properly, locale changes get backed up and take more and more time as the test keeps running.
* test-client-custom-summary.c: Report specific error from add_contacts()Tristan Van Berkom2013-11-251-1/+1
|
* Makefile.am cleanups.Matthew Barnes2013-11-171-60/+61
| | | | | - Remove trailing tabs. - Add terminators to multi-line lists.
* Switch from g_timeout_add to g_timeout_add_secondsAlexandre Franke2013-11-141-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712244
* test-client-custom-summary.c: Added exact email match test.Tristan Van Berkom2013-11-141-0/+14
|
* Fix/mute issues found by Coverity scanMilan Crha2013-11-132-2/+6
| | | | | | | | | | | | This makes the code free of Coverity scan issues, except of the doc/ folder. It is sometimes quite pedantic and expects/suggests some coding habits, thus certain changes may look weird, but for a good thing, I hope. The code is also tagged with Coverity scan suppressions, to keep the code as is and hide the warning too. Also note that Coverity treats g_return_if_fail(), g_assert() and similar macros as unreliable, and it's true these can be disabled during the compile time, thus it brings in other set of 'weird' changes.
* Add missing CFLAGS/LIBS in the tests/ Makefile.am-sMilan Crha2013-11-051-0/+2
| | | | | | If the libical is installed in a different prefix than the one shared by other CFLAGS, then the test compilation breaks due to failed search for the <libical/ical.h> include file.
* Added tests for EBookClientCursorTristan Van Berkom2013-10-233-0/+3081
| | | | | | | | | | | | o test-client-cursor-create.c This test checks expected failure error codes and expected successfull cursor creation in Sync / Async and Normal / DRA modes. o test-client-cursor-operations.c A more complex set of tests which run in all various modes and configurations (i.e. Sync / Async / DRA / Threaded)
* Tests: Added 3 new contacts and a few more query tests.Tristan Van Berkom2013-10-231-1/+41
| | | | | The new tests check some specific phone number matching cases with E_BOOK_QUERY_EQUALS_NATIONAL_NUMBER queries.
* EBookClient tests: Use async apis to open the client for every async test.Tristan Van Berkom2013-10-1415-62/+82
|
* Remove all g_type_init() calls.Matthew Barnes2013-09-2722-66/+0
| | | | g_type_init() is deprecated in GLib 2.36.
* Miscellaneous cleanups.Matthew Barnes2013-07-281-8/+6
|
* test-client-custom-summary.c: Added tests for regex queriesTristan Van Berkom2013-05-301-2/+99
|
* Coding style and whitespace cleanup.Matthew Barnes2013-05-081-14/+18
|
* test-client-custom-summary.c: Optimize test.Tristan Van Berkom2013-04-231-112/+80
| | | | | | | | | | Reuse the same two addressbooks for every test, so that only the first 2 tests populate the addressbooks with contacts and the remaining tests only create a client and execute a query. Also add all test contacts with a single batch command and dont fetch the test contacts, also removed the #if 0'd case which is the only case which required the local contact copies.
* LC_ADDRESS is a GNU extension. Treat it as such.Matthew Barnes2013-04-171-0/+3
| | | | | | | | Unconditional use of the GNU extension LC_ADDRESS causes compiler errors on non-GNU systems. In test cases, use LC_MESSAGES if LC_ADDRESS is unavailable. Also fail gracefully with a log message if setlocale() fails.
* Test suite cleanups.Matthew Barnes2013-04-1422-247/+633
|
* Add e_book_client_view_ref_client().Matthew Barnes2013-03-174-4/+23
| | | | Replaces e_book_client_view_get_client().
* Reworked test cases in tests/libebook/client directoryTristan Van Berkom2013-03-1616-1362/+163
| | | | | | | | | | | | | | | | o Removed obsolete test cases: test-client-nonexistent-id: Test covered by test-client-remove-contact already test-client-examine: Unable to easily refactor test-client-search: A test which only applies to an existing addressbook, can't be useful in unit tests stress factories: Not worth refactoring, partly covered by tests in test-server-utils/test-fixture.c already o Revived several test cases which were not previously running at make check o Cleaned up client-test-utils.[ch]: now only includes convenience functions for loading contacts from the test case vcards.
* test-client-view-operations: Enhanced test to test both sync/async variants.Tristan Van Berkom2013-03-151-36/+158
| | | | | This used to be broken for Async, now that it works let's pin it down with a working test case for both Sync/Async access to book views.