Update battery_unittest.
This commit is contained in:
parent
6efa63b8bd
commit
21e9b0b537
|
@ -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)
|
$(OBJECT_DIR)/sensors/battery.o : $(USER_DIR)/sensors/battery.c $(USER_DIR)/sensors/battery.h $(GTEST_HEADERS)
|
||||||
@mkdir -p $(dir $@)
|
@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 \
|
$(OBJECT_DIR)/battery_unittest.o : $(TEST_DIR)/battery_unittest.cc \
|
||||||
$(USER_DIR)/sensors/battery.h $(GTEST_HEADERS)
|
$(USER_DIR)/sensors/battery.h $(GTEST_HEADERS)
|
||||||
|
|
|
@ -17,7 +17,10 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include "sensors/battery.h"
|
|
||||||
|
extern "C" {
|
||||||
|
#include "sensors/battery.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include "unittest_macros.h"
|
#include "unittest_macros.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
@ -68,6 +71,8 @@ TEST(BatteryTest, BatteryADCToVoltage)
|
||||||
|
|
||||||
// STUBS
|
// STUBS
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
uint16_t adcGetChannel(uint8_t channel)
|
uint16_t adcGetChannel(uint8_t channel)
|
||||||
{
|
{
|
||||||
UNUSED(channel);
|
UNUSED(channel);
|
||||||
|
@ -79,3 +84,4 @@ void delay(uint32_t ms)
|
||||||
UNUSED(ms);
|
UNUSED(ms);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue