more complicated unit test for PerThreadMemAlloc