added custom interval test

This commit is contained in:
Pawel "l0ner" Soltys 2015-01-08 20:04:27 +01:00
parent c6fc061f9d
commit 5001bc4fe7
2 changed files with 6 additions and 3 deletions

@ -67,6 +67,9 @@ if( BUILD_TESTING )
add_test( NAME no_arguments add_test( NAME no_arguments
COMMAND tmux-mem-cpu-load ) COMMAND tmux-mem-cpu-load )
add_test( NAME custom_interval
COMMAND tmux-mem-cpu-load -i 3 )
add_test( NAME colors add_test( NAME colors
COMMAND tmux-mem-cpu-load --colors ) COMMAND tmux-mem-cpu-load --colors )
@ -74,7 +77,7 @@ if( BUILD_TESTING )
COMMAND tmux-mem-cpu-load -i -1 ) COMMAND tmux-mem-cpu-load -i -1 )
add_test( NAME invalid_graph_lines add_test( NAME invalid_graph_lines
COMMAND tmux-mem-cpu-load -g -4 ) COMMAND tmux-mem-cpu-load --graph_lines -2 )
set_tests_properties( usage set_tests_properties( usage
invalid_status_interval invalid_status_interval

@ -85,7 +85,7 @@ std::string cpu_string(unsigned int cpu_usage_delay, unsigned int graph_lines,
int main(int argc, char** argv) { int main(int argc, char** argv) {
using namespace ArgvParse; using namespace ArgvParse;
unsigned cpu_usage_delay = 1000000; unsigned cpu_usage_delay = 990000;
short graph_lines = 10; // max 32767 should be enough short graph_lines = 10; // max 32767 should be enough
bool use_colors = false; bool use_colors = false;
@ -127,7 +127,7 @@ int main(int argc, char** argv) {
std::cerr << "Status interval argument must be one or greater.\n"; std::cerr << "Status interval argument must be one or greater.\n";
return EXIT_FAILURE; return EXIT_FAILURE;
} }
cpu_usage_delay = delay * 1000000; cpu_usage_delay = delay * 1000000 - 10000;
} }
if (arg.foundOption("graph-lines")) { if (arg.foundOption("graph-lines")) {