[libgda/LIBGDA_4.2] Don't use G_MAXINT as value type in test data model



commit 5907e3820a329cae6560504647b0d9dcb49abed5
Author: Vivien Malerba <malerba gnome-db org>
Date:   Mon Jul 25 21:59:15 2011 +0200

    Don't use G_MAXINT as value type in test data model

 tests/data-model-errors.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tests/data-model-errors.c b/tests/data-model-errors.c
index 34d4d34..ea80d28 100644
--- a/tests/data-model-errors.c
+++ b/tests/data-model-errors.c
@@ -130,7 +130,7 @@ data_model_errors_init (DataModelErrors *model,
 		value = gda_row_get_value (row, 0);
 		if (arow->col0) {
 			if (*arow->col0 == '-')
-				G_VALUE_TYPE (value) = G_MAXINT;
+				G_VALUE_TYPE (value) = G_TYPE_NONE;
 			else {
 				g_value_init (value, G_TYPE_STRING);
 				g_value_set_string (value, arow->col0);
@@ -140,7 +140,7 @@ data_model_errors_init (DataModelErrors *model,
 		value = gda_row_get_value (row, 1);
 		if (arow->col1) {
 			if (*arow->col1 == '-')
-				G_VALUE_TYPE (value) = G_MAXINT;
+				G_VALUE_TYPE (value) = G_TYPE_NONE;
 			else {
 				g_value_init (value, G_TYPE_STRING);
 				g_value_set_string (value, arow->col1);
@@ -150,7 +150,7 @@ data_model_errors_init (DataModelErrors *model,
 		value = gda_row_get_value (row, 2);
 		if (arow->col2) {
 			if (*arow->col2 == '-')
-				G_VALUE_TYPE (value) = G_MAXINT;
+				G_VALUE_TYPE (value) = G_TYPE_NONE;
 			else {
 				g_value_init (value, G_TYPE_STRING);
 				g_value_set_string (value, arow->col2);
@@ -160,7 +160,7 @@ data_model_errors_init (DataModelErrors *model,
 		value = gda_row_get_value (row, 3);
 		if (arow->col3) {
 			if (*arow->col3 == '-')
-				G_VALUE_TYPE (value) = G_MAXINT;
+				G_VALUE_TYPE (value) = G_TYPE_NONE;
 			else {
 				g_value_init (value, G_TYPE_STRING);
 				g_value_set_string (value, arow->col3);
@@ -197,7 +197,7 @@ data_model_errors_dispose (GObject * object)
                 }
 
 		/* DONT: g_ptr_array_foreach (model->priv->rows, (GFunc) g_object_unref, NULL);
-		 * because we use the convention that G_VALUE_TYPE() == G_MAXINT for errors */
+		 * because we use the convention that G_VALUE_TYPE() == G_TYPE_NONE for errors */
 		g_ptr_array_free (model->priv->rows, TRUE);
 		g_free (model->priv);
 		model->priv = NULL;
@@ -344,7 +344,7 @@ data_model_errors_get_value_at (GdaDataModel *model, gint col, gint row, GError
 	drow =  g_ptr_array_index (imodel->priv->rows, row);
 	if (drow) {
 		GValue *val = gda_row_get_value (drow, col);
-		if (G_VALUE_TYPE (val) == G_MAXINT) {
+		if (G_VALUE_TYPE (val) == G_TYPE_NONE) {
 			/* simulates an error */
 			g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_ACCESS_ERROR,
 				     "%s", "Simulated error");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]