public void TestLength32()
        {
            Vlc vlc = new Vlc(0xFF3FFFFF, 32);

            Assert.AreEqual(0xFF3FFFFFU, vlc.Code, "Code for 32 bits VLC");
            Assert.AreEqual(32, vlc.Length, "Length for 32 bits VLC");
            Assert.AreEqual("11111111001111111111111111111111", vlc.ToString(), "ToString() for 32 bits VLC");
            Assert.AreEqual(0xFF3FFFFFU, (uint)vlc.GetHashCode(), "GetHasCode() for 32 bits VLC");
        }
Beispiel #2
0
        public void TestGetVlc()
        {
            Assert.AreEqual(new Vlc(0x02, 4), _mockTable.GetVlc(0x040), "GetVlc()");

            // Brute-force test
            int numBits = _mockTable.MaxBits;
            for (uint code = 0U; code < (1U << numBits); code++)
            {
                string bitstring = (new Vlc(code, numBits)).ToString();
                Vlc vlc = _mockTable.GetVlc(code);

                if (vlc != null)
                {
                    Assert.IsTrue(bitstring.StartsWith(vlc.ToString()), "GetVlc(), valid code");
                }
                else
                {
                    for (int i = 0; i < MockVlcData.GetLength(0); i++)
                    {
                        Assert.IsFalse(bitstring.StartsWith(MockVlcData[i, 0] as string), "GetVlc(), invalid code");
                    }
                }
            }
        }
 public void TestToString()
 {
     Assert.AreEqual(BitString, _vlc.ToString(), "ToString()");
 }
 void MediaPlayer_EncounteredError(object sender, Vlc.DotNet.Core.VlcMediaPlayerEncounteredErrorEventArgs e)
 {
     PlayerError(sender, new PlayerErrorEventArgs(e.ToString(), "Error Occurred in VLC Media Player"));
 }
 private void MediaPlayer_EncounteredError(object sender, Vlc.DotNet.Core.VlcMediaPlayerEncounteredErrorEventArgs e)
 {
     MessageBox.Show(this, e.ToString(), "error");
 }