Top | ![]() |
![]() |
![]() |
![]() |
void * | cut_take () |
const void * | cut_take_memory () |
const char * | cut_take_string () |
const char * | cut_take_strdup () |
const char * | cut_take_strndup () |
const void * | cut_take_memdup () |
const char * | cut_take_printf () |
char ** | cut_take_string_array () |
const char * | cut_take_diff () |
const char * | cut_take_replace () |
#define | cut_take_convert() |
const char * | cut_take_inspect_string () |
void | cut_set_fixture_data_dir () |
char * | cut_build_fixture_data_path () |
const char * | cut_build_fixture_path () |
const char * | cut_get_fixture_data_string () |
const char * | cut_get_fixture_data () |
void | cut_remove_path () |
const char * | cut_build_path () |
const char * | cut_build_path_array () |
void | cut_make_directory () |
テストを書くためには、テスト環境を前処理・後処理するコードや、検証する結果を準備するコードなどたくさんのコードを書く必要があります。Cutterはもっと簡単にテストを書くためにユーティリティを提供します。
このユーティリティはGLibサポート無しでも使えます。
void * cut_take (void *object
,CutDestroyFunction destroy_function
);
Passes ownership of object
to Cutter and returns object
itself. object
is destroyed by destroy_func
.
Since: 1.0.5
const void *
cut_take_memory (void *memory
);
memory
の所有権をCutterに渡し、memory
自身を返します。memory
はfree()
で破棄されます。
Since: 1.0.5
const char *
cut_take_string (char *string
);
string
の所有権をCutterに渡し、string
それ自身を返します。
const char *
cut_take_strdup (const char *string
);
Duplicates string
, passes ownership of the duplicated
string to Cutter and returns the duplicated string.
Since: 1.0.5
const char * cut_take_strndup (const char *string
,size_t size
);
Duplicates the first size
bytes of string
, passes
ownership of the duplicated string to Cutter and returns
the duplicated string. The duplicated string is always
NULL
-terminated.
Since: 1.0.5
const void * cut_take_memdup (const void *memory
,size_t size
);
Duplicates size
bytes of memory
, passes ownership of
the duplicated memory to Cutter and returns the
duplicated memory.
Since: 1.0.5
const char * cut_take_printf (const char *format
,...
);
printf()
のように文字列を整形しますが、整形された文字列はCutterが所有します。
char **
cut_take_string_array (char **strings
);
配列の所有権をCutterに渡し、strings
それ自身を返します。
const char * cut_take_diff (const char *from
,const char *to
);
from
とto
のdiffを計算します。diffの所有者はCutterです。
const char * cut_take_replace (const char *target
,const char *pattern
,const char *replacement
);
target
文字列中で、pattern
にマッチする部分をreplacement
で置き換えます。
Since: 1.0.6
#define cut_take_convert(string, to_code_set, from_code_set)
Converts string
code set to to_code_set
from
from_code_set
.
string |
変換対象の文字列。 |
|
to_code_set |
the code set name which to convert |
|
from_code_set |
the code set name of |
Since: 1.1.3
const char *
cut_take_inspect_string (const char *string
);
Inspects string
.
Since: 1.1.4
void cut_set_fixture_data_dir (const char *path
,...
);
cut_get_fixture_data_string()
などで使われるフィクスチャデータのディレクトリを指定します。
Since: 1.0.2
char * cut_build_fixture_data_path (const char *path
,...
);
cut_build_fixture_data_path
has been deprecated since version 1.1.6 and should not be used in newly-written code.
Use cut_build_fixture_path()
instead.
フィクスチャデータへのパスを生成します。もし、path
が相対パスなら、パスはcut_set_fixture_data_dir()
で指定したディレクトリか、現在のディレクトリからの相対パスとして処理されます。
Since: 1.0.2
const char * cut_build_fixture_path (const char *path
,...
);
フィクスチャデータへのパスを生成します。もし、path
が相対パスなら、パスはcut_set_fixture_data_dir()
で指定したディレクトリか、現在のディレクトリからの相対パスとして処理されます。
Since: 1.1.6
const char * cut_get_fixture_data_string (const char *path
,...
);
Reads the fixture data at "path
/..." and returns it as a
string that is owned by Cutter. The description of
cut_build_fixture_path()
shows how the fixture data path
is determined.
Since: 1.0.2
const char * cut_get_fixture_data (size_t *size
,const char *path
,...
);
Reads the fixture data at "path
/..." and returns it as a
string that is owned by Cutter. The description of
cut_build_fixture_path()
shows how the fixture data path
is determined.
Since: 1.1.6
void cut_remove_path (const char *path
,...
);
path
と、その下にあるパスを再帰的に削除します。いかなるエラーも報告しません。
Since: 1.0.2
const char * cut_build_path (const char *path
,...
);
path
と続く要素を使ってパスを作ります。
Since: 1.0.7
const char *
cut_build_path_array (const char **paths
);
Builds path from paths
.
Since: 1.1.5