Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: tools/battor_agent/battor_sample_converter_unittest.cc

Issue 1634933005: tools/battor_agent: Fix unit test compile warnings on other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/battor_agent/battor_agent_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_sample_converter_unittest.cc
diff --git a/tools/battor_agent/battor_sample_converter_unittest.cc b/tools/battor_agent/battor_sample_converter_unittest.cc
index a20f878701f4d45938d982c950240a0b8b366bcc..f0b9935982c3cfe5508980177eb4f85674548ac6 100644
--- a/tools/battor_agent/battor_sample_converter_unittest.cc
+++ b/tools/battor_agent/battor_sample_converter_unittest.cc
@@ -15,12 +15,12 @@ namespace battor {
TEST(BattOrSampleConverterTest, ToSampleSimple) {
BattOrEEPROM eeprom;
- eeprom.r1 = 1;
- eeprom.r2 = 1;
- eeprom.r3 = 1;
- eeprom.low_gain = 1;
- eeprom.low_gain_correction_offset = 0;
- eeprom.low_gain_correction_factor = 1;
+ eeprom.r1 = 1.0f;
+ eeprom.r2 = 1.0f;
+ eeprom.r3 = 1.0f;
+ eeprom.low_gain = 1.0f;
+ eeprom.low_gain_correction_offset = 0.0f;
+ eeprom.low_gain_correction_factor = 1.0f;
eeprom.sd_sample_rate = 1000;
// Create a calibration frame with a baseline voltage and current of zero.
@@ -39,12 +39,12 @@ TEST(BattOrSampleConverterTest, ToSampleSimple) {
TEST(BattOrSampleConverterTest, ToSampleNonZeroBaseline) {
BattOrEEPROM eeprom;
- eeprom.r1 = 1;
- eeprom.r2 = 1;
- eeprom.r3 = 1;
- eeprom.low_gain = 1;
- eeprom.low_gain_correction_offset = 0;
- eeprom.low_gain_correction_factor = 1;
+ eeprom.r1 = 1.0f;
+ eeprom.r2 = 1.0f;
+ eeprom.r3 = 1.0f;
+ eeprom.low_gain = 1.0f;
+ eeprom.low_gain_correction_offset = 0.0f;
+ eeprom.low_gain_correction_factor = 1.0f;
eeprom.sd_sample_rate = 1000;
// Create a calibration frame with a baseline voltage and current of zero.
@@ -63,12 +63,12 @@ TEST(BattOrSampleConverterTest, ToSampleNonZeroBaseline) {
TEST(BattOrSampleConverterTest, ToSampleNonZeroMultiSampleBaseline) {
BattOrEEPROM eeprom;
- eeprom.r1 = 1;
- eeprom.r2 = 1;
- eeprom.r3 = 1;
- eeprom.low_gain = 1;
- eeprom.low_gain_correction_offset = 0;
- eeprom.low_gain_correction_factor = 1;
+ eeprom.r1 = 1.0f;
+ eeprom.r2 = 1.0f;
+ eeprom.r3 = 1.0f;
+ eeprom.low_gain = 1.0f;
+ eeprom.low_gain_correction_offset = 0.0f;
+ eeprom.low_gain_correction_factor = 1.0f;
eeprom.sd_sample_rate = 1000;
// Create a calibration frame with a baseline voltage and current of zero.
@@ -88,12 +88,12 @@ TEST(BattOrSampleConverterTest, ToSampleNonZeroMultiSampleBaseline) {
TEST(BattOrSampleConverterTest, ToSampleRealValues) {
BattOrEEPROM eeprom;
- eeprom.r1 = 10;
- eeprom.r2 = 14;
- eeprom.r3 = 17;
+ eeprom.r1 = 10.0f;
+ eeprom.r2 = 14.0f;
+ eeprom.r3 = 17.0f;
eeprom.low_gain = 1.5;
- eeprom.low_gain_correction_offset = 0.03;
- eeprom.low_gain_correction_factor = 4;
+ eeprom.low_gain_correction_offset = 0.03f;
+ eeprom.low_gain_correction_factor = 4.0f;
eeprom.sd_sample_rate = 1000;
// Create a calibration frame with a baseline voltage and current of zero.
@@ -113,12 +113,12 @@ TEST(BattOrSampleConverterTest, ToSampleRealValues) {
TEST(BattOrSampleConverterTest, ToSampleRealNegativeValues) {
BattOrEEPROM eeprom;
- eeprom.r1 = 10;
- eeprom.r2 = 14;
- eeprom.r3 = 17;
+ eeprom.r1 = 10.0f;
+ eeprom.r2 = 14.0f;
+ eeprom.r3 = 17.0f;
eeprom.low_gain = 1.5;
- eeprom.low_gain_correction_offset = 0.03;
- eeprom.low_gain_correction_factor = 4;
+ eeprom.low_gain_correction_offset = 0.03f;
+ eeprom.low_gain_correction_factor = 4.0f;
eeprom.sd_sample_rate = 1000;
// Create a calibration frame with a baseline voltage and current of zero.
@@ -137,12 +137,12 @@ TEST(BattOrSampleConverterTest, ToSampleRealNegativeValues) {
TEST(BattOrSampleConverterTest, ToSampleMultipleSamples) {
BattOrEEPROM eeprom;
- eeprom.r1 = 1;
- eeprom.r2 = 1;
- eeprom.r3 = 1;
- eeprom.low_gain = 1;
- eeprom.low_gain_correction_offset = 0;
- eeprom.low_gain_correction_factor = 1;
+ eeprom.r1 = 1.0f;
+ eeprom.r2 = 1.0f;
+ eeprom.r3 = 1.0f;
+ eeprom.low_gain = 1.0f;
+ eeprom.low_gain_correction_offset = 0.0f;
+ eeprom.low_gain_correction_factor = 1.0f;
eeprom.sd_sample_rate = 50;
std::vector<RawBattOrSample> calibration_frame;
« no previous file with comments | « tools/battor_agent/battor_agent_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698