projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added SILC Thread Queue API
[silc.git]
/
lib
/
silcutil
/
tests
/
test_silcstrutil.c
diff --git
a/lib/silcutil/tests/test_silcstrutil.c
b/lib/silcutil/tests/test_silcstrutil.c
index d8bef7568de38fbfb2ff1451550e018fe9b30791..a728dfd5f16c5f2606cf61357417c81e09835835 100644
(file)
--- a/
lib/silcutil/tests/test_silcstrutil.c
+++ b/
lib/silcutil/tests/test_silcstrutil.c
@@
-49,12
+49,18
@@
utf8fail(28, "\xfc\x20\xfd\x20", 4);
utf8fail(29, "\xf8\xf9\xfa\xfb", 4);
utf8fail(30, "\xf0\x20\xf9\x20\xfa\x20\xfb\x20", 8);
utf8fail(29, "\xf8\xf9\xfa\xfb", 4);
utf8fail(30, "\xf0\x20\xf9\x20\xfa\x20\xfb\x20", 8);
+char *render(void *data)
+{
+ char *buf = data;
+ return strdup(buf);
+}
+
int main(int argc, char **argv)
{
SilcBool success = FALSE;
unsigned char *s1, *s2, *s3, *s4;
unsigned char t[16];
int main(int argc, char **argv)
{
SilcBool success = FALSE;
unsigned char *s1, *s2, *s3, *s4;
unsigned char t[16];
- char h[32 + 1];
+ char h[32 + 1]
, str[40]
;
int l, opt, i;
SilcUInt32 len;
int l, opt, i;
SilcUInt32 len;
@@
-75,7
+81,7
@@
int main(int argc, char **argv)
if (optarg)
silc_log_set_debug_string(optarg);
else
if (optarg)
silc_log_set_debug_string(optarg);
else
- silc_log_set_debug_string("*strutil*");
+ silc_log_set_debug_string("*strutil*
,*errno*
");
break;
default:
exit(1);
break;
default:
exit(1);
@@
-174,6
+180,12
@@
int main(int argc, char **argv)
silc_hex2data(h, t, sizeof(t), &len);
silc_data2hex(t, sizeof(t), h, sizeof(h));
silc_hex2data(h, t, sizeof(t), &len);
silc_data2hex(t, sizeof(t), h, sizeof(h));
+ /* snprintf test */
+ silc_snprintf(str, sizeof(str), "This is %@ rendered\n",
+ render, "automatically");
+ SILC_LOG_DEBUG((str));
+ SILC_LOG_DEBUG(("This too %@ rendered", render, "is automatically"));
+
success = TRUE;
err:
success = TRUE;
err: