[gnome-db] GdaDataModelHash error.... patch attached
- From: Sumit Kumar Jain <sumitskj_20 yahoo com>
- To: gnome-db-list gnome org
- Subject: [gnome-db] GdaDataModelHash error.... patch attached
- Date: Thu, 29 Nov 2007 22:40:28 -0800 (PST)
Hi,
I think i found a bug in GdaDataModelHash. The libgda version that i am using is 3.0. The following gives error. However after patching with the attahced file, the error goes away.
---------------- code snippet ------------------
#include <stdio.h>
#include <libgda/libgda.h>
#define NOERROR 0
#define ERROR 1
int main()
{
int retVal = NOERROR;
gda_init ("TestGDA", NULL, 0, NULL);
GdaDataModelHash *hash_model = (GdaDataModelHash *)gda_data_model_hash_new(2);
if(!hash_model)
{
retVal = ERROR;
}
GValue *value = NULL;
GList *list = NULL;
g_value_set_int(value = gda_value_new(G_TYPE_INT),10);
list = g_list_append(list,value);
g_value_set_string(value = gda_value_new(G_TYPE_STRING),"test");
list = g_list_append(list,value);
gda_data_model_append_values(GDA_DATA_MODEL(hash_model),list,NULL);
g_list_foreach(list,(GFunc)gda_value_free,NULL);
g_list_free(list);
list = NULL;
g_value_set_int(value = gda_value_new(G_TYPE_INT),11);
list = g_list_append(list,value);
g_value_set_string(value = gda_value_new(G_TYPE_STRING),"test1");
list = g_list_append(list,value);
gda_data_model_append_values(GDA_DATA_MODEL(hash_model),list,NULL);
g_list_foreach(list,(GFunc)gda_value_free,NULL);
g_list_free(list);
const GValue *val1 = gda_data_model_get_value_at(GDA_DATA_MODEL(hash_model),0,0);
if(!val1)
{
retVal = ERROR;
}
int no = g_value_get_int(val1);
if(no != 10)
{
retVal = ERROR;
}
end:
g_object_unref(G_OBJECT(hash_model));
return
retVal;
}
---------------- End code snippet ------------------
Regards,
Sumit
Sumit Kumar Jain
Call me: +91-9880472974
Chat on a cool, new interface. No download required.
Click here.Attachment:
patch-gda-data-model-hash.patch
Description: Binary data
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]