[evolution-data-server/openismus-work-3-8: 35/43] test-client-cursor-operations.c: Removed bogus test for invalid sexp
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-3-8: 35/43] test-client-cursor-operations.c: Removed bogus test for invalid sexp
- Date: Sun, 1 Dec 2013 09:42:57 +0000 (UTC)
commit 1dc3d8a3e62372e4eacafe60ed092166ed8fec0b
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Sun Dec 1 15:43:45 2013 +0900
test-client-cursor-operations.c: Removed bogus test for invalid sexp
No search expression is invalid anymore.
Conflicts:
tests/libebook/client/test-client-cursor-operations.c
.../client/test-client-cursor-operations.c | 52 +++----------------
1 files changed, 9 insertions(+), 43 deletions(-)
---
diff --git a/tests/libebook/client/test-client-cursor-operations.c
b/tests/libebook/client/test-client-cursor-operations.c
index 178f973..3fd8d23 100644
--- a/tests/libebook/client/test-client-cursor-operations.c
+++ b/tests/libebook/client/test-client-cursor-operations.c
@@ -90,8 +90,7 @@ static void cursor_test_step_free (CursorTest *test)
/* Set Sexp Tests */
static void cursor_closure_set_sexp (CursorClosure *closure,
- EBookQuery *query,
- gboolean expect_success);
+ EBookQuery *query);
static void cursor_test_set_sexp (CursorFixture *fixture,
CursorClosure *closure,
CursorTest *test);
@@ -950,7 +949,6 @@ typedef struct {
CursorTestType type;
gchar *sexp;
- gboolean expect_success;
} CursorTestSetSexp;
typedef struct {
@@ -960,8 +958,7 @@ typedef struct {
static void
cursor_closure_set_sexp (CursorClosure *closure,
- EBookQuery *query,
- gboolean expect_success)
+ EBookQuery *query)
{
CursorTestSetSexp *test = g_slice_new0 (CursorTestSetSexp);
@@ -969,8 +966,6 @@ cursor_closure_set_sexp (CursorClosure *closure,
test->type = CURSOR_TEST_SET_SEXP;
test->sexp = e_book_query_to_string (query);
- test->expect_success = expect_success;
-
e_book_query_unref (query);
closure->tests = g_list_append (closure->tests, test);
@@ -981,24 +976,9 @@ cursor_test_set_sexp_assert (CursorTestSetSexp *test,
gboolean success,
GError *error)
{
- if (test->expect_success) {
- if (!success)
- g_error ("Failed to set sexp '%s': %s",
- test->sexp, error->message);
- } else {
-
- if (success)
- g_error ("Unexpected success setting sexp '%s'",
- test->sexp);
- else if (!g_error_matches (error,
- E_CLIENT_ERROR,
- E_CLIENT_ERROR_INVALID_QUERY))
- g_error ("Wrong error message when failing to set a search expression: "
- "Domain '%s' Code '%d' Message: %s",
- g_quark_to_string (error->domain),
- error->code,
- error->message);
- }
+ if (!success)
+ g_error ("Failed to set sexp '%s': %s",
+ test->sexp, error->message);
}
static void
@@ -2348,24 +2328,13 @@ main (gint argc,
* BASIC SEARCH EXPRESSION TESTS *
****************************************************/
- /* Invalid Query */
- closure = cursor_closure_new (base_params[i].async, base_params[i].dra, "POSIX");
- cursor_closure_set_sexp (closure,
- e_book_query_field_test (
- E_CONTACT_TEL,
- E_BOOK_QUERY_BEGINS_WITH,
- "1-800"),
- FALSE);
- cursor_closure_add (closure, "/EBookClientCursor/SearchExpression/Invalid%s",
base_params[i].base_path);
-
/* Valid Query */
closure = cursor_closure_new (base_params[i].async, base_params[i].dra, "POSIX");
cursor_closure_set_sexp (closure,
e_book_query_field_test (
E_CONTACT_FULL_NAME,
E_BOOK_QUERY_BEGINS_WITH,
- "Bubba"),
- TRUE);
+ "Bubba"));
cursor_closure_add (closure, "/EBookClientCursor/SearchExpression/Valid%s",
base_params[i].base_path);
/* Query Changes Position */
@@ -2382,8 +2351,7 @@ main (gint argc,
e_book_query_field_test (
E_CONTACT_EMAIL,
E_BOOK_QUERY_ENDS_WITH,
- ".com"),
- TRUE);
+ ".com"));
/* In POSIX Locale, the 10th contact out of 20 becomes the 6th contact out of
* 13 contacts bearing a '.com' email address
@@ -2406,8 +2374,7 @@ main (gint argc,
e_book_query_field_test (
E_CONTACT_EMAIL,
E_BOOK_QUERY_TRANSLIT_BEGINS_WITH,
- "几"),
- TRUE);
+ "几"));
/* In POSIX Locale, the 10th contact out of 20 becomes the 2nd out of 3 contacts
* which start with the transliterated '几' sound (which transliterates to 'ji').
@@ -2425,8 +2392,7 @@ main (gint argc,
e_book_query_field_test (
E_CONTACT_EMAIL,
E_BOOK_QUERY_TRANSLIT_BEGINS_WITH,
- "ji"),
- TRUE);
+ "ji"));
/* The '几' sound transliterates to 'ji', so we should have the same results & position.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]