Repository navigation
test: delete core facts already covered by siblings - #816
Conversation
Drop SD-card, version, channel, parser, and metadata facts whose assertions are already made elsewhere. Keep the DAC resolution row above 32 bits, and pass a legal range maximum so that fixture tests the minimum. Co-authored-by: Tyler Kron <tylerkron@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoRemove redundant core tests while preserving coverage
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR |
The census row passes only 0, so nothing else pins negative resolutionBits to the lower-bound guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Several
Daqifi.Core.Testsfacts re-asserted exactly what a sibling fact (or a census/guard theory) already pins, so each behavior was tested twice and every future change had to be updated in two places. This removes the duplicates; every removal below names the surviving test that still covers it, and each claim was re-checked against the currentorigin/maintests.Deletes (or trims)
Daqifi.Core.Testsfacts whose assertions are already made by a sibling. No production code. Does not touch files owned by #770, #771, #781, #790, or #805–#814, and does not reworkStreamMessageConsumerIntegrationTests.Touched classes: 416 passed / 0 failed on net9.0 and on net10.0 (Release).
SD card
ParseFileList_WithJsonLogFileName_ParsesDateParseFileList_WithLogFileName_ParsesDateasserts the exactDateTimefor the same20240115_103000stem.TryParseDateFromLogFileNamestrips the extension before parsing, so.jsonis that path.ParseFileList_WithMultipleFormats_RetainsCorrectFileNamekeeps the.jsonname and a non-nullCreatedDate.ParseFileList_WithCsvLogFileName_ParsesDate.csv.ParseFileList_WithScpiError_SkipsErrorLinesParseFileList_WithVariousScpiErrorFormats_SkipsAllalready includes**ERROR: -200, "Execution error". The mixed-with-files fact stays.ParseFileList_WithPlainErrorLine_SkipsErrorLineParseFileList_WithVariousPlainErrorFormats_SkipsAllalready includesERROR: -200, "Execution error". The mixed-with-files fact stays.ParseAsync_WithNonPositiveBufferSize_ThrowsArgumentOutOfRange(BufferSize0)SdCardParseOptionsBufferSizeGuardTests.ParseEntryPoint_WithNonPositiveBufferSize_ThrowsTheSameArgumentOutOfRangerowSdCardFileParser.ParseAsync/0, which also pins the parameter name and message.ParseAsync_WithNegativeBufferSize_ThrowsArgumentOutOfRange(BufferSize-1)SdCardFileParser.ParseAsync/-1.ReceiveAsync_EofMarkerIsStrippedFromOutputReceiveAsync_CompleteFileWithEofMarker_WritesCorrectBytesrequires the destination bytes to equal the payload, so the marker cannot be in the output. The transfer-error strip fact stays.Assert.True(p.BytesReceived >= 0)insideReceiveAsync_ProgressReporting_BytesReceivedIncreasesReceiveAsync_CompleteFileWithEofMarker_WritesCorrectBytesandReceiveAsync_MarkerOnlyTransferForListedEmptyFile_ReportsProgress(BytesReceived == 0).ScaleRawAnalogValues_Double_LeavesTheOffsetOutOfTheInternalScaleScaleRawAnalogValues_Double_ReadsEachChannelsOwnCalibrationRangeAndScaleexpects200/1000 * 20 * 3 * 2 - 0.25on the samePerChannelConfig/RawCounts. That is24 - 0.25. Scaling the intercept by the internal scale would be23.5and fail it.ParseAsync_ChannelCountInferredFromColumnHeaderParseAsync_ExtractsDeviceConfigFromCommentHeadersassertsAnalogPortCount == 3. There is no port-count comment; both files are three analog columns fromBuildCsvFileSharedTimestamp, and the parser counts those pairs.ParseAsync_IntegerAnalogValues_ParsesCorrectlyParseAsync_WithoutCalibrationConfig_ReturnsRawValuesfeeds integer JSON (22,16) through the sameGetDoublepath and asserts the raw doubles.Assert.True(p.BytesRead >= 0)insideParseAsync_ProgressReporting_CallsCallbackprogressCalls >= 2andMessagesRead == 250stay.Firmware version
CompareTo_NewerVersion_ReturnsPositive>isCompareTo > 0.CompareTo_MinorTakesPrecedence(also major, patch, and the pre-release facts) asserts>.Compare_Strings_BothValidassertsCompare("3.2.0", "3.1.0") > 0, which callsCompareTo.CompareTo_OlderVersion_ReturnsNegative<would otherwise have been unasserted, soOperators_LessThanOrEqual_GreaterThanOrEqualnow also assertsc < abesidec <= a.<isCompareTo < 0.Compare_Strings_BothValidasserts the other direction ofCompare.Guards
DeviceConnectionOptions_DefaultValues_AreCorrectDeviceConnectionOptions_Default_ReturnsDefaultOptions.Defaultisnew(), and that fact asserts the same name, null retry,InitializeDevice, andPreserveActiveStream.Constructor_NegativeChannelNumber_ThrowsChannelGuardCensusTestssiteAnalogOutputChannel..ctor(channelNumber)constructsnew AnalogOutputChannel(-1)and pins the parameter name, actual value, and message.Constructor_ImplausibleResolution_Throwsrows0and-4resolutionBits: 0is the same< MinResolutionBitsarm (is < 1 or > 32). Row33stays — that is> MaxResolutionBits, and the census does not pass it.Constructor_ImplausibleRangeEndpoint_Throwsmaximum100→10100is aboveMaxRangeMagnitudeVolts(50), so the row threw on the maximum and never showed that the minimum was checked.10is legal. NaN, infinity,60, and-60stay, as do the empty and inverted range rows.Communication, timestamp, metadata
CompositeMessageParser_ParseMessages_WithNoNullBytes_ShouldDetectAsTextCompositeMessageParser_ParseMessages_WithNullTextParser_UsesDefaultLineParserparses the sameHello World\r\nto one string and the same consumed length (a null text parser selects the default line parser).WithTextData_ShouldUseTextParseris the no-null path onnew CompositeMessageParser().WithOneNullByteInPrintableDataandReturnsDifferentMessageTypesstay.HidDevicePathParser_ParseInstanceId_EmptyInput_ReturnsNulland…_NullInput_ReturnsNullHidDevicePathParser_ParseInstanceId_NullOrEmptyInput_ReturnsNull. Both inputs still run; they share the oneIsNullOrWhiteSpacereturn.TimestampResult_PropertiesAreSetCorrectlyProcessTimestamp_FirstMessage_ReturnsIsFirstMessage(first-message flags, zero cycles, zero seconds),ProcessTimestamp_FirstMessage_TimestampIsNow,ProcessTimestamp_SecondMessage_CalculatesElapsedTimeCorrectly(IsFirstMessagefalse, cycles, seconds),ProcessTimestamp_DetectsRollover_WhenTimestampWrapsAround(WasRollovertrue).ProcessTimestamp_ZeroTimestamp_HandledCorrectlyProcessTimestamp_FirstMessage_ReturnsIsFirstMessage.ProcessTimestamp_MultipleMessages_AccumulatesTimeCorrectlyalso starts at0.ProcessTimestamp_MaxTimestamp_HandledCorrectlyuint.MaxValueas a previous timestamp, which is a different path.GetTickPeriod_FrequencySet_ReturnsReciprocalOfFrequencyReset_PreservesDeviceTimestampFrequencyandResetAll_PreservesDeviceTimestampFrequenciesassertGetTickPeriod == 1/10_000_000afterSetTimestampFrequency.SetTimestampFrequency_NonDefaultFrequency_ScalesElapsedTimeCorrectlyshows 10,000,000 cycles at 10 MHz is 1 second.UpdateFromProtobuf_UpdatesHealthTelemetryUpdateFromProtobuf_FromSerializedStatusPayload_DecodesHealthTelemetryasserts battery87, power2, device status5, and temperature after a protobuf round-trip. Positive temperature isUpdateFromProtobuf_ZeroHealthFields_LeaveLastKnownValues(30); negative isUpdateFromProtobuf_NegativeBoardTemperature_IsPreserved.Left in place
A sibling does not actually cover these, so they stay:
Constructor_ImplausibleResolution_Throwsfor33bits.±60endpoint rows (maximum corrected).WithOneNullByteInPrintableDataandReturnsDifferentMessageTypes.Not edited, because an open PR already owns the file:
Crc16Tests(test: delete redundant and vacuous unit-test facts #814 already deletesLow/High;Constructor_DifferentData_ProducesDifferentCrcandConstructor_SameData_ProducesSameCrcare still there).IntelHexParserTests,Pic32BootloaderMessageConsumerTests,Pic32BootloaderMessageProducerTests(test: delete redundant unit-test facts #812; the consumer file is also in test: delete redundant and vacuous unit-test facts #814). Both null-lines facts stay. The framing comment onAllMessages_HaveValidFramingwas not touched.TcpStreamTransportTests,MessageProducerTests,StreamMessageConsumerTests(test: delete redundant and vacuous unit-test facts #814). The sync disconnect fact is already removed on test: delete redundant and vacuous unit-test facts #814; this PR does not re-delete it.StreamMessageConsumerIntegrationTests(test: shared WaitUntil and kill leftover nothing-happened sleeps #771).Review follow-up
#385rationale comment from the deletedDeviceConnectionOptions_DefaultValues_AreCorrectnow sits on the survivingDeviceConnectionOptions_Default_ReturnsDefaultOptions, so the reasonPreserveActiveStreamdefaults to false is not lost.🤖 Generated with Claude Code