| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Let's have it as it's common to be, which means top level src/ for
sources, single data/ for data, and so on.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[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).
|
| |
|
|
| |
... for email and X509 certificates.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
Avoid naming conflicts when installing tests into ${pkglibexecdir}/installed-tests
|
| |
|
|
|
|
| |
Found by scan-build.
https://bugzilla.gnome.org/719533
|
| |
|
|
|
| |
Also, load the vcards from ${pkglibexecdir}/installed-tests/vcards
in the case that TEST_INSTALLED_SERVICES is specified
|
| |
|
|
|
| |
This commit adds the usage of EDS_INSTALLED_TESTS and a few lines
to all the test directories which can run installed.
|
| |
|
|
| |
No search expression is invalid anymore.
|
| |
|
|
|
|
| |
special case
x-evolution-any-field with a NULL value (or byte) means 'get all contacts'.
|
| |
|
|
| |
There is no such thing anymore as an invalid query for the cursor.
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
- Remove trailing tabs.
- Add terminators to multi-line lists.
|
| |
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=712244
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
The new tests check some specific phone number matching cases
with E_BOOK_QUERY_EQUALS_NATIONAL_NUMBER queries.
|
| | |
|
| |
|
|
| |
g_type_init() is deprecated in GLib 2.36.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
Replaces e_book_client_view_get_client().
|
| |
|
|
| |
This was causing make distcheck to break.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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).
|
| |
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
Make sure EBookClientView signals are emitted on the expected thread.
|