diff options
Diffstat (limited to 'src/test.c')
| -rw-r--r-- | src/test.c | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -19,10 +19,23 @@ | |||
| 19 | * | 19 | * |
| 20 | **************************************************************************/ | 20 | **************************************************************************/ |
| 21 | 21 | ||
| 22 | #include "common.h" | ||
| 22 | #include <stdio.h> | 23 | #include <stdio.h> |
| 23 | #include <time.h> | 24 | #include <time.h> |
| 24 | 25 | ||
| 26 | static void print_bitfield(unsigned m) | ||
| 27 | { | ||
| 28 | int i; | ||
| 29 | |||
| 30 | printf("%d\n", m); | ||
| 31 | foreach_bit(i, m) | ||
| 32 | printf("%d %d\n", i, 1 << i); | ||
| 33 | } | ||
| 34 | |||
| 25 | int main(int argc, char *argv[]) | 35 | int main(int argc, char *argv[]) |
| 26 | { | 36 | { |
| 37 | print_bitfield(5); | ||
| 38 | print_bitfield(126); | ||
| 39 | print_bitfield(0); | ||
| 27 | return 0; | 40 | return 0; |
| 28 | } | 41 | } |
