Skip to content

Split the platform layer to allow better unit testing of the core layer #5587

@guhetier

Description

@guhetier

The platform layer currently contains:

  • basic, essential helpers like CxPlatAlloc
  • higher level abstraction like datapaths, storage

This is problematic when writing unit tests for the core layer since higher level abstraction (especially I/O related one) should be mocked for a unit test, but basic helpers are still needed.

By splitting essential helpers in a different lib from more specific ones, unit tests will be able to link only what they need.

The issue described below was found when trying to write unit tests for QuicLibraryLookupBinding, where calls to QuicBindingGetLocalAddress -> CxPlatSocketGetLocalAddress call in the datapath layer and need to be mocked.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions