Added tests for switching off mux and byte-based throttling, #2025. Also

fixed frailty in arg-parsing for byte-based throttling.
This commit is contained in:
Brian Gerkey 2010-04-08 18:16:29 +00:00
parent 167ac4466c
commit bc9bdd5707
3 changed files with 22 additions and 3 deletions

View File

@ -37,7 +37,6 @@ rosbuild_add_rostest(test/relay.test)
rosbuild_add_rostest(test/mux.test)
rosbuild_add_rostest(test/switch_mux.test)
rosbuild_add_rostest(test/switch_mux_leading_slash.test)
# Can't run this one yet, because hztest won't check for 0Hz output, # 2024
#rosbuild_add_rostest(test/switch_mux_none.test)
rosbuild_add_rostest(test/switch_mux_none.test)
rosbuild_add_pyunit(test/args.py)

View File

@ -154,6 +154,11 @@ int main(int argc, char **argv)
}
else
{
if(argc < 5)
{
puts(USAGE);
return 1;
}
g_bps = atoi(argv[3]);
g_window = atof(argv[4]);
}

View File

@ -22,5 +22,20 @@
<param name="test_duration" value="2.0" />
</test>
<!-- TODO: test byte-based throttling -->
<!-- Test byte-based throttling. Note that the desired rate for the
hztest is a function of both the requested bytes/second and the length of
the string being published:
10 msg/sec = 110 B/sec / 11 B/msg
(11 = 4-byte length + 7 characters in "chatter")
It would be more direct to test the bandwidth directly, but hztest
doesn't do that. -->
<node pkg="topic_tools" type="throttle" name="throttle_bytes"
args="bytes input 110 1 output_bytes"/>
<test test-name="throttle_hztest_bytes" pkg="rostest" type="hztest">
<param name="topic" value="output_bytes"/>
<param name="hz" value="10.0"/>
<param name="hzerror" value="1.0"/>
<param name="test_duration" value="4.0" />
</test>
</launch>