Firmware Unit Tests
A unit test runs one small part of the code with chosen inputs and checks the result. The unit tests of the Teensy firmware run on your PC, without a Teensy. The tested code talks to stand-ins for the hardware and for the ROS connection, which the tests call fakes. PlatformIO, the tool that builds the firmware, also builds the tests into programs for the PC and runs them (PlatformIO's unit testing).
This page runs one test first. Then it explains which of the two test frameworks a new test uses, and how to write a test suite. CI runs every suite on every pull request (Firmware unit tests on the Testing and CI page).
Run the tests
One test
The goal of this first run is to check that a register write sends the register byte followed by the value byte. The test WireBusTest.WriteRegisterSendsRegisterAndValue checks exactly that, for the firmware's I2C bus code. Run it in the firmware container, which needs only Docker, from the root folder of your diffbot clone:
1 2 3 4 | |
The test passed when PlatformIO prints its name with [PASSED], and the last line counts one test case that succeeded:
1 2 3 | |
The first run of an environment downloads what it needs from PlatformIO's registry, so it needs the internet. For native_googletest that is GoogleTest, for native Unity and rosserial. The libraries land in diffbot_firmware/.pio/libdeps/<environment>. Later runs of the same environment work without the internet. To be able to run every suite offline, run the command for every suite below once while you are online.
The command has four parts:
.docker/firmware/run.sh: our script that runs a command in the firmware container, in the folderdiffbot_firmware.pio test -e native_googletest: PlatformIO's test command, with the environment that builds the GoogleTest suites. An environment is a section ofplatformio.inithat says what to build and how.--filter googletest/test_wire_bus: the PlatformIO test suite, a folder belowdiffbot_firmware/testwhose name starts withtest_. PlatformIO builds each of these folders into one test program.--filterselects folders, not single tests.--program-arg=--gtest_filter=…: an option that PlatformIO passes on to the test program (pio test's options). GoogleTest's option--gtest_filterruns only the tests whose full name matches (Running a Subset of the Tests).
A test's full name has two parts. GoogleTest groups the tests of a program into GoogleTest test suites, and the name before the dot is that group, here WireBusTest. The name after the dot is the test. The program of googletest/test_wire_bus has twelve tests in two GoogleTest test suites, WireBusTest and ShortReads/WireBusShortReadTest. PlatformIO counts each test as a test case.
All suites, one environment or one suite
Each of these commands runs more than one test. Run them from the same folder.
Run every suite, as CI does:
1 2 | |
Run only the Unity suites:
1 2 | |
Run only the GoogleTest suites:
1 2 | |
Run one Unity suite, here the PID controller's:
1 2 | |
Run one GoogleTest suite, here the I2C bus code's:
1 2 3 | |
PlatformIO prints each test's name with [PASSED] or [FAILED]. At the end, a summary lists each PlatformIO test suite with its status, and the last line counts the test cases: 101 for every suite.
The output of every suite: the GoogleTest suite's tests and the summary
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
With PlatformIO installed on your PC instead, in the virtual environment that Firmware Container sets up, call that environment's pio in the folder diffbot_firmware: ~/.venvs/platformio/bin/pio test -e native -e native_googletest. That route needs a C++17 compiler on the PC. It wasn't tested with the GoogleTest environment.
What a failed test looks like
To see what a failure looks like, change the tested code on purpose. readRegisters() in wire_bus.h compares two counts with the requested length: the count that requestFrom() reports, and the bytes that arrived, wire_.available().
readRegisters(), lines 31–49 of wire_bus.h
readRegisters() is lines 31–49 of wire_bus.h. Line 40 compares both counts with length, and the loop after it reads the bytes that arrived when a count is short:
| wire_bus.h: readRegisters() | |
|---|---|
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
This edit replaces both comparisons with one comparison of the two counts with each other:
1 2 3 | |
With that edit, run the wire bus suite from the root folder of your diffbot clone:
1 2 3 | |
The suite fails in one case, BothShort:
BothShort failed
readRegisters() returned true. The test expects false.
The read requested 18 bytes. requestFrom() reported 4, and 4 bytes arrived. The changed check finds 4 equal to 4.
PlatformIO marks the case with [FAILED] and names the line of the failed check, test_wire_bus.cpp:254. The other eleven tests pass. The summary counts 13 test cases: the twelve tests, and one more with the status ERRORED for the program's exit status.
PlatformIO's output of the failed run
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Add -v at the end of the same command, and PlatformIO also prints GoogleTest's own output, which says why the check failed:
GoogleTest's output for the case BothShort, with -v
1 2 3 4 5 6 7 | |
GoogleTest's output has two parts to read:
- The check that failed: its file and line, the expression, its value and the expected value.
- The test's name: the name ends with the case,
BothShort, and the case's values followwhere GetParam() =. The other three cases ran too, and passed.
After the tests of a suite with a failure, PlatformIO 6.2.0 prints Program received signal SIGHUP (Hangup) and gives the suite the status ERRORED. In this run, no signal was sent. The test program ends with the exit status 1 when a test fails, and PlatformIO reads a nonzero status as a signal's number. Signal 1 is SIGHUP. A program that really received the signal SIGHUP gets the same message. So the message doesn't tell you what went wrong: look for a failed check above it. A Unity suite with one failed test shows the same line.
Why exit status 1 reads as SIGHUP: raise_for_status() in PlatformIO 6.2.0
PlatformIO calls raise_for_status() with the test program's exit status when that status isn't 0. The function turns abs(return_code) into a signal, so the exit status 1 and a program killed by signal 1, which Python reports as -1, both become SIGHUP. The function is lines 116–128 of native.py:
| native.py: raise_for_status() | |
|---|---|
116 117 118 119 120 121 122 123 124 125 126 127 128 | |
Undo the edit before you go on.
Which framework for a new test
The firmware's suites are written with two test frameworks, Unity and GoogleTest. A test framework is the library that provides the checks and reports which tests passed. Which framework a test uses depends on the code that it tests:
- A new test of portable code: GoogleTest. The suite's folder is
test/googletest/test_<name>/, and the environmentnative_googletestruns it. Portable code is code that builds on the PC. That is the firmware's core, the logic that includes no Arduino, rosserial or other vendor library header (Ports and adapters in the firmware's README). An adapter connects the core to a library or to the hardware, and most adapters need the Arduino core. An adapter that takes its library as a template argument, asWireBusTdoes below, is portable code too. - A test of the rosserial code: Unity. Its three suites use rosserial's node handle with a fake serial port, and only the environment
nativehas the rosserial library. Their folders aretest/test_<name>/, andnativeruns them. The suites of the BNO055 driver, the command timeout, the PID controller and the wheel control are Unity suites too. A Unity suite of the core moves to GoogleTest when its code changes. - A test that has to run on the Teensy itself: Unity. PlatformIO runs Unity on microcontrollers, and GoogleTest only on the PC and ESP boards (GoogleTest in PlatformIO). The firmware has no such suite yet. Its checks on the Teensy are sketches that you run by hand, such as
test/encoders, and the commands on this page leave them out.
GoogleTest is a C++ framework. Tests that share a setup put it into a fixture, and a test that has to run with several values is written once and runs once per value. A failure names the value. GoogleTest also finds the tests by itself, while a Unity suite lists each test by hand. Unity is a small framework written in C for microcontrollers (Unity in PlatformIO). Its checks are C macros, and the firmware's Unity suites are C++ files too. ROS uses GoogleTest for its C++ tests, in ROS 1 (gtest on the ROS wiki) and in ROS 2 (Writing Basic Tests with C++ with GTest).
test/googletest holds one suite, test_wire_bus. It tests WireBusT (wire_bus.h), the adapter that carries out the BNO055 driver's I2C transfers with Arduino's Wire library (How the firmware reads it on the IMU page). WireBusT takes the Wire library's class as a template argument. On the Teensy that is Arduino's TwoWire. The suite passes its fake, FakeWire, so the adapter builds and runs on the PC too.
How PlatformIO keeps the suites apart
One environment builds its suites with one framework. So the firmware has an environment for each framework, and each suite's folder decides which environment runs it:
PlatformIO takes every folder below test whose name starts with test_ as a PlatformIO test suite, and names the suite by its path: test_pid, or googletest/test_wire_bus (Test Hierarchy). The settings test_filter and test_ignore of platformio.ini compare patterns with that path:
- The section
[env]: setstest_ignore = googletest/*. Its options hold for every environment that doesn't set them itself (Common[env]). So the two Teensy environments andnativeignore every suite belowtest/googletest. native:test_framework = unity, andtest_filterlists its Unity suites by name.native_googletest:test_framework = googletest,test_filter = googletest/*, and its owntest_ignore = test_*, which matches the Unity suites. A new GoogleTest suite needs no change of the file.
A --filter on the command line replaces the environment's test_filter, but not its test_ignore. So a call that names a suite for the wrong environment builds nothing with the wrong framework: pio test -e native --filter "googletest/*" runs no suite. PlatformIO then reports 0 test cases and no error. CI also checks the result: its unit test job fails when no test case of one of the two environments passed.
The two excerpts of platformio.ini show these settings. The first one is the shared setting, lines 14–22:
| platformio.ini: the shared setting | |
|---|---|
14 15 16 17 18 19 20 21 22 | |
The two environments for the PC, lines 49–88 of platformio.ini
The second excerpt holds the two environments for the PC, lines 49–88:
| platformio.ini: the two environments for the PC | |
|---|---|
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
platform = native: both environments build programs for the PC (PlatformIO's native platform).test_framework:unityorgoogletest. PlatformIO downloads the framework's library and reads the test program's output in that framework's format.lib_deps:nativegets the rosserial library, which three of its suites use.native_googletestgets GoogleTest in one exact version, 1.17.0, so that every PC and CI build the tests with the same GoogleTest. The environment has no rosserial library: a GoogleTest suite that includes a rosserial header doesn't build.build_flags:${env:native.build_flags}takes the value ofnative, so both environments compile as C++17 with the same warnings (interpolation of values).
Write a GoogleTest suite
A new suite starts as one file with one test. A fixture comes in when several tests share a setup, and a parameterized test when one behavior needs several inputs. The wire bus suite, test_wire_bus.cpp, shows both.
A first suite: one file, one test
This first suite checks that a CommandTimeout (command_timeout.h) starts timed out, so that the wheels don't turn before the first command. Create the folder diffbot_firmware/test/googletest/test_first_suite/, and in it the file test_first_suite.cpp with this content:
| test/googletest/test_first_suite/test_first_suite.cpp | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Run the suite from the root folder of your diffbot clone:
1 2 3 | |
The test passed when PlatformIO prints CommandTimeoutTest.IsTimedOutWhenConstructed with [PASSED], and the last line counts 1 test cases: 1 succeeded. The environment native_googletest found the new folder by itself, without a change of platformio.ini.
Then check the new file's includes, also from the root folder of your diffbot clone. The include check tools/check_includes.sh gives clang-tidy the flags that pio test compiles the suite with, and reports each name whose header the file doesn't include itself (Check the includes in the diffbot repository's AGENTS.md):
1 2 | |
The command ends with the exit status 0 also when clang-tidy prints a warning, so read its output: no misc-include-cleaner warning may name the new file. This first suite has none. It includes <gtest/gtest.h> for TEST and EXPECT_TRUE, <stdint.h> for uint32_t, and command_timeout.h for CommandTimeout.
The file has four parts:
- The includes:
<gtest/gtest.h>for GoogleTest, and the header of the tested code. PlatformIO finds the headers in the folders ofdiffbot_firmware/lib. A suite that uses a fake fromtest/fakesincludes it as"../../fakes/<file>". TEST(CommandTimeoutTest, IsTimedOutWhenConstructed): defines a test. The first argument is the GoogleTest test suite, the second the test's name. The name says the subject, the result and the condition, the project's rule for test names (AGENTS.md of the diffbot repository). GoogleTest's names have no underscores (GoogleTest's FAQ), so each word starts with a capital letter.EXPECT_TRUE(timeout.timedOut()): a check thattimedOut()returns true. A failedEXPECT_check marks the test as failed and lets the test go on, so one run shows every failed check. A failedASSERT_check returns from the function that it is in. In a test's body, that ends the test, for a check whose failure makes the rest pointless (Assertions in GoogleTest's primer).main(): PlatformIO's GoogleTest library comes without amain()function, so each suite has its own (GoogleTest in PlatformIO).InitGoogleTest()comes first: it reads GoogleTest's options from the command line, such as--gtest_filter(Writing the main() Function in the primer). ThenRUN_ALL_TESTS()runs the tests registered in the program that GoogleTest's filter selects: all of them, unless--gtest_filternames some, as in the first command on this page. A Unity suite runs a test only ifmain()names it in aRUN_TESTline.
main() returns RUN_ALL_TESTS()'s result as the program's exit status, which is 1 when anything failed. The example on PlatformIO's GoogleTest page returns 0 and leaves the result to the output that PlatformIO reads. In our check with PlatformIO 6.2.0, a failure outside a test's body, in a fixture's SetUpTestSuite(), then ended with pio test reporting success. With the exit status 1, the run fails.
This first suite tests code that a Unity suite, test_command_timeout, tests already. Delete its folder when you are done. A real suite takes the name of the code it tests: test/googletest/test_<name>/test_<name>.cpp.
Tests that share a setup: a fixture
The wire bus suite has eight tests of WireBusT that all need a fake Wire library and a WireBusT on it. A fixture is a class with the objects that every test of a group needs. The fixture WireBusTest holds a FakeWire and a WireBusT on it, lines 121–128:
| test_wire_bus.cpp: the fixture | |
|---|---|
120 121 122 123 124 125 126 127 | |
GoogleTest creates a new WireBusTest object for each test (Test Fixtures in the primer). So each test starts with an empty wire_, and the order of the tests doesn't matter.
FakeWire stands in for Arduino's Wire library. It records each call of beginTransmission(), write(), endTransmission() and requestFrom() as text, such as beginTransmission(0x28) or write(0x3D), in the list calls, in the order of the calls. available() and read() only hand out the received bytes, and calls doesn't list them. FakeWire also returns the results that a test chooses, for example end_result as the result of endTransmission(). The functions beginTransmissionCall(), writeCall(), endTransmissionCall() and requestFromCall() write a call as text. FakeWire records its calls with them, and the tests write the calls that they expect with the same functions.
FakeWire and the functions that write a call as text, lines 53–118
The functions and the fake are lines 53–118:
| test_wire_bus.cpp: FakeWire | |
|---|---|
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
TEST_F defines a test that uses a fixture. Its first argument is the fixture, its second the test's name. The four tests of writeRegister() are lines 129–165:
| test_wire_bus.cpp: the tests of writeRegister() | |
|---|---|
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
- The members:
wire_andbus_are the fixture's. The first test callsbus_.writeRegister()and then compareswire_.callswithexpected_calls: the device's address, the register, the value, and the end of the transfer with a stop. - The values: they have names, which the top of the file defines, such as
DEVICE_ADDRESS,WRITTEN_REGISTER,WRITTEN_VALUE,ADDRESS_NOT_ACKNOWLEDGEDandWITH_STOP. - A scenario in phases: the third test checks two calls on the same
bus_, in numbered phases. A write that the device acknowledges comes first, and the next write, which no device acknowledges, has to fail. Its first check is anASSERT_check, because a failed first write would leave nothing to check in phase 2. - A second set of values: the fourth test writes
RESET_VALUEtoRESET_REGISTERatALTERNATE_DEVICE_ADDRESS, 0x29, the BNO055's address when its ADR pin is high. Each of these values differs from those of the first three tests, so the test shows thatWireBusTpasses on the values that it gets.
The pictures show each of the four tests as a time line: the values that the test sets on wire_, its call of bus_, the calls that WireBusT makes on FakeWire, the result, and the checks. In the second test, and in the second write of the third test, endTransmission() returns 2, and that write fails:
WriteRegisterSendsRegisterAndValue : The device acknowledges: four calls, and the result true.WriteRegisterFailsWhenTheAddressIsNotAcknowledged : endTransmission() returns 2, so the result is false. The test checks only the result.WriteRegisterFailsWhenTheAddressIsNotAcknowledgedAfterASuccessfulWrite : Two writes on the same bus_: the first one succeeds, and the second one fails.WriteRegisterPassesOnTheAddressRegisterAndValue : The second set of values, 0x29, 0x3F and 0x20, arrives unchanged in the calls.writeRegister(), one time line per test. Time runs down. The test calls bus_ with the values of the top line. WireBusT's calls of FakeWire follow, each with a filled dot on the time line: a call that FakeWire records in calls. The result comes back at the bottom. A bold orange value is one that the test sets on wire_ before the call. A number in a blue disc is a check, and the list under the time line names it. The disc on the corner of a box marks the calls that EXPECT_EQ compares.Three of the four tests of readRegisters() compare wire_.calls the same way. The test of a sample's bytes compares the bytes in data instead. In a read, the register write ends with a repeated start, endTransmission(false), and only then comes the read request, requestFrom(). After a register write that no device acknowledges, no read request may follow. A read of CHIP_ID_REGISTER from ALTERNATE_DEVICE_ADDRESS checks that WireBusT passes on that register, and that address in both the register write and the read request.
The pictures show the four tests of readRegisters() as time lines. After requestFrom(), readRegisters() asks available() how many bytes arrived and reads them with read(), and calls lists neither. In the last test, the calls end after the register write:
ReadRegistersUsesARepeatedStart : The register write ends with a repeated start, and the read request follows.ReadRegistersPassesOnTheAddressAndRegister : The address 0x29 and the register 0x00 arrive unchanged in the calls.ReadRegistersReturnsAllBytesOfASample : All 18 bytes arrive, and data holds them in their order. The test checks the result and the bytes, not the calls.ReadRegistersFailsWithoutAReadRequestWhenTheRegisterWriteFails : No device acknowledges the register write, so no read request follows.readRegisters() with the fixture WireBusTest. The dots, values and numbers read as in the pictures of writeRegister(): time runs down, a filled dot is a call that calls lists, a bold orange value is set by the test, and a number in a blue disc is a check. An open dot is a call that calls doesn't list: available() or read(). A struck-through call on a dashed dot is one that the test expects not to happen. A row of boxes holds bytes in hex, such as 10 for 0x10.The four tests of readRegisters(), lines 167–219
The tests are lines 167–219 of test_wire_bus.cpp. The third, ReadRegistersReturnsAllBytesOfASample, is the successful read of the next section's table:
| test_wire_bus.cpp: the tests of readRegisters() | |
|---|---|
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
One behavior with several inputs: a parameterized test
A read can come back short in several ways, and readRegisters() has to fail for each of them. The BNO055 driver reads a sample's 18 data bytes in one transfer. readRegisters() asks Wire's requestFrom() for that requested length, and two counts come back:
- Reported: the count that
requestFrom()returns. - Arrived: the bytes that are really there, which
available()tells.
readRegisters() returns true only when both counts are the requested length. Otherwise it returns false, and it reads the bytes that arrived out of the Wire library, so that none of them is left for the next read. The table shows the successful read and the four short reads of the suite, each with 18 bytes requested, and what readRegisters() returns:
| Read | Reported | Arrived | Returns |
|---|---|---|---|
| A sample's data | 18 | 18 | true |
| Both short | 4 | 4 | false |
| Reported short, all bytes there | 4 | 18 | false |
| Reported one short, all bytes there | 17 | 18 | false |
| Reported in full, one byte missing | 18 | 17 | false |
After each of the five reads, no byte may be left in the Wire library. The successful read copies its 18 bytes into data, and a short read drains the bytes that arrived. The test ReadRegistersReturnsAllBytesOfASample checks that read and the 18 bytes in data. The four short reads are the cases of a parameterized test. Their names in the code join the words of the first column, such as BothShort.
The case BothShort is a read that the Teensy 4's Wire library can deliver when it can't get the bus. Its requestFrom() then returns 4, and it returns before it empties its receive buffer. So available() then counts what an earlier read left there. In BothShort, that is 4 bytes, and both counts agree with each other, but not with the 18 requested bytes. The start of requestFrom() in the Teensy 4's Wire library is lines 155–163 of WireIMXRT.cpp:
| WireIMXRT.cpp: the start of requestFrom() | |
|---|---|
155 156 157 158 159 160 161 162 163 | |
The four cases are examples of short reads, not every possible one. Two have a short reported count with all bytes there, 4 and 17 of 18. One has both counts short, and one has a byte missing behind a full count. They are four inputs to one behavior: readRegisters() fails and drains the bytes. A parameterized test is written once and runs once per case. The type ShortRead describes a case, and the fixture WireBusShortReadTest adds the case to WireBusTest, lines 221–243:
| test_wire_bus.cpp: the type of a case and the fixture | |
|---|---|
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
TEST_P defines the test, and INSTANTIATE_TEST_SUITE_P lists the cases, lines 245–274:
| test_wire_bus.cpp: the parameterized test and its cases | |
|---|---|
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
GetParam(): returns the case of the current run. The test passes the case's two counts towire_and callsreadRegisters(). Then it checks the result, that the read request asked for a sample's data,SAMPLE_LENGTH_BYTES, and thatwire_.available()is 0.::testing::Values(…): holds the four cases. Their counts come fromSAMPLE_LENGTH_BYTESandCOUNT_AFTER_FAILED_BUS_ACQUISITION.- The last argument: turns a case into the end of the test's name, such as
BothShort(names for the cases in GoogleTest's advanced guide). operator<<: writes a case as text. GoogleTest prints that text afterwhere GetParam() =when the case fails (how GoogleTest prints values).
The pictures show the four cases as time lines. Each case starts with the two counts that it sets on wire_ and ends with the three checks. readRegisters() calls available() in its comparison only when requestFrom() reports the full 18 bytes: || stops at the first comparison that is true. The loop after it reads the bytes that arrived until available() returns 0:
ReportedShortAllBytesThere : requestFrom() reports 4, and all 18 bytes arrive.BothShort : requestFrom() reports 4, and 4 bytes arrive.ReportedInFullOneByteMissing : requestFrom() reports 18, and 17 bytes arrive.ReportedOneShortAllBytesThere : requestFrom() reports 17, and all 18 bytes arrive.ReadRegistersFailsAndDrainsTheBytes. The dots, values and numbers read as in the pictures of writeRegister() and readRegisters(): time runs down, a filled dot is a call that calls lists, an open dot one that it doesn't list, a bold orange value is set by the test, and a number in a blue disc is a check. Each case requests a sample's 18 bytes. The row of boxes is the Wire library's receive buffer after requestFrom(): a box with a value is a byte that arrived, a dashed box one that didn't. The orange bracket under it spans the count that requestFrom() reports. The read() calls drop the bytes, and the line after the result is the test's own call of available().Written as a loop inside one Unity test, the cases would end at the first one that fails. Unity's message would name the line of the check, and not the case.
See each test fail once
Break the behavior that one of your checks promises, on purpose, run the suite, read the failure, and undo the change. Then you know that the check can fail. For example, EXPECT_EQ(wire_.available(), 0) promises that a short read leaves no byte behind. Without the loop that drains the bytes in readRegisters(), all four short-read cases fail at that check. A change that breaks a different behavior can pass a test that is focused on one behavior. Another test of the suite has to catch that change.
Before the pull request
Run every suite, with the first command of All suites, one environment or one suite, as CI does. Check the includes of each C++ file that you changed, as for the first suite.
Comments
Comments are GitHub Discussions, shown with giscus. Loading them connects to giscus.app (hosted by Vercel, USA) and GitHub (USA); you need a GitHub account to comment.