diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2013-07-30 13:18:20 +0200 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2013-07-30 13:25:14 +0200 |
commit | a76f6981248688156032769973f3043bda1d1769 (patch) | |
tree | f979e366d37fa081154f48091c58f001505f2a6e | |
parent | 1d0ebf78008379cf04f5410bf5177273f4d65db3 (diff) | |
download | libgdata-a76f6981248688156032769973f3043bda1d1769.tar.gz |
documents: Fix default value of GDataDocumentsUploadQuery:convert
Also add a test for it, because tests are good.
-rw-r--r-- | gdata/services/documents/gdata-documents-upload-query.c | 1 | ||||
-rw-r--r-- | gdata/tests/documents.c | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gdata/services/documents/gdata-documents-upload-query.c b/gdata/services/documents/gdata-documents-upload-query.c index 270d10bc..a0198389 100644 --- a/gdata/services/documents/gdata-documents-upload-query.c +++ b/gdata/services/documents/gdata-documents-upload-query.c @@ -210,6 +210,7 @@ static void gdata_documents_upload_query_init (GDataDocumentsUploadQuery *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_DOCUMENTS_UPLOAD_QUERY, GDataDocumentsUploadQueryPrivate); + self->priv->convert = TRUE; } static void diff --git a/gdata/tests/documents.c b/gdata/tests/documents.c index 56cbcf00..c22cf2db 100644 --- a/gdata/tests/documents.c +++ b/gdata/tests/documents.c @@ -1655,6 +1655,31 @@ test_query_etag (void) g_object_unref (query); } +/* Test getting and setting the GDataDocumentsUploadQuery:convert property */ +static void +test_upload_query_properties_convert (void) +{ + gboolean convert; + GDataDocumentsUploadQuery *query; + + /* Verifying the normal state of the property in a newly-constructed instance of GDataDocumentsUploadQuery */ + query = gdata_documents_upload_query_new (); + g_assert (gdata_documents_upload_query_get_convert (query) == TRUE); + + g_object_get (query, "convert", &convert, NULL); + g_assert (convert == TRUE); + + /* Setting the property. */ + gdata_documents_upload_query_set_convert (query, FALSE); + g_assert (gdata_documents_upload_query_get_convert (query) == FALSE); + + /* Setting it another way. */ + g_object_set (query, "convert", TRUE, NULL); + g_assert (gdata_documents_upload_query_get_convert (query) == TRUE); + + g_object_unref (query); +} + /* Here we hardcode the feed URI, but it should really be extracted from a document feed, as the GDATA_LINK_BATCH link */ #define BATCH_URI "https://docs.google.com/feeds/default/private/full/batch" @@ -2090,6 +2115,7 @@ main (int argc, char *argv[]) g_test_add_func ("/documents/folder/parser/normal", test_folder_parser_normal); g_test_add_func ("/documents/query/etag", test_query_etag); + g_test_add_func ("/documents/upload-query/properties/convert", test_upload_query_properties_convert); retval = g_test_run (); |