Example #1
0
/* *INDENT-OFF* */
END_TEST
/* *INDENT-ON* */

/* --------------------------------------------------------------------------------------------- */

/* *INDENT-OFF* */
START_TEST (test_path_deserialize)
/* *INDENT-ON* */
{
    /* given */
    vfs_path_t *vpath;
    GError *error = NULL;

    /* when */
    vpath = vfs_path_deserialize (ETALON_SERIALIZED_PATH, &error);

    /* then */
    mctest_assert_ptr_ne (vpath, NULL);
    mctest_assert_str_eq (vfs_path_as_str (vpath), ETALON_PATH_URL_STR);

    vfs_path_free (vpath);

}
Example #2
0
/* *INDENT-OFF* */
START_PARAMETRIZED_TEST (test_path_recode, test_path_recode_ds)
/* *INDENT-ON* */
{
    /* given */
    vfs_path_t *vpath;
    const vfs_path_element_t *element;
    const char *vpath_str;

    test_init_vfs (data->input_codepage);

    /* when */
    vpath = vfs_path_from_str (data->input_path);
    element = vfs_path_get_by_index (vpath, -1);

    /* then */
    vpath_str = vfs_path_as_str (vpath);
    mctest_assert_ptr_ne (vpath, NULL);
    mctest_assert_str_eq (element->path, data->expected_element_path);
    mctest_assert_str_eq (vpath_str, data->expected_recoded_path);

    vfs_path_free (vpath);
    test_deinit_vfs ();
}