Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
我看了test的代码,实际上是不会走网络的,只是内存直接收发包,用来验证算法是否正确。
只不过mode0,1,2是需要用户按一个Enter,可以加一个开关,默认是开启这种方式,而在TravisCI中就直接运行,只打印结果,这样可以检测数据是不是在一定范围内。
譬如CI跑这个test时,只打印:
default mode result (29962ms):
avgrtt=5320 maxrtt=10278 tx=326
normal mode result (20256ms):
avgrtt=155 maxrtt=506 tx=1275
fast mode result (20202ms):
avgrtt=139 maxrtt=384 tx=1340
同时判断如果这些数值不在合理的范围内,就应该报错。
如果每次提交代码都会检测这个结果,这样会更合适。
主要改动包括:
--ci
,默认忽略这个选项,可以通过它设置ci。