Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
061146b7
Commit
061146b7
authored
17 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Restored some of the output to reduce confusion...
Rev: src/modules/files/socktest.pike:1.47
parent
43e30240
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/files/socktest.pike
+18
-15
18 additions, 15 deletions
src/modules/files/socktest.pike
with
18 additions
and
15 deletions
src/modules/files/socktest.pike
+
18
−
15
View file @
061146b7
#!/usr/local/bin/pike
#!/usr/local/bin/pike
/* $Id: socktest.pike,v 1.4
6
2008/0
6/28 00:09:25 nilsson
Exp $ */
/* $Id: socktest.pike,v 1.4
7
2008/0
7/09 16:24:05 grubba
Exp $ */
// #define OOB_DEBUG
// #define OOB_DEBUG
...
@@ -232,7 +232,7 @@ void got_callback()
...
@@ -232,7 +232,7 @@ void got_callback()
#ifdef OOB_DEBUG
#ifdef OOB_DEBUG
predef::write(sprintf("%c\b","|/-\\" [ counter & 3 ]));
predef::write(sprintf("%c\b","|/-\\" [ counter & 3 ]));
#else /* !OOB_DEBUG */
#else /* !OOB_DEBUG */
if(
!
verbose && !(counter & 0xf))
if(verbose && !(counter & 0xf))
predef::write(sprintf("%c\b","|/-\\" [ (counter>>4) & 3 ]));
predef::write(sprintf("%c\b","|/-\\" [ (counter>>4) & 3 ]));
#endif /* OOB_DEBUG */
#endif /* OOB_DEBUG */
#ifdef BACKEND
#ifdef BACKEND
...
@@ -277,7 +277,7 @@ void got_oob1(mixed ignored, string got)
...
@@ -277,7 +277,7 @@ void got_oob1(mixed ignored, string got)
#endif
#endif
got_callback();
got_callback();
if (got != expected) {
if (got != expected) {
write(sprintf("loopback: Received unexpected oob data "
write(sprintf("
\n
loopback: Received unexpected oob data "
"(0x%02x != 0x%02x)\n",
"(0x%02x != 0x%02x)\n",
got[0], expected[0]));
got[0], expected[0]));
exit(1);
exit(1);
...
@@ -303,7 +303,7 @@ void got_oob0(mixed ignored, string got)
...
@@ -303,7 +303,7 @@ void got_oob0(mixed ignored, string got)
#endif
#endif
got_callback();
got_callback();
if (got != expected) {
if (got != expected) {
write(sprintf("loopback: Received unexpected oob data "
write(sprintf("
\n
loopback: Received unexpected oob data "
"(0x%02x != 0x%02x)\n",
"(0x%02x != 0x%02x)\n",
got[0], expected[0]));
got[0], expected[0]));
exit(1);
exit(1);
...
@@ -422,13 +422,14 @@ array(object) spair(int type)
...
@@ -422,13 +422,14 @@ array(object) spair(int type)
mixed keeper;
mixed keeper;
int testno = 0;
void test_write(string str)
void test_write(string str)
{
{
if( verbose )
if( verbose )
write(str);
write("\n" + str);
else
write("\r \r" + str);
// else
// else
// write("Test %d\r",
++
test
no
);
// write("Test %d\r",
_
test
s
);
}
}
void finish()
void finish()
...
@@ -437,14 +438,16 @@ void finish()
...
@@ -437,14 +438,16 @@ void finish()
num_running--;
num_running--;
if(!num_running)
if(!num_running)
{
{
if( verbose )
write("\n");
object sock1, sock2;
object sock1, sock2;
array(object) socks;
array(object) socks;
int tests;
int tests;
_tests++;
_tests++;
#ifdef IPV6
// Linux 2.6.x seems to hang when running out of IPV6 ports
// on the loopback. Give it some time to clean up its act...
sleep(!(_tests&3));
#endif
switch(_tests)
switch(_tests)
{
{
case 1:
case 1:
...
@@ -573,6 +576,7 @@ void finish()
...
@@ -573,6 +576,7 @@ void finish()
#endif /* constant(Stdio.__OOB__) */
#endif /* constant(Stdio.__OOB__) */
default:
default:
write("\n");
exit(delayed_failure);
exit(delayed_failure);
break;
break;
}
}
...
@@ -594,12 +598,11 @@ void accept_callback()
...
@@ -594,12 +598,11 @@ void accept_callback()
o->expected_data = "foobar" * 4711;
o->expected_data = "foobar" * 4711;
}
}
int main()
int main(
int argc, array(string) argv
)
{
{
string testargs=getenv()->TESTARGS;
string testargs=getenv()->TESTARGS;
if(testargs &&
argv += testargs?(testargs/" "):({});
(has_value(testargs/" ", "-v") ||
if(has_value(argv[1..], "-v") || has_value(argv[1..], "--verbose"))
has_value(testargs/" ", "--verbose") ) )
verbose=1;
verbose=1;
write("\nSocket test");
write("\nSocket test");
...
@@ -696,7 +699,7 @@ int main()
...
@@ -696,7 +699,7 @@ int main()
_tests=49;
_tests=49;
finish();
finish();
#else /* !OOB_DEBUG */
#else /* !OOB_DEBUG */
write("\nDoing simple tests. ");
test_
write("\nDoing simple tests. ");
stdtest();
stdtest();
#endif /* OOB_DEBUG */
#endif /* OOB_DEBUG */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment