Created
July 25, 2017 20:54
-
-
Save andrewjaykeller/d2221e80477552594ec42ae15515b8f4 to your computer and use it in GitHub Desktop.
A snippet of test code from OpenBCI_Wifi test code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void testGetStringLLNumber() { | |
test.describe("getStringLLNumber"); | |
unsigned long long temp_ull = 8388607000000000; | |
String actualString = wifi.getStringLLNumber(temp_ull); | |
test.assertEqual(actualString, "8388607000000000", "should be able to convert unsigned long long", __LINE__); | |
double temp_d = 8388607000000000.5; | |
actualString = wifi.getStringLLNumber((unsigned long long)temp_d); | |
test.assertEqual(actualString, "8388607000000000", "should be able to convert a positive double", __LINE__); | |
temp_d = -8388606000000000.122; | |
actualString = wifi.getStringLLNumber((long long)temp_d); | |
test.assertEqual(actualString, "-8388606000000000", "should be able to convert a negative double", __LINE__); | |
temp_d = ADC_24BIT_MAX_VAL_NANO_VOLT; | |
actualString = wifi.getStringLLNumber((unsigned long long)temp_d); | |
test.assertEqual(actualString, "8388607000000000", "should be able to convert a positive double again", __LINE__); | |
temp_d = -1* ADC_24BIT_MAX_VAL_NANO_VOLT; | |
actualString = wifi.getStringLLNumber((long long)temp_d); | |
test.assertEqual(actualString, "-8388607000000000", "should be able to convert a negative double again", __LINE__); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment