summaryrefslogtreecommitdiff
path: root/tests/libebook
Commit message (Collapse)AuthorAgeFilesLines
* 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-1720-112/+196
|
* Correct how data for installed tests are searched forMilan Crha2017-02-171-1/+1
|
* Reorganize directory structureMilan Crha2016-10-113-9/+12
| | | | | 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-109-358/+300
|
* Address/mute some Coverity Scan issuesMilan Crha2016-01-251-1/+1
|
* 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-012-0/+25
| | | | ... for email and X509 certificates.
* Bug #727237 - Correct LGPL license information in sourcesMilan Crha2014-04-1440-36/+472
| | | | | | | | | | | | | | | | | | | 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-079-99/+81
|
* Coding style and whitespace cleanups.Matthew Barnes2013-12-0821-716/+780
|
* 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
* tests: Fix potential g_object_unref(NULL) calls in libebook testsPhilip Withnall2013-12-032-4/+4
| | | | | | Found by scan-build. https://bugzilla.gnome.org/719533
* Install test vcards if --enable-installed-tests is configured.Tristan Van Berkom2013-12-034-3/+30
| | | | | 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-022-0/+50
| | | | | 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-293-86/+482
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Ported the lower level cursor tests to use EBookSqlite.Tristan Van Berkom2013-11-294-2/+4
| | | | | | | | | | | | Refactored the whole test suite so that it's isolated to libedata-book, use the EBookSqlite directly. Now for the majority of test cases, we test with and without fields in the summary (with an empty summary configuration) and we also test the EBookSqlite with a callback to fetch vcards and without a callback. We also now test for e164 number change notifications in locale changes.
* test-client-custom-summary.c: Report specific error from add_contacts()Tristan Van Berkom2013-11-251-1/+1
|
* Makefile.am cleanups.Matthew Barnes2013-11-173-132/+147
| | | | | - Remove trailing tabs. - Add terminators to multi-line lists.
* Switch from g_timeout_add to g_timeout_add_secondsAlexandre Franke2013-11-143-3/+3
| | | | 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-133-3/+8
| | | | | | | | | | | | 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-052-0/+4
| | | | | | 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)
* Added tests for the low level cursor APITristan Van Berkom2013-10-2333-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o test-sqlite-create-cursor The new test case verifies that cursor creation is well protected (cursor creation is denied for some queries and ordering requests). o test-sqlite-cursor-move-by This test case asserts that e_book_backend_sqlite_cursor_move_by() works as expected. Consequently, a hand full of additional test vcards were added for this. o test-sqlite-cursor-set-target.c This test case tests e_book_backend_sqlitedb_cursor_set_target(). The special case of setting a partial state is tested so that when a cursor is setup to sort by "family_name, given_name" and the target is set to "J", then we recieve results inclusive of the contact with the family name "J". o test-sqlite-cursor-calculate.c This test verifies that e_book_backend_sqlitedb_cursor_calculate() report the right position and total values when the cursor is moved, after the target is set, after the addressbook is modified, for filtered and unfiltered result sets. o test-sqlite-cursor-set-sexp.c This test verifies that invalid queries are rejected, and that a cursor position is changed by the new sexp with the correct new filtered values after applying a filter (sexp) to the cursor. o Tests to ensure that localized data is properly migrated: - test-sqlite-cursor-posix-initial - test-sqlite-cursor-en-US-migrated - test-sqlite-cursor-fr-CA-migrated - test-sqlite-cursor-de-DE-migrated - test-sqlite-cursor-posix-migrated o A test case testing basic ECollator features. This patch also changes the test case vcard data to specify a contact UID in each vcard's .vcf file, this allows us more flexability with the above added tests.
* Tests: Added 3 new contacts and a few more query tests.Tristan Van Berkom2013-10-235-1/+62
| | | | | 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-2734-103/+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-305-2/+117
|
* 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-1433-287/+764
|
* Add e_book_client_view_ref_client().Matthew Barnes2013-03-174-4/+23
| | | | Replaces e_book_client_view_get_client().
* Adding the custom vcard test data to EXTRA_DISTTristan Van Berkom2013-03-161-0/+9
| | | | This was causing make distcheck to break.
* 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.
* Removed obsolete test cases from tests/libebookTristan Van Berkom2013-03-1514-998/+0
| | | | | | | | | | | | | | | | | | | | | | | Removed the following cases: deleted: test-bulk-methods.c deleted: test-changes.c deleted: test-ebook-async.c deleted: test-ebook-stress-factory--fifo.c deleted: test-ebook-stress-factory--serial.c deleted: test-ebook-stress-factory--single-book.c deleted: test-ebook.c deleted: test-nonexistent-id.c deleted: test-search.c deleted: test-self.c deleted: test-stress-bookviews.c Many of these tests are covered by other cases, some of them are completely unsupported now (like test-changes.c). The ebook-test-utils.[ch] has been cleaned up to remove book creation / opening routines (which is now all covered by the test fixture).
* tests: Migration of EContact related tests into a new directoryTristan Van Berkom2013-03-1510-1242/+2
| | | | | | | | | Much of the tests on contact types have been merged into test-contact-types.c, all relevant tests now use GTest. One test fails and has been commented out, test-untyped-phones.c has it (it still issues a compiler warning intentionally, in the hope we don't forget about it).
* 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.
* test-client-view-operations.c: Add thread assertions to callbacks.Matthew Barnes2013-03-141-0/+8
| | | | Make sure EBookClientView signals are emitted on the expected thread.