--- l2_test.c 2001/10/05 14:25:57 1.33
+++ l2_test.c 2001/10/22 16:32:29 1.34
@@ -57,6 +57,7 @@
int main(int argc, char *argv[])
{
+ int i; /* For testing l2_stream_log() */
l2_channel_t *chFilt;
l2_channel_t *chPrefix;
l2_channel_t *chBuf;
@@ -220,17 +221,20 @@
if (l2_stream_formatter(st, 'S', l2_util_fmt_dump, NULL) != L2_OK)
die("failed to configure formatter for %%S");
- if (l2_stream_log(st, L2_LEVEL_PANIC, "0Checking localhost %s %{myparm}k <%{text}S><%{hex}S><%{base64}S>\n", "foo", 12345, "foo\1bar", 7, "foo\1bar", 7, "foo\1bar", 7) != L2_OK)
- die("failed to log message to stream");
-
- if (l2_stream_log(st, L2_LEVEL_PANIC, "1Shecking\n") != L2_OK)
- die("failed to log message to stream");
-
- if (l2_stream_log(st, L2_LEVEL_PANIC, "2Checking localhost %s %{myparm}k <%{text}S><%{hex}S><%{base64}S>\n", "foo", 12345, "foo\1bar", 7, "foo\1bar", 7, "foo\1bar", 7) != L2_OK)
- die("failed to log message to stream");
-
- if (l2_stream_log(st, L2_LEVEL_PANIC, "3Shecking\n") != L2_OK)
- die("failed to log message to stream");
+ while (1) {
+ for (i = 1; i != 0; i++);
+ if (l2_stream_log(st, L2_LEVEL_PANIC, "0Checking localhost %s %{myparm}k <%{text}S><%{hex}S><%{base64}S>\n", "foo", 12345, "foo\1bar", 7, "foo\1bar", 7, "foo\1bar", 7) != L2_OK)
+ die("failed to log message to stream");
+
+ if (l2_stream_log(st, L2_LEVEL_PANIC, "1Shecking\n") != L2_OK)
+ die("failed to log message to stream");
+
+ if (l2_stream_log(st, L2_LEVEL_PANIC, "2Checking localhost %s %{myparm}k <%{text}S><%{hex}S><%{base64}S>\n", "foo", 12345, "foo\1bar", 7, "foo\1bar", 7, "foo\1bar", 7) != L2_OK)
+ die("failed to log message to stream");
+
+ if (l2_stream_log(st, L2_LEVEL_PANIC, "3Shecking\n") != L2_OK)
+ die("failed to log message to stream");
+ }
if (l2_stream_destroy(st) != L2_OK)
die("failed to destroy stream");
|