Esempio n. 1
0
        public void GetSetBoolTest()
        {
            DataInInt target = new DataInInt();

             // prepare random bool array and write to target
             bool[] expected = new bool[32];
             Random r = new Random();
             for (int pass = 1; pass < 4; pass++)
             {
            for (int i = 0; i < 32; i++)
            {
               expected[i] = (r.Next(2) == 1);
               target.StoreBool(expected[i], i);
            }

            // read the values and compare with the expected
            for (int i = 0; i < 32; i++)
            {
               bool received = target.GetBool(i);
               Assert.IsTrue(received == expected[i], "Stored data do not match at index " + i + "; pass: "******"; received: " + received.ToString() + "; expected: " + expected[i]);
            }
             }
        }
Esempio n. 2
0
 private void CheckErased(DataInInt target)
 {
     for (int i = 0; i < 32; i++)
      {
     Assert.IsFalse(target.GetBool(i), "Data not erased at index: " + i);
      }
 }