void TestAll()
 {
     foreach (KeyValuePair <string, ICommand> item in tests)
     {
         MemoryTracker.Start();
         string[] args = new string[1];
         args[0] = item.Key;
         item.Value.Execute(args);
         MemoryTracker.Finish();
     }
 }
Example #2
0
        public virtual void Teardown()
        {
            //var errors = CryptoUtil.GetErrors();
            //foreach (var err in errors)
            //{
            //	Console.WriteLine("ERROR: {0}", err);
            //}

            CollectionAssert.IsEmpty(MemoryTracker.Finish());
//			CollectionAssert.IsEmpty(errors);
        }
        void Run(string[] args)
        {
            if (args.Length == 0)
            {
                Usage();
                return;
            }

            if (args[0] == "all")
            {
                TestAll();
                return;
            }

            ICommand cmd;

            if (!this.tests.TryGetValue(args[0], out cmd))
            {
                Usage();
                return;
            }

            // Check to see if "fips" is an argument, if so, set FIPS mode
            // here (before any other calls to the crypto lib)
            foreach (string arg in args)
            {
                if (arg.ToLower() == "fips")
                {
                    Console.WriteLine("Executing test in FIPS mode.");
                    FIPS.Enabled = true;
                    break;
                }
            }

            MemoryTracker.Start();
            cmd.Execute(args);
            MemoryTracker.Finish();
        }
Example #4
0
 public virtual void Teardown()
 {
     MemoryTracker.Finish();
     Assert.AreEqual(0, MemoryTracker.Leaked);
 }