-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Refactor chip::app::Testing namespace to chip::Testing
#42303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sting` namespace instead of `chip::Test`.
…est context and cluster tester instances.
…e files for consistency in test context usage.
…ip::Testing` for improved consistency and clarity in test context usage.
…nsistency in formatting.
…ip::Testing` for improved consistency and clarity in test context usage.
…hancing clarity and uniformity in test context usage across multiple test files.
…tently use `chip::Testing` namespace, enhancing clarity and uniformity in test context usage.
…ncing clarity and uniformity in test context usage across various components.
…proving clarity and uniformity in test context usage across DataModelFixtures, TestRead, and TestCodeDrivenDataModelProvider components.
…ip::Testing`, ensuring consistency and clarity in test context usage across various components.
…space chip::Testing`, ensuring consistency in test context usage across the file.
…, improving clarity in the test context.
…tency in test context usage.
…ispatchPath` functions, enhancing clarity and uniformity in test context usage across TestServerClusterShim and TestICDManager components.
… clarity in the test context usage.
…ctly, enhancing consistency in test context usage.
Co-authored-by: Elen777300 <[email protected]>
…ontext`, improving consistency in test context usage.
…::Status` directly, improving consistency in status handling within tests.
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the testing namespace hierarchy across the codebase, consolidating chip::app::Testing and chip::Test namespaces into a unified chip::Testing namespace. This simplification improves code organization and consistency across the SDK's testing infrastructure.
Key Changes:
- Moved namespace declarations from
chip::app::Testingtochip::Testingin testing utility files - Updated all
chip::Testreferences tochip::Testingfor consistency - Added explicit
app::prefixes to app-specific types in testing utilities that moved out of thechip::appnamespace
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/messaging/tests/java/MessagingContext-JNI.cpp | Updated namespace from chip::Test to chip::Testing |
| src/data-model-providers/codegen/tests/TestCodegenModelViaMocks.cpp | Replaced chip::app::Testing with chip::Testing; introduced duplicate using statement |
| src/data-model-providers/codedriven/tests/TestCodeDrivenDataModelProvider.cpp | Updated namespace and added :: prefix to disambiguate global TestProviderChangeListener class |
| src/credentials/tests/jcm/TestVendorIdVerificationClient.cpp | Migrated from chip::Test to chip::Testing; removed redundant local using statements |
| src/credentials/tests/jcm/TestTrustVerification.cpp | Updated AppContext base class reference to chip::Testing::AppContext |
| src/controller/tests/jcm/TestJCMCommissioner.cpp | Updated namespace from chip::Test to chip::Testing throughout |
| src/controller/tests/TestAutoCommissioner.cpp | Changed namespace from chip::Test to chip::Testing |
| src/controller/tests/AutoCommissionerTestAccess.h | Renamed namespace from chip::Test to chip::Testing |
| src/controller/java/AndroidCallbacks-ForTestJNI.cpp | Updated namespace from chip::Test to chip::Testing |
| src/controller/AutoCommissioner.h | Updated friend class and namespace declarations to use chip::Testing |
| src/ble/tests/TestBleLayer.cpp | Updated BleLayerTestAccess references; removed redundant chip:: prefixes within chip namespace |
| src/ble/tests/BleLayerTestAccess.h | Renamed namespace from chip::Test to chip::Testing |
| src/ble/BleLayer.h | Updated friend class and namespace declarations to use chip::Testing |
| src/app/server-cluster/tests/TestDefaultServerCluster.cpp | Replaced chip::app::Testing with chip::Testing |
| src/app/persistence/tests/TestAttributePersistence.cpp | Updated namespace from chip::app::Testing to chip::Testing |
| src/app/data-model-provider/tests/WriteTesting.h | Moved namespace from chip::app::Testing to chip::Testing; added app:: prefixes to types; exposes pre-existing missing return statement bug |
| src/app/data-model-provider/tests/TestConstants.h | Moved namespace from chip::app::Testing to chip::Testing |
| src/app/data-model-provider/tests/ReadTesting.h | Moved namespace from chip::app::Testing to chip::Testing; added app:: prefixes |
| src/app/data-model-provider/tests/ReadTesting.cpp | Updated namespace and added app:: prefixes throughout |
| src/app/clusters/zone-management-server/tests/TestZonePolygon.cpp | Updated namespace from chip::Test to chip::Testing |
| src/app/clusters/testing/MockCommandHandler.h | Moved from chip::app::Testing to chip::Testing; added app:: prefixes |
| src/app/clusters/testing/MockCommandHandler.cpp | Updated namespace and added app:: prefixes |
| src/app/clusters/testing/ClusterTester.h | Updated testing utility references from app::Testing to chip::Testing |
| src/app/clusters/network-commissioning/tests/TestNetworkCommissioningClusterEthernet.cpp | Updated using statements from chip::app::Testing to chip::Testing |
| src/app/clusters/network-commissioning/tests/TestNetworkCommissioningCluster.cpp | Updated using statements from chip::app::Testing to chip::Testing |
| src/app/clusters/groupcast/tests/TestGroupcastCluster.cpp | Updated MockCommandHandler reference to chip::Testing |
| src/app/clusters/general-diagnostics-server/tests/TestGeneralDiagnosticsCluster.cpp | Removed obsolete chip::Test namespace, kept chip::Testing |
| src/app/clusters/electrical-energy-measurement-server/tests/TestElectricalEnergyMeasurementCluster.cpp | Updated ReadOperation references from chip::app::Testing to chip::Testing |
| examples/common/server-cluster-shim/tests/TestServerClusterShim.cpp | Replaced chip::app::Testing with chip::Testing |
| docs/testing/unit_testing.md | Updated documentation to reflect new chip::Testing namespace for TestAccess classes |
|
PR #42303: Size comparison from 3ced690 to 71cb499 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the chip::app::Testing and chip::Test namespaces to a unified chip::Testing namespace across the codebase. The changes are extensive, touching documentation, test files, and core testing utilities. My review confirms that the refactoring has been applied consistently and correctly. The code is now more organized with a simplified namespace structure. I have no further comments and approve of these changes.
|
PR #42303: Size comparison from efdf99d to f4d8e99 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated no new comments.
|
PR #42303: Size comparison from f1e7db6 to e741d79 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #42303: Size comparison from 9a96230 to afa05ac Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated no new comments.
|
PR #42303: Size comparison from 9809743 to e7891c7 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
…hip#42303) * Initial commit * Refactor test context usage in various cluster tests to use `chip::Testing` namespace instead of `chip::Test`. * Refactor test cases to use `SetMockNodeConfig` directly from the `Testing` namespace * Refactor ClusterTester.h * Update test files to consistently use `chip::Testing` namespace for test context and cluster tester instances. * Update references from `chip::Test` to `chip::Testing` across multiple files for consistency in test context usage. * Refactor test files to replace all instances of `chip::Test` with `chip::Testing` for improved consistency and clarity in test context usage. * Refactor AppTestContext.h * Refactor test-interaction-model-api.h for improved readability and consistency in formatting. * Refactor MessagingContext.h to improve code readability * Refactor test files to replace all instances of `chip::Test` with `chip::Testing` for improved consistency and clarity in test context usage. * Refactor LoopbackTransport and IOContext classes for improved readability * Refactor test files to consistently use `chip::Testing` namespace, enhancing clarity and uniformity in test context usage across multiple test files. * Refactor ICDConfigurationData and related test access class to consistently use `chip::Testing` namespace, enhancing clarity and uniformity in test context usage. * Update test files to consistently use `chip::Testing` namespace, enhancing clarity and uniformity in test context usage across various components. * Refactor test files to consistently use `chip::Testing` namespace, improving clarity and uniformity in test context usage across DataModelFixtures, TestRead, and TestCodeDrivenDataModelProvider components. * Refactor test files to replace all instances of `chip::Test` with `chip::Testing`, ensuring consistency and clarity in test context usage across various components. * Refactor attribute-storage.cpp to replace `namespace Test` with `namespace chip::Testing`, ensuring consistency in test context usage across the file. * Restyled by whitespace * Restyled by clang-format * Remove unnecessary `using namespace chip::Testing;` from TestRead.cpp, improving clarity in the test context. * Update TestMessagingLayer to use `chip::Testing` namespace for consistency in test context usage. * Restyled by clang-format * Refactor test files to consistently use `DispatchCount` and `GetLastDispatchPath` functions, enhancing clarity and uniformity in test context usage across TestServerClusterShim and TestICDManager components. * Refactor test-ember-api.h to improve namespace formatting and enhance clarity in the test context usage. * Refactor TestExchange to use `Testing::LoopbackMessagingContext` directly, enhancing consistency in test context usage. * Update src/app/util/mock/attribute-storage.cpp Co-authored-by: Elen777300 <[email protected]> * Restyled by clang-format * Refactor TestPASESession to directly use `Testing::LoopbackMessagingContext`, improving consistency in test context usage. * Refactor TestCodegenModelViaMocks to use `Protocols::InteractionModel::Status` directly, improving consistency in status handling within tests. * Refactor MockNodeConfig to improve code consistency by replacing `internal::kDefaultStringSize` with `kDefaultStringSize` and streamline constructor initializations in MockClusterConfig and MockEndpointConfig. * Refactor DataModelFixtures to use `Testing::MockClusterId` and `Testing::MockAttributeId` directly, enhancing consistency in test fixture definitions. * Refactor TestAclEvent to improve namespace usage and enhance consistency by removing redundant `chip::` prefixes, streamlining access to types and functions within the app namespace. * Restyled by clang-format * Remove redundant namespace declaration in attribute-storage.cpp to improve code clarity and maintain consistency in namespace usage. * Refactor test namespaces for consistency across network commissioning and occupancy sensing clusters. Update usage of TestServerClusterContext and ClusterTester to the Testing namespace in relevant test files. * Refactor `DataModelFixtures.h ` * Restyled by clang-format * Remove unused includes in `TestResourceMonitoringCluster.cpp` * Refactor namespace usage in `Group Key Management Cluster` tests * Refactor namespace, initial commit * Refactor: Move `chip::app::Testing` to `chip::Testing` Move Testing namespace from chip::app::Testing to chip::Testing across the codebase. * Restyled by clang-format * Refactor: Remove redundant `using namespace chip::Testing;` from `TestCodegenModelViaMocks.cpp` --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Elen777300 <[email protected]> Co-authored-by: Andrei Litvin <[email protected]>
Summary
Refactored the
chip::app::Testingnamespace tochip::Testingacross the codebase to simplify the namespace hierarchy and improve code organization. Additionally, updated remainingchip::Testreferences tochip::Testingfor consistency.Note: These are minimal changes required to make the code compile successfully.
The refactoring involved:
chip::app::Testingtochip::Testingin all testing utility fileschip::app::Testingtochip::Testingthroughout the codebasechip::Testnamespace references withchip::Testingwhere foundRelated issues
#42186
Testing