/* Call my_realpath with empty string in current working directory,
expecting resolved abolute path to that directory */
errcode= my_realpath(result, "", MYF(0));
ok(errcode == 0, "my_realpath returned error code: %d", errcode);
ok(!strcmp(result, resolved_cwd), "Output of my_realpath: %s, expected: %s",
result, resolved_cwd); /* Creae a symlink, chdir to it and resolve empty string */
/* Generate a unique name for the symlink */
srand(time(NULL));
snprintf(link_name, sizeof(link_name), "my_link_%d.%06d", getpid(), rand() % 1000000); if (symlink(cwd, link_name) != 0)
{
diag("symlink() failed: %s", strerror(errno));
skip(1, "symlink() failed"); goto cwd_cleanup;
} if (chdir(link_name) != 0)
{
diag("chdir() failed: %s", strerror(errno));
skip(1, "chdir() failed"); goto link_cleanup;
}
errcode= my_realpath(result, "", MYF(0));
ok(errcode == 0, "my_realpath returned error code: %d", errcode);
ok(!strcmp(result, resolved_cwd), "Output of my_realpath: %s, expected: %s",
result, resolved_cwd);
link_cleanup:
unlink(link_name);
cwd_cleanup:
free(resolved_cwd); #endif
}
int main(int argc __attribute__((unused)),char *argv[])
{
MY_INIT(argv[0]);
plan(4);
test_my_realpath();
my_end(0); return exit_status();
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.