Changeset 3313

Show
Ignore:
Timestamp:
05/04/08 01:33:46 (3 months ago)
Author:
dgollub
Message:

Hashtable API consumer sanity checks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/opensync/helper/opensync_hashtable.c

    r3307 r3313  
    351351                g_hash_table_insert(table->db_entries, uid, hash); 
    352352        } 
     353        osync_list_free(result); 
    353354 
    354355        osync_trace(TRACE_EXIT, "%s", __func__); 
     
    449450        const char *uid = osync_change_get_uid(change); 
    450451        const char *hash = osync_change_get_hash(change); 
     452 
     453        osync_assert_msg(uid, "Some plugin forgot to set the UID for the change. Please report this bug."); 
    451454 
    452455        switch (osync_change_get_changetype(change)) { 
     
    470473                        break; 
    471474                case OSYNC_CHANGE_TYPE_MODIFIED: 
     475                        osync_assert_msg(hash, "Some plugin forgot to set the HASH for the change for the changetype MODIFIED. Please report this bug."); 
    472476                        /* This works even if the UID/key is new to the hashtable */ 
    473477                        g_hash_table_replace(table->db_entries, g_strdup(uid), g_strdup(hash)); 
    474478                        break; 
    475479                case OSYNC_CHANGE_TYPE_ADDED: 
     480                        osync_assert_msg(hash, "Some plugin forgot to set the HASH for the change for the changetype ADDED. Please report this bug."); 
    476481                        g_hash_table_insert(table->db_entries, g_strdup(uid), g_strdup(hash)); 
    477482                        break;