Files
readme.mdPurpose of the tests
To confirm that any of the recent modification of module Diag (diagnostic log) and its components did not introduce anomalies to module's performance
Running the tests
Copy here all necessary files from main project directory. The files to be copied are as follows:
- diag.h
- diag.cpp
- module.h
- util_comm.h
- util_comm.cpp
- util_data.h
- util_data.cpp
Copy here all necessary files from tests/common directory. The files to be copied are as follows:
- test.h
- fakestream.h
- fakestream.cpp
Open .ino file in IDE, compile, upload and open serial monitor to observe test results
Expected test results
The following is expected in serial monitor window:
---------------- TESTING STARTED ----------------
Test function started: static void TestFakeStream::beginIninputInitexpectCorrectInputInBuffer(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::readIninputReadexpectCorrectCharsRead(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::readIninputReadUnavailableexpectUnavailable(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::writeOutprintStringexpectTheSameStringInTheOutBuffer(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::beginInOutinputInitexpectCorrectInputInBuffer(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::readInOutinputReadexpectCorrectCharsRead(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::readInOutinputReadUnavailableexpectUnavailable(), file fakestream.cpp PASSED Test function started: static void TestFakeStream::writeInOutprintStringexpectTheSameStringInTheOutBuffer(), file fakestream.cpp PASSED Test function started: static void TestDiagLog::logdisablePrintOutputexpectNoCrash(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::logmessageSinglePartexpectTheSameString(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::logmessageMultiplePartsexpectConcatenatedParts(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::logmessageSeveritiesexpectCorrectSeverityTexts(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::logtwoSequentialMessagesexpectMessageNumberIncreases(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::logseverityFilterexpectNoFilteredMessages(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::setSeverityFilterseverityEmergencyAlertCriticalexpectCritical(), file testdiaglog.ino PASSED Test function started: static void TestDiagLog::setSeverityFilterseverityErrorWarningNoticeInformationalDebugexpectSameSeverity(), file testdiaglog.ino PASSED
---------------- TESTING FINISHED --------------- Test functions passed: 16 Test functions failed: 0
Failed tests
The following example illustrates failed tests reporting:
Test function started: static void test(), file test.ino
FAILED in line 1, file test.ino