Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F629772
testbits.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
testbits.c
View Options
/* ----------------------------------------------------------------<Prolog>-
Name: testbits.c
Title: Test program for bitstring functions
Package: Standard Function Library (SFL)
Written: 1996/05/14 iMatix SFL project team <sfl@imatix.com>
Revised: 1997/09/08
Synopsis: Runs various tests on bit manipulation functions.
Copyright: Copyright (c) 1996-2000 iMatix Corporation
License: This is free software; you can redistribute it and/or modify
it under the terms of the SFL License Agreement as provided
in the file LICENSE.TXT. This software is distributed in
the hope that it will be useful, but without any warranty.
------------------------------------------------------------------</Prolog>-*/
#include
"sfl.h"
int
main
(
int
argc
,
char
*
argv
[])
{
BITS
*
bits
;
FILE
*
bitfile
;
/* Where we store the bits */
long
count
,
bit_no
;
if
(
argc
<
2
)
count
=
1
;
else
count
=
atol
(
argv
[
1
]);
bits_init
();
bits
=
bits_create
();
while
(
count
--
)
{
bit_no
=
(
long
)
random
(
4000
)
*
(
long
)
random
(
4000
);
bits_set
(
bits
,
bit_no
);
if
((
count
%
100
)
==
0
)
{
printf
(
"."
);
fflush
(
stdout
);
/* Show output now! */
}
}
bitfile
=
fopen
(
"testbits.out"
,
"w"
);
bits_fput
(
bitfile
,
bits
);
fclose
(
bitfile
);
bits_destroy
(
bits
);
bits_term
();
mem_assert
();
return
(
EXIT_SUCCESS
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 7:44 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
123871
Default Alt Text
testbits.c (1 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline