summaryrefslogtreecommitdiff
path: root/tests/libebook/data
Commit message (Collapse)AuthorAgeFilesLines
* test-client-custom-summary: Added various testsTristan Van Berkom2013-11-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* 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.
* Added tests for the low level cursor APITristan Van Berkom2013-10-2332-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-233-0/+18
| | | | | The new tests check some specific phone number matching cases with E_BOOK_QUERY_EQUALS_NATIONAL_NUMBER queries.
* test-client-custom-summary.c: Added tests for regex queriesTristan Van Berkom2013-05-303-0/+15
|
* test-client-custom-summary enhancements.Tristan Van Berkom2013-02-281-0/+1
| | | | | | | | | | | | o Added an invalid phone number to custom-6.vcf o Added a query test ensuring that E_CLIENT_ERROR_INVALID_QUERY is reported for a completely bogus query 'sexp' string. o Added a query test ensuring that E_CLIENT_ERROR_INVALID_QUERY is reported for a phone number query where an invalid phone number term is provided. o Added a query test ensuring that an invalid phone number string can still be matched using a normal E_BOOK_QUERY_BEGINS_WITH query on the E_CONTACT_TEL field (matching the invalid number in custom-6.vcf).
* tests: Actually use existing country calling codeMathias Hasselmann2013-02-251-1/+1
| | | | | | Some tests assumed that the national portion of "+3-221-5423789" would match the national portion of "+1-221-5423789". Sadly the country calling of of that number is "+32", not "+3" like assumed.
* test-client-custom-summary.c: Adding more tests regarding phone numbers.Tristan Van Berkom2013-02-222-0/+10
| | | | | | The nature of phone number matching is complex, some additional tests are required to ensure that this works to spec (perhaps more tests will be added here as well).
* Extending test-client-custom-summary.cTristan Van Berkom2013-02-201-0/+4
| | | | | | Added test to ensure that phone numbers are not accidentally normalized, and that we dont get a result for ENDS_WITH "8899" if a phone number ending with "88 99" exists in the addressbook.
* Store E.164 phone number values automatically in the vCardTristan Van Berkom2013-02-171-1/+1
| | | | | | | | | | | The E.164 normalized phone number is of interest for handset related applications. With this change a X-EVOLUTION-E164 attribute is added to each TEL attribute if the contact summary contains a E.164 formatted variant of the phone number. This shall avoid overhead and inconsistency that would occur if clients would use their own mechanism to compute that already stored information. Updated Mathias Hasselmann's patch on bug 689622 to apply to current master.
* libebook: Support phone number specific queriesMathias Hasselmann2013-01-231-1/+1
| | | | | | | | | | | | | This adds new values to the EBookQueryTest enumeration: * E_BOOK_QUERY_EQUALS_PHONE_NUMBER * E_BOOK_QUERY_EQUALS_NATIONAL_PHONE_NUMBER * E_BOOK_QUERY_EQUALS_SHORT_PHONE_NUMBER This values get translated to the binary sexp functions "eqphone", "eqphone_national" and "eqphone_short". See: https://bugzilla.gnome.org/show_bug.cgi?id=689622
* Fixed test-client-custom-summary to actually passTristan Van Berkom2012-12-072-0/+4
| | | | | | Was missing a vcard modification to test for EVC_N component, also enhanced test case to test both apis for each case and added one case to check the special '%' escape char is working.
* Added test case to create a book with custom summary fields and fetch a contact.Tristan Van Berkom2012-11-225-0/+27
| | | | | | | | | This test case configures some summary fields and indexes and then performs some queries and asserts the results. Notably the configured summary uses multi valued fields E_CONTACT_TEL and E_CONTACT_EMAIL. Some extra vcards are added to the test data directory in order to have some mixed up emails and phone numbers to test with
* Collect all test code into a top-level "tests" directoryMatthew Barnes2011-03-223-0/+11
This includes both automated unit tests and standalone demo programs. Test code is partitioned by library. So far we have: tests/libebook tests/libecal tests/libedata-cal tests/libedataserver tests/libedataserverui This makes for a natural place to put additional E-D-S test code, but still have it compartmentalized in one place (excluding Camel, which is still tagging along with E-D-S but is not really part of E-D-S).