2021-01-29 06:31:58 -05:00
|
|
|
//
|
|
|
|
// FILE: unit_test_001.cpp
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// DATE: 2020-12-03
|
|
|
|
// PURPOSE: unit tests for the AM232X temperature and humidity sensor
|
|
|
|
// https://github.com/RobTillaart/
|
|
|
|
// 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)
|
|
|
|
|
2021-10-19 05:51:07 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
#include <ArduinoUnitTests.h>
|
|
|
|
|
|
|
|
#include "Arduino.h"
|
|
|
|
#include "AM232X.h"
|
|
|
|
|
|
|
|
|
|
|
|
unittest_setup()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
unittest_teardown()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-10-19 05:51:07 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
unittest(test_demo)
|
|
|
|
{
|
|
|
|
AM232X AM;
|
|
|
|
Wire.begin();
|
|
|
|
|
|
|
|
assertTrue(AM.begin());
|
|
|
|
assertTrue(AM.isConnected()); // TODO - GODMODE
|
|
|
|
|
2021-04-07 07:31:22 -04:00
|
|
|
// assertEqual(-10, AM.read());
|
2021-01-29 06:31:58 -05:00
|
|
|
}
|
|
|
|
|
2021-10-19 05:51:07 -04:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
unittest_main()
|
|
|
|
|
|
|
|
// --------
|