unittests trivial cleanup

-add -Qunused-arguments for clang
-update to a recent cmake
-comment unused variables
This commit is contained in:
Daniel Agar 2015-08-29 20:01:07 -04:00
parent c708a6355e
commit 5391e8a24f
7 changed files with 17 additions and 12 deletions

View File

@ -13,6 +13,7 @@ cache:
addons:
apt:
sources:
- kubuntu-backports
- ubuntu-toolchain-r-test
packages:
- build-essential

View File

@ -220,7 +220,7 @@ qurtrun:
# unit tests.
.PHONY: tests
tests: generateuorbtopicheaders
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) unittests)
$(Q) (mkdir -p $(PX4_BASE)/unittests/build && cd $(PX4_BASE)/unittests/build && cmake .. && $(MAKE) --no-print-directory unittests)
.PHONY: format check_format
check_format:

View File

@ -11,6 +11,13 @@ CMAKE_FORCE_CXX_COMPILER( clang++ Clang )
#set( CMAKE_FIND_ROOT_PATH_MODE_LIBARARY_ONLY )
#set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE_ONLY )
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-Qunused-arguments)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-Qunused-arguments)
endif()
project(unittests)
enable_testing()
@ -123,8 +130,7 @@ add_executable(mixer_test mixer_test.cpp hrt.cpp
${PX_SRC}/modules/systemlib/mixer/mixer_simple.cpp
${PX_SRC}/modules/systemlib/pwm_limit/pwm_limit.c
${PX_SRC}/systemcmds/tests/test_mixer.cpp)
target_link_libraries( mixer_test LINK_PUBLIC px4_platform )
target_link_libraries( mixer_test px4_platform )
add_gtest(mixer_test)

View File

@ -33,7 +33,7 @@ TEST(SBUS2Test, SBUS2)
// Init the parser
uint8_t frame[30];
unsigned partial_frame_count = 0;
uint16_t rc_values[18];
//uint16_t rc_values[18];
//uint16_t num_values;
//bool sbus_failsafe;
//bool sbus_frame_drop;

View File

@ -41,7 +41,7 @@ TEST(ST24Test, ST24)
last_time = f;
// Pipe the data into the parser
hrt_abstime now = hrt_absolute_time();
//hrt_abstime now = hrt_absolute_time();
uint8_t rssi;
uint8_t rx_count;
@ -53,8 +53,7 @@ TEST(ST24Test, ST24)
//warnx("decoded: %u channels (converted to PPM range)", (unsigned)channel_count);
for (unsigned i = 0; i < channel_count; i++) {
int16_t val = channels[i];
//int16_t val = channels[i];
//warnx("channel %u: %d 0x%03X", i, static_cast<int>(val), static_cast<int>(val));
}
}

View File

@ -41,7 +41,7 @@ TEST(SUMDTest, SUMD)
last_time = f;
// Pipe the data into the parser
hrt_abstime now = hrt_absolute_time();
//hrt_abstime now = hrt_absolute_time();
uint8_t rssi;
uint8_t rx_count;
@ -53,8 +53,7 @@ TEST(SUMDTest, SUMD)
//warnx("decoded: %u channels (converted to PPM range)", (unsigned)channel_count);
for (unsigned i = 0; i < channel_count; i++) {
int16_t val = channels[i];
//int16_t val = channels[i];
//warnx("channel %u: %d 0x%03X", i, static_cast<int>(val), static_cast<int>(val));
}
}

View File

@ -126,8 +126,8 @@ class uORB_test::uORBCommunicatorMock : public uORBCommunicator::IChannel
private:
uORBCommunicator::IChannelRxHandler* _rx_handler;
int _sub_topicA_copy_fd;
int _sub_topicB_copy_fd;
//int _sub_topicA_copy_fd;
//int _sub_topicB_copy_fd;
std::map<std::string, std::string> _topic_translation_map;