Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git test/CMakeLists.txt test/CMakeLists.txt
- index 8e4b4d1..0aff1eb 100644
- --- test/CMakeLists.txt
- +++ test/CMakeLists.txt
- @@ -9,6 +9,6 @@ include_directories(../src/common/)
- foreach(TEST_NAME cpu disk memory network process swap)
- add_executable(${TEST_NAME} test_${TEST_NAME}.c)
- add_dependencies(${TEST_NAME} sysactivity)
- - target_link_libraries(${TEST_NAME} sysactivity pthread)
- + target_link_libraries(${TEST_NAME} sysactivity pthread m)
- add_test(${TEST_NAME} ${TEST_NAME})
- endforeach(TEST_NAME)
- diff --git test/test_cpu.c test/test_cpu.c
- index 69d9ceb..c9cfaf7 100644
- --- test/test_cpu.c
- +++ test/test_cpu.c
- @@ -23,6 +23,7 @@
- #include <pthread.h>
- #include <stdlib.h>
- #include <string.h>
- +#include <math.h>
- #include "libsysactivity.h"
- @@ -60,6 +61,7 @@ void print_cpu_info(struct sa_cpu* cpu) {
- }
- void check_range(float cpu_time) {
- + cpu_time = roundf(cpu_time);
- if (cpu_time > 100.0 || cpu_time < 0.0) {
- printf("%s:%d ERROR: cpu time out of range: %f\n", __FILE__, __LINE__, cpu_time);
- error = 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement