Update battery_unittest.

This commit is contained in:
Dominic Clifton 2014-11-01 11:06:24 +00:00
parent 6efa63b8bd
commit 21e9b0b537
2 changed files with 8 additions and 2 deletions

View File

@ -93,7 +93,7 @@ TEST_CFLAGS = $(addprefix -I,$(TEST_INCLUDE_DIRS))
$(OBJECT_DIR)/sensors/battery.o : $(USER_DIR)/sensors/battery.c $(USER_DIR)/sensors/battery.h $(GTEST_HEADERS)
@mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/sensors/battery.c -o $@
$(CC) $(CPPFLAGS) $(CXXFLAGS) $(TEST_CFLAGS) -c $(USER_DIR)/sensors/battery.c -o $@
$(OBJECT_DIR)/battery_unittest.o : $(TEST_DIR)/battery_unittest.cc \
$(USER_DIR)/sensors/battery.h $(GTEST_HEADERS)

View File

@ -17,7 +17,10 @@
#include <stdint.h>
#include <limits.h>
#include "sensors/battery.h"
extern "C" {
#include "sensors/battery.h"
}
#include "unittest_macros.h"
#include "gtest/gtest.h"
@ -68,6 +71,8 @@ TEST(BatteryTest, BatteryADCToVoltage)
// STUBS
extern "C" {
uint16_t adcGetChannel(uint8_t channel)
{
UNUSED(channel);
@ -79,3 +84,4 @@ void delay(uint32_t ms)
UNUSED(ms);
return;
}
}