003 File Manager
Current Path:
/usr/src/contrib/libevent/test
usr
/
src
/
contrib
/
libevent
/
test
/
📁
..
📄
Makefile.nmake
(2.47 KB)
📄
bench.c
(4.9 KB)
📄
bench_cascade.c
(4.56 KB)
📄
bench_http.c
(4.9 KB)
📄
bench_httpclient.c
(5.87 KB)
📄
check-dumpevents.py
(1.52 KB)
📄
include.am
(4.77 KB)
📄
regress.c
(82.29 KB)
📄
regress.gen.c
(27.05 KB)
📄
regress.gen.h
(6.58 KB)
📄
regress.h
(4.95 KB)
📄
regress.rpc
(465 B)
📄
regress_buffer.c
(71.76 KB)
📄
regress_bufferevent.c
(38.97 KB)
📄
regress_dns.c
(61.06 KB)
📄
regress_et.c
(5.9 KB)
📄
regress_finalize.c
(8.64 KB)
📄
regress_http.c
(124.15 KB)
📄
regress_iocp.c
(8.78 KB)
📄
regress_listener.c
(7.16 KB)
📄
regress_main.c
(11.54 KB)
📄
regress_minheap.c
(2.92 KB)
📄
regress_rpc.c
(19.58 KB)
📄
regress_ssl.c
(23.56 KB)
📄
regress_testutils.c
(6.37 KB)
📄
regress_testutils.h
(2.54 KB)
📄
regress_thread.c
(14.65 KB)
📄
regress_thread.h
(2.09 KB)
📄
regress_util.c
(37.67 KB)
📄
regress_zlib.c
(8.59 KB)
📄
rpcgen_wrapper.sh
(1.45 KB)
📄
test-changelist.c
(5.77 KB)
📄
test-closed.c
(3.24 KB)
📄
test-dumpevents.c
(5.56 KB)
📄
test-eof.c
(3.03 KB)
📄
test-fdleak.c
(6.81 KB)
📄
test-init.c
(2.1 KB)
📄
test-ratelim.c
(16.74 KB)
📄
test-time.c
(2.99 KB)
📄
test-weof.c
(3 KB)
📄
test.sh
(3.7 KB)
📄
tinytest.c
(12.24 KB)
📄
tinytest.h
(4.22 KB)
📄
tinytest_local.h
(170 B)
📄
tinytest_macros.h
(7.29 KB)
Editing: check-dumpevents.py
#!/usr/bin/python2 # # Post-process the output of test-dumpevents and check it for correctness. # import math import re import sys text = sys.stdin.readlines() try: expect_inserted_pos = text.index("Inserted:\n") expect_active_pos = text.index("Active:\n") got_inserted_pos = text.index("Inserted events:\n") got_active_pos = text.index("Active events:\n") except ValueError: print >>sys.stderr, "Missing expected dividing line in dumpevents output" sys.exit(1) if not (expect_inserted_pos < expect_active_pos < got_inserted_pos < got_active_pos): print >>sys.stderr, "Sections out of order in dumpevents output" sys.exit(1) now,T= text[1].split() T = float(T) want_inserted = set(text[expect_inserted_pos+1:expect_active_pos]) want_active = set(text[expect_active_pos+1:got_inserted_pos-1]) got_inserted = set(text[got_inserted_pos+1:got_active_pos]) got_active = set(text[got_active_pos+1:]) pat = re.compile(r'Timeout=([0-9\.]+)') def replace_time(m): t = float(m.group(1)) if .9 < abs(t-T) < 1.1: return "Timeout=T+1" elif 2.4 < abs(t-T) < 2.6: return "Timeout=T+2.5" else: return m.group(0) cleaned_inserted = set( pat.sub(replace_time, s) for s in got_inserted if "Internal" not in s) if cleaned_inserted != want_inserted: print >>sys.stderr, "Inserted event lists were not as expected!" sys.exit(1) if set(got_active) != set(want_active): print >>sys.stderr, "Active event lists were not as expected!" sys.exit(1)
Upload File
Create Folder