Exemplo n.º 1
0
        private void validate()
        {
            FwkTest <TKey, TVal> currTest = FwkTest <TKey, TVal> .CurrentTest;

            currTest.FwkInfo("DupChecker: got {0} keys.", m_map.Count);

            currTest.FwkAssert(m_map.Count == 1000, "DupChecker: Expected 1000 keys for the region, actual is {0}.", m_map.Count);

            currTest.FwkInfo("DupChecker: got {0} ops.", m_ops);

            currTest.FwkAssert(m_ops == 1000000, "DupChecker: Expected 1,000,000 events (1000 per key) for the region, actual is {0}.",
                               m_ops);

            foreach (object item in m_map.Values)
            {
                int checkval = (int)item;
                currTest.FwkAssert(checkval == 1000, "DupChecker: Expected 1000 as final value, actual is {0}.", checkval);
            }
        }
Exemplo n.º 2
0
        private void check(EntryEvent <TKey, TVal> ev)
        {
            m_ops++;

            TKey key   = ev.Key;
            TVal value = ev.NewValue;

            FwkTest <TKey, TVal> currTest = FwkTest <TKey, TVal> .CurrentTest;

            if (m_map.ContainsKey((TKey)key))
            {
                TVal old = m_map[(TKey)key];

                currTest.FwkAssert(value.Equals(old), "DupChecker: Duplicate detected. Existing value is {0}, New value is {1}",
                                   old, value);
            }

            m_map[(TKey)key] = value;
        }