Last change
on this file since 4dd3912 was 4dd3912, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago |
Update python scripts
|
-
Property mode
set to
100755
|
File size:
429 bytes
|
Line | |
---|
1 | #!/usr/bin/env python
|
---|
2 | #
|
---|
3 | # SPDX-FileCopyrightText: 2011 Martin Sucha
|
---|
4 | #
|
---|
5 | # SPDX-License-Identifier: BSD-3-Clause
|
---|
6 | #
|
---|
7 |
|
---|
8 | """
|
---|
9 | Generate a file to be used by app/testread
|
---|
10 | """
|
---|
11 |
|
---|
12 | import struct
|
---|
13 | import sys
|
---|
14 |
|
---|
15 | if len(sys.argv) < 2:
|
---|
16 | print("Usage: gentestfile.py <count of 64-bit numbers to output>")
|
---|
17 | exit()
|
---|
18 |
|
---|
19 | m = int(sys.argv[1])
|
---|
20 | i = 0
|
---|
21 | pow_2_64 = 2 ** 64
|
---|
22 | st = struct.Struct('<Q')
|
---|
23 | while i < m:
|
---|
24 | sys.stdout.write(st.pack(i))
|
---|
25 | i = (i + 1) % pow_2_64
|
---|
26 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.