Ejemplo n.º 1
0
        void Request_profile_baseline(FunctionIDCollection functionIds, ThreadIDCollection threadIds, out Int32 hr)
        {
            var snapshot = NativeMethods.GetProfileWithRelease(out hr);

            Assert.GreaterOrEqual(hr, 0);
            Assert.IsNotNull(snapshot, "snapshot is null");
            Assert.Greater(snapshot.Length, 0, "snapshot.Length count is <= 0");

            foreach (var snap in snapshot)
            {
                //GetSnapshot will never return a null for the FunctionIDs
                Assert.IsNotNull(snap.FunctionIDs, "snapshot has a null list of function ids");

                Assert.AreNotEqual(snap.ThreadId, IntPtr.Zero, "ThreadId should be non-zero");
                if (snap.ThreadId != UIntPtr.Zero)
                {
                    threadIds?.Add(snap.ThreadId);
                }

                if (snap.ErrorCode < 0)
                {
                    Assert.AreEqual(snap.FunctionIDs.Length, 0, "non empty list of function ids was return with an error code.");
                }
                else
                {
                    Assert.AreNotEqual(snap.FunctionIDs.Length, 0, "empty list of function ids was return with an successful error code.");
                    functionIds?.AddRange(snap.FunctionIDs);
                }
            }
        }
Ejemplo n.º 2
0
 void Request_profile_baseline(FunctionIDCollection functionIds, ThreadIDCollection threadIds)
 {
     Request_profile_baseline(functionIds, threadIds, out Int32 _);
 }
Ejemplo n.º 3
0
 void Request_profile_baseline(ThreadIDCollection threadIds)
 {
     Request_profile_baseline(null, threadIds, out Int32 _);
 }