[gimp/metadata-browser: 12/13] Added test for returning (raw) values.
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser: 12/13] Added test for returning (raw) values.
- Date: Thu, 15 Sep 2011 22:10:21 +0000 (UTC)
commit 24b8c45be38f6428dca582c2283cef11c2de513e
Author: Roman Joost <roman bromeco de>
Date: Mon Sep 12 20:02:56 2011 +1000
Added test for returning (raw) values.
plug-ins/metadata/tests/test-xmp-model.c | 40 ++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/metadata/tests/test-xmp-model.c b/plug-ins/metadata/tests/test-xmp-model.c
index 45578e2..520ea3f 100644
--- a/plug-ins/metadata/tests/test-xmp-model.c
+++ b/plug-ins/metadata/tests/test-xmp-model.c
@@ -122,6 +122,45 @@ test_xmp_model_set_get_scalar_property (GimpTestFixture *fixture,
"contributor"), ==, property_name);
}
+/**
+ * test_xmp_model_get_raw_property_value:
+ * @fixture:
+ * @data:
+ *
+ * Tests the xmp_model_get_raw_property_value, which returns raw values
+ * from the XMPModel.
+ **/
+static void
+test_xmp_model_get_raw_property_value (GimpTestFixture *fixture,
+ gconstpointer data)
+{
+ const gchar **expected;
+ const gchar **result;
+
+ // NULL is returned if no value is set by given schema and property
+ // name
+ g_assert (xmp_model_get_raw_property_value (fixture->xmpmodel,
+ "dc", "title") == NULL);
+
+ // XMP_TYPE_LANG_ALT
+ // Note: XMP_TYPE_TEXT is tested with wrapper function
+ // xmp_model_set_scalar_property
+ expected = g_new (const gchar *, 2);
+ expected[0] = g_strdup ("en_GB");
+ expected[1] = g_strdup ("my title");
+ expected[2] = NULL;
+ xmp_model_set_property (fixture->xmpmodel,
+ XMP_TYPE_LANG_ALT,
+ "dc",
+ "title",
+ expected);
+
+ result = xmp_model_get_raw_property_value (fixture->xmpmodel,
+ "dc", "title");
+ g_assert_cmpstr (result[0], ==, expected[0]);
+ g_assert_cmpstr (result[1], ==, expected[1]);
+}
+
int main(int argc, char **argv)
{
gint result = -1;
@@ -131,6 +170,7 @@ int main(int argc, char **argv)
ADD_TEST (test_xmp_model_is_empty);
ADD_TEST (test_xmp_model_set_get_scalar_property);
+ ADD_TEST (test_xmp_model_get_raw_property_value);
result = g_test_run ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]