GHashTable用の検証ユーティリティ

GHashTable用の検証ユーティリティ — GHashTableに関する検証をもっと簡単に書くためのユーティリティ。

Functions

説明

検証を書くためには等価性を検証し、期待値と実測値を表示する必要があります。

このユーティリティはGHashTableに関する検証の作成を補助します。

Functions

gcut_hash_table_equal ()

gboolean
gcut_hash_table_equal (GHashTable *hash1,
                       GHashTable *hash2,
                       GEqualFunc equal_func);

Compares two GHashTable, hash1 and hash2 . equal_func is called for each values of the same key of hash1 and hash2 .

例:

1
TODO

Parameters

hash1

比較するGHashTable

 

hash2

比較するGHashTable

 

equal_func

ふたつの値を比較する関数。

 

Returns

TRUE if all same key's values of hash1 and hash2 are reported TRUE by equal_func , FALSE otherwise.

Since: 1.0.5


gcut_hash_table_inspect ()

gchar *
gcut_hash_table_inspect (GHashTable *hash,
                         GCutInspectFunction key_inspect_func,
                         GCutInspectFunction value_inspect_func,
                         gpointer user_data);

Inspects hash . Each key of hash is inspected by key_inspect_func and each value of hash is inspected by value_inspect_func . The returned string should be freed when no longer needed.

例:

1
TODO

Parameters

hash

詳細を示すGHashTable

 

key_inspect_func

各キーの詳細を示す関数。

 

value_inspect_func

各値の詳細を示す関数。

 

user_data

関数に渡すユーザ用データ。

 

Returns

hashの詳細を示した文字列。

Since: 1.0.5


gcut_hash_table_inspect_sorted ()

gchar *
gcut_hash_table_inspect_sorted (GHashTable *hash,
                                GCutInspectFunction key_inspect_func,
                                GCutInspectFunction value_inspect_func,
                                GCompareFunc key_compare_func,
                                gpointer user_data);

Sorts hash as key by key_compare_func and inspects it. Each key of hash is inspected by key_inspect_func and each value of hash is inspected by value_inspect_func . The returned string should be freed when no longer needed.

key_compare_funcNULLならhashを並び替えません。これはgcut_hash_table_inspect()と同じ動作です。

例:

1
TODO

Parameters

hash

並び替えて詳細を示すGHashTable

 

key_inspect_func

各キーの詳細を示す関数。

 

value_inspect_func

各値の詳細を示す関数。

 

key_compare_func

各キーを比較する関数。

 

user_data

関数に渡すユーザ用データ。

 

Returns

hashを並び替えて詳細を示した文字列。

Since: 1.0.9


gcut_hash_table_string_equal ()

gboolean
gcut_hash_table_string_equal (GHashTable *hash1,
                              GHashTable *hash2);

Compares two GHashTable, hash1 and hash2 . hash1 and hash2 should have string key and string value.

Parameters

hash1

比較するGHashTable

 

hash2

比較するGHashTable

 

Returns

hash1hash2の同じキーの値それぞれすべてが同じ内容の文字列の場合TRUE、そうでない場合はFALSE。

Since: 1.0.5


gcut_hash_table_string_string_inspect ()

gchar *
gcut_hash_table_string_string_inspect (GHashTable *hash);

Inspects hash . hash should have string key and string value. The returned string should be freed when no longer needed.

Parameters

hash

詳細を示すGHashTable

 

Returns

hashの詳細を示した文字列。

Since: 1.0.5


gcut_hash_table_string_string_copy ()

GHashTable *
gcut_hash_table_string_string_copy (GHashTable *hash);

Copy hash . hash should have string key and string value. The returned hash should be freed by g_hash_table_unref().

Parameters

hash

複製するGHashTable

 

Returns

複製されたGHashTable。必要がなくなったら開放しなければいけません。

Since: 1.0.8

Types and Values