GY-63_MS5611/libraries/ADT7470/test/unit_test_001.cpp

63 lines
1.1 KiB
C++
Raw Normal View History

2021-01-29 06:31:58 -05:00
//
// FILE: unit_test_001.cpp
// AUTHOR: Rob Tillaart
// DATE: 2020-12-09
// PURPOSE: unit tests for the ADT7470 Fan Monitoring library
// https://github.com/RobTillaart/ADT7470
// https://github.com/Arduino-CI/arduino_ci/blob/master/REFERENCE.md
//
// supported assertions
// ----------------------------
// assertEqual(expected, actual)
// assertNotEqual(expected, actual)
// assertLess(expected, actual)
// assertMore(expected, actual)
// assertLessOrEqual(expected, actual)
// assertMoreOrEqual(expected, actual)
// assertTrue(actual)
// assertFalse(actual)
// assertNull(actual)
#include <ArduinoUnitTests.h>
#include "ADT7470.h"
unittest_setup()
{
2023-10-15 07:45:19 -04:00
fprintf(stderr, "ADT7470_LIB_VERSION: %s\n", (char *)ADT7470_LIB_VERSION);
2021-01-29 06:31:58 -05:00
}
unittest_teardown()
{
}
2021-12-11 11:23:51 -05:00
unittest(test_constants)
{
assertEqual(1000, ADT7470_TIMEOUT);
assertEqual(0x2F, ADT7470_ADDR_HIGH);
assertEqual(0x2C, ADT7470_ADDR_LOW);
assertEqual(0x2E, ADT7470_ADDR_FLOAT);
}
2021-01-29 06:31:58 -05:00
unittest(test_constructor)
{
2023-10-15 07:45:19 -04:00
ADT7470 ADT(0x2C); // default Wire
Wire.begin();
2021-01-29 06:31:58 -05:00
ADT.begin();
assertFalse(ADT.isConnected());
}
unittest_main()
2023-10-15 07:45:19 -04:00
// -- END OF FILE --