Top | ![]() |
![]() |
![]() |
![]() |
Test Utilities with GLib supportTest Utilities with GLib support — テストをもっと簡単に書くためのGLibサポート付きユーティリティ。 |
GObject * | gcut_take_object () |
GError * | gcut_take_error () |
const GList * | gcut_take_list () |
GHashTable * | gcut_take_hash_table () |
#define | gcut_take_string() |
#define | gcut_take_new_string() |
#define | gcut_take_bytes() |
GList * | gcut_list_new () |
GList * | gcut_list_int_new () |
GList * | gcut_list_uint_new () |
GList * | gcut_list_string_new () |
GList * | gcut_list_string_new_array () |
const GList * | gcut_take_new_list_int () |
const GList * | gcut_take_new_list_uint () |
const GList * | gcut_take_new_list_string () |
#define | gcut_take_new_list_string_backward_compatibility() |
const GList * | gcut_take_new_list_string_array () |
#define | gcut_take_new_list_object() |
void | gcut_list_string_free () |
void | gcut_list_object_free () |
GHashTable * | gcut_hash_table_string_string_new () |
GHashTable * | gcut_hash_table_string_string_new_va_list () |
GHashTable * | gcut_take_new_hash_table_string_string () |
#define | gcut_get_fixture_data() |
テストを書くためには、テスト環境を前処理・後処理するコードや、検証する結果を準備するコードなどたくさんのコードを書く必要があります。Cutterはもっと簡単にテストを書くためにユーティリティを提供します。
このユーティリティはGLibと一緒に使います。
GObject *
gcut_take_object (GObject *object
);
object
の所有権をCutterに渡し、object
を返します。
Since: 1.0.3
GError *
gcut_take_error (GError *error
);
Cutterにerror
の所有権を渡し、error
それ自身を返します。
Since: 1.0.3
const GList * gcut_take_list (const GList *list
,CutDestroyFunction destroy_function
);
list
の所有権をCutterに渡し、list
それ自身を返します。
Since: 1.0.3
GHashTable *
gcut_take_hash_table (GHashTable *hash_table
);
hash_table
の所有権をCutterに渡し、hash_table
それ自身を返します。
Since: 1.0.4
#define gcut_take_string(string)
string
の所有権をCutterに渡し、string
それ自身を返します。
Since: 1.1.6
#define gcut_take_bytes(bytes)
Passes ownership of bytes
to Cutter and returns bytes
itself.
Since: 1.2.8
GList * gcut_list_new (const gpointer element
,...
);
渡された要素を含むリストを作ります。
例:
1 2 3 4 5 |
GCutEgg *echo_egg, *cat_egg; echo_egg = gcut_egg_new("echo", "Hello", NULL); cat_egg = gcut_egg_new("cat", "/etc/hosts", NULL); egg_list = gcut_list_new(echo_egg, cat_egg, NULL); |
Since: 1.1.1
GList * gcut_list_int_new (guint n
,gint value
,...
);
渡された整数からリストを作ります。
例:
1 |
gcut_list_int_new(3, -10, 1, 29); -> (-10, 1, 29) |
Since: 1.1.5
GList * gcut_list_uint_new (guint n
,guint value
,...
);
渡された符号無し整数からリストを作ります。
例:
1 |
gcut_list_uint_new(3, 0, 1, 2); -> (0, 1, 2) |
Since: 1.1.5
GList * gcut_list_string_new (const gchar *value
,...
);
渡された文字列からリストを作ります。
Since: 1.0.3
GList *
gcut_list_string_new_array (const gchar **strings
);
渡された文字列配列からリストを作ります。
Since: 1.0.6
const GList * gcut_take_new_list_int (guint n
,gint value
,...
);
渡された整数からリストを作ります。作られたリストはCutterが所有権を持ちます。
例:
1 |
gcut_take_new_list_int(3, -10, 1, 29); -> (-10, 1, 29) |
Since: 1.1.5
const GList * gcut_take_new_list_uint (guint n
,guint value
,...
);
渡された符号無し整数からリストを作ります。作られたリストはCutterが所有権を持ちます。
例:
1 |
gcut_take_new_list_uint(3, 0, 1, 2); -> (0, 1, 2) |
Since: 1.1.5
const GList * gcut_take_new_list_string (const gchar *value
,...
);
渡された文字列からリストを作ります。作られたリストはCutterが所有権を持ちます。
Since: 1.0.5
#define gcut_take_new_list_string_backward_compatibility(value, ...)
gcut_take_new_list_string_backward_compatibility
は非推奨です。新しいコードでは使わないでください。
const GList *
gcut_take_new_list_string_array (const gchar **strings
);
渡された文字列の配列からリストを作ります。Cutterが所有権を持ちます。
Since: 1.0.6
#define gcut_take_new_list_object(object, ...)
渡されたオブジェクトからリストを作ります。作られたリストはCutterが所有権を持ちます。
Since: 1.1.1
GHashTable * gcut_hash_table_string_string_new (const gchar *key
,...
);
引数で指定されたキーと値のペアから、文字列のキーと値を持つハッシュテーブルを作成します。
Since: 1.0.4
GHashTable * gcut_hash_table_string_string_new_va_list (const gchar *key
,va_list args
);
引数で指定されたキーと値のペアから、文字列のキーと値を持つハッシュテーブルを作成します。
Since: 1.0.5
GHashTable * gcut_take_new_hash_table_string_string (const gchar *key
,...
);
渡されたキー・値のペアから文字列のキー・値を持つハッシュテーブルを作成します。作成されたハッシュテーブルはCutterが所有権を持つので、g_hash_table_unref()
を呼ばないでください。
Since: 1.0.5
#define gcut_get_fixture_data(...)
path
/..."にあるフィクスチャデータを読み込み、GStringとして返します。GStringはCutterが所持します。cut_build_fixture_data_path()
の説明にはフィクスチャデータのパスがどのように決定されるかが書かれています。
Since: 1.1.6