Search Unity

Native containers and unit testing

Discussion in 'Entity Component System' started by snacktime, May 8, 2018.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Testing with native containers is kind of a pain right now. Are there any hooks available to get access to the tracking information that unity does on them? So we could ensure they get disposed in teardown?
     
  2. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    Not exactly a help, but maybe there will be a talk at Unite Berlin about automated testing and ECS & Jobsystem by @superpig. I'd like to see some more info about it too.
     
    Last edited: May 8, 2018
    FROS7 likes this.
  3. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Not yet. What you could try to do, is force a GC collection, and then check the error log, where we report leaks. Given the nature of the way we track memory leaks on native data structures, triggering a GC collection will make sure finalizers on
    DisposeSentinel
    s get invoked, and thus leaks should be reported.

    You can check our unit tests in the package source, there should be some examples that might be useful as a guide.