public void TestSetDeqElementByPositionOoRNegative() { var d = new Deq <int>(); d.SetDeqElementByPosition(0, 1); d.SetDeqElementByPosition(-1, -1); }
public void TestSetDeqElementByPositionOoRPositive() { var d = new Deq <int>(); d.SetDeqElementByPosition(0, 1); d.SetDeqElementByPosition(2, 2); }
public void TestEmpty() { var d = new Deq<int>(); Sorter.Sort2(d); Assert.IsTrue(d.Empty); Assert.AreEqual(0, d.Count); }
public void TestGetDeqElementByPositionOutOfRangePositive() { var d = new Deq <int>(); d.SetDeqElementByPosition(0, 1); d.GetDeqElementByPosition(1); }
private void button11_Click(object sender, EventArgs e) // скопировать { d2 = new Deq(d.array.Length); d.array.CopyTo(d2.array, 0); d.Draw(this, pictureBox1, g, false); d2.Draw(this, pictureBox1, g, true); }
public DataSender( Enq EmuEnq , Enq RealEnq , Deq ProcessingData , Deq SetMMLParameter , PackData[] startData , PackData[] stopData , DataSeqFrqEventHandler DataSeqFrqCallBack , Action WaitSync , long EmuDelay , long RealDelay , int BufferSize = DATA_SEQUENCE_FREQUENCE , int Frq = DATA_SEQUENCE_FREQUENCE ) { action = Main; this.Frq = Frq; ringBuffer = new RingBuffer(BufferSize); ringBuffer.AutoExtend = false; this.ringBufferSize = BufferSize; SeqCounter = Def_SeqCounter; this.EmuEnq = EmuEnq; this.RealEnq = RealEnq; this.startData = startData; this.stopData = stopData; this.ProcessingData = ProcessingData; this.SetMMLParameter = SetMMLParameter; OnDataSeqFrq += DataSeqFrqCallBack; this.WaitSync = WaitSync; this.EmuDelay = EmuDelay; this.RealDelay = RealDelay; }
public void TestEmpty() { var d = new Deq <int>(); Sorter.Sort2(d); Assert.IsTrue(d.Empty); Assert.AreEqual(0, d.Count); }
public void TestEmptySetDeqElementByPosition0() { const int val = 100; var d = new Deq <int>(); d.SetDeqElementByPosition(0, val); }
public void TestPushBackPopFrontOne() { const int val = 100503; var d = new Deq <int>(); d.PushBack(val); Assert.AreEqual(val, d.PopFront()); Assert.IsTrue(d.Empty); Assert.AreEqual(0, d.Count); }
public void TestOneItem() { const int val = 100500; var d = new Deq<int>(); d.PushBack(val); Sorter.Sort2(d); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(val, d.PopBack()); }
public void TestPushFront() { const int val = 100501; var d = new Deq <int>(); d.PushFront(val); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(val, d.Back); Assert.AreEqual(val, d.Front); }
public void TestOneItem() { const int val = 100500; var d = new Deq <int>(); d.PushBack(val); Sorter.Sort2(d); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(val, d.PopBack()); }
public void TestPushFront1To4() { var d = new Deq <int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.IsFalse(d.Empty); Assert.AreEqual(4, d.Count); }
public void TestSetDeqElementByPosition() { var d = new Deq <int>(); d.PushFront(1); d.SetDeqElementByPosition(0, 2); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(2, d.GetDeqElementByPosition(0)); Assert.AreEqual(2, d.PopFront()); }
public void TestPushFrontGetByPos() { var d = new Deq <int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.GetDeqElementByPosition(0)); Assert.AreEqual(3, d.GetDeqElementByPosition(1)); Assert.AreEqual(2, d.GetDeqElementByPosition(2)); Assert.AreEqual(1, d.GetDeqElementByPosition(3)); }
public void TestOrderPushBackPopBack() { var d = new Deq <int>(); d.PushBack(1); d.PushBack(2); d.PushBack(3); d.PushBack(4); Assert.AreEqual(4, d.PopBack()); Assert.AreEqual(3, d.PopBack()); Assert.AreEqual(2, d.PopBack()); Assert.AreEqual(1, d.PopBack()); }
public void TestOrderPushFrontPopFront() { var d = new Deq <int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.PopFront()); Assert.AreEqual(3, d.PopFront()); Assert.AreEqual(2, d.PopFront()); Assert.AreEqual(1, d.PopFront()); }
private void button13_Click(object sender, EventArgs e) //объединить в 1 { try { d1 = new Deq(d.array.Length + d2.array.Length); d1.array = d.array.Concat(d2.array).ToArray(); d = d1; d2 = null; d.Draw(this, pictureBox1, g, false); } catch (Exception ex) { MessageBox.Show("Ошибка при объединении! Нужно задать второй список", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void TestTwoItems() { const int val1 = 100500; const int val2 = 100600; var d = new Deq <int>(); d.PushBack(val1); d.PushBack(val2); d = Sorter.Sort2(d); Assert.IsFalse(d.Empty); Assert.AreEqual(2, d.Count); Assert.AreEqual(val1, d.PopFront()); Assert.AreEqual(val2, d.PopFront()); }
private void button1_Click(object sender, EventArgs e) // создать список { d = new Deq(); d.Draw(this, pictureBox1, g, false); button10.Enabled = true; button11.Enabled = true; button12.Enabled = true; button14.Enabled = true; button13.Enabled = true; button4.Enabled = true; button2.Enabled = true; button9.Enabled = true; button7.Enabled = true; button6.Enabled = true; button8.Enabled = true; }
private void button12_Click(object sender, EventArgs e) //разбить на 2 { int size = d.array.Length / 2; d1 = new Deq(size); for (int i = 0; i < size; i++) { d1.array[i] = d.array[i]; } d2 = new Deq(d.array.Length - size); for (int i = 0; i < d.array.Length - size; i++) { d2.array[i] = d.array[i + size]; } d = d1; d.Draw(this, pictureBox1, g, false); d2.Draw(this, pictureBox1, g, true); }
public void TestSortMoreItems() { int[] data = new[] {100500, 100600, 1, 1999, 200500, 1000, 100, 5}; var d = new Deq<int>(); foreach (var v in data) { d.PushBack(v); } d = Sorter.Sort2(d); Assert.IsFalse(d.Empty); Assert.AreEqual(data.Length, d.Count); Array.Sort(data); foreach (var v in data) { Assert.AreEqual(v, d.PopFront()); } }
/// <summary> /// セットアップ /// </summary> /// <param name="DriverAction">ミュージックドライバーの1フレームあたりの処理を指定してください</param> /// <param name="RealChipAction">実チップ向けデータ送信処理を指定してください</param> /// <param name="startData">DataSenderが初期化を行うときに出力するデータを指定してください</param> public void Setup( DriverAction DriverAction , Snd RealChipAction , Deq ProcessingData , Deq SetMMLParameter , DataSeqFrqEventHandler DataSeqFrqCallBack , Action WaitSync , PackData[] startData , long EmuDelay , long RealDelay ) { dataMaker = new DataMaker(DriverAction); emuChipSender = new EmuChipSender(DATA_SEQUENCE_FREQUENCE); realChipSender = new RealChipSender(RealChipAction, DATA_SEQUENCE_FREQUENCE); dataSender = new DataSender( emuChipSender.Enq , realChipSender.Enq , ProcessingData , SetMMLParameter , startData , null , DataSeqFrqCallBack , WaitSync , EmuDelay , RealDelay //, mml2vgmIDE.Common.SampleRate //, mml2vgmIDE.Common.SampleRate ); dataMaker.parent = this; emuChipSender.parent = this; realChipSender.parent = this; dataSender.parent = this; dataMaker.Mount(); dataSender.Mount(); emuChipSender.Mount(); realChipSender.Mount(); }
public void TestSortSortedMoreItems() { int[] data = new[] { 100500, 100600, 1, 1999, 200500, 1000, 100, 5 }; Array.Sort(data); var d = new Deq <int>(); foreach (var v in data) { d.PushBack(v); } d = Sorter.Sort2(d); Assert.IsFalse(d.Empty); Assert.AreEqual(data.Length, d.Count); foreach (var v in data) { Assert.AreEqual(v, d.PopFront()); } }
/// <summary> /// セットアップ /// </summary> /// <param name="DriverAction">ミュージックドライバーの1フレームあたりの処理を指定してください</param> /// <param name="RealChipAction">実チップ向けデータ送信処理を指定してください</param> /// <param name="startData">DataSenderが初期化を行うときに出力するデータを指定してください</param> public void Setup( DriverAction DriverAction , Snd RealChipAction , Deq ProcessingData , Action <long> DataSeqFrqCallBack , Action WaitSync , PackData[] startData , long EmuDelay , long RealDelay ) { dataMaker = new DataMaker(DriverAction); emuChipSender = new EmuChipSender(DATA_SEQUENCE_FREQUENCE); realChipSender = new RealChipSender(RealChipAction, DATA_SEQUENCE_FREQUENCE); dataSender = new DataSender( emuChipSender.Enq , realChipSender.Enq , ProcessingData , startData , null , DataSeqFrqCallBack , WaitSync , EmuDelay , RealDelay ); dataMaker.parent = this; emuChipSender.parent = this; realChipSender.parent = this; dataSender.parent = this; dataMaker.Mount(); dataSender.Mount(); emuChipSender.Mount(); realChipSender.Mount(); }
public void TestEmptySetDeqElementByPosition0() { const int val = 100; var d = new Deq<int>(); d.SetDeqElementByPosition(0, val); }
public void TestEmptyPopBack() { var d = new Deq<int>(); d.PopBack(); }
public void TestEmptySetDeqElementByPositionOoRMinus1() { var d = new Deq<int>(); d.SetDeqElementByPosition(-1, 1); }
public void TestEmptyGetFront() { var d = new Deq <int>(); var val = d.Front; }
public void TestEmptyPopFront() { var d = new Deq <int>(); d.PopFront(); }
public void TestEmpty() { var d = new Deq<int>(); Assert.IsTrue(d.Empty); }
public void TestOrderPushBackPopBack() { var d = new Deq<int>(); d.PushBack(1); d.PushBack(2); d.PushBack(3); d.PushBack(4); Assert.AreEqual(4, d.PopBack()); Assert.AreEqual(3, d.PopBack()); Assert.AreEqual(2, d.PopBack()); Assert.AreEqual(1, d.PopBack()); }
public void TestEmpty() { var d = new Deq <int>(); Assert.IsTrue(d.Empty); }
public void TestSetDeqElementByPosition() { var d = new Deq<int>(); d.PushFront(1); d.SetDeqElementByPosition(0, 2); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(2, d.GetDeqElementByPosition(0)); Assert.AreEqual(2, d.PopFront()); }
public void TestSetDeqElementByPositionOoRNegative() { var d = new Deq<int>(); d.SetDeqElementByPosition(0, 1); d.SetDeqElementByPosition(-1, -1); }
public void TestSetDeqElementByPositionOoRPositive() { var d = new Deq<int>(); d.SetDeqElementByPosition(0, 1); d.SetDeqElementByPosition(2, 2); }
public void TestEmptyCountZero() { var d = new Deq<int>(); Assert.IsTrue(d.Count == 0); }
public void TestOrderPushFrontPopFront() { var d = new Deq<int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.PopFront()); Assert.AreEqual(3, d.PopFront()); Assert.AreEqual(2, d.PopFront()); Assert.AreEqual(1, d.PopFront()); }
public void TestEmptyGetBack() { var d = new Deq<int>(); var val = d.Back; }
public void TestEmptyPopBack() { var d = new Deq <int>(); d.PopBack(); }
public void TestPushFrontPopBackOne() { const int val = 100502; var d = new Deq<int>(); d.PushFront(val); Assert.AreEqual(val, d.PopBack()); Assert.IsTrue(d.Empty); Assert.AreEqual(0, d.Count); }
public void TestGetDeqElementByPositionOutOfRangePositive() { var d = new Deq<int>(); d.SetDeqElementByPosition(0, 1); d.GetDeqElementByPosition(1); }
public void TestEmptySetDeqElementByPositionOoR1() { var d = new Deq <int>(); d.SetDeqElementByPosition(1, 1); }
public void TestEmptyGetBack() { var d = new Deq <int>(); var val = d.Back; }
public void TestPushFrontGetByPos() { var d = new Deq<int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.AreEqual(4, d.GetDeqElementByPosition(0)); Assert.AreEqual(3, d.GetDeqElementByPosition(1)); Assert.AreEqual(2, d.GetDeqElementByPosition(2)); Assert.AreEqual(1, d.GetDeqElementByPosition(3)); }
public void TestEmptyGetDeqElementByPosition1() { var d = new Deq <int>(); d.GetDeqElementByPosition(1); }
public void TestPushFront1To4() { var d = new Deq<int>(); d.PushFront(1); d.PushFront(2); d.PushFront(3); d.PushFront(4); Assert.IsFalse(d.Empty); Assert.AreEqual(4, d.Count); }
public void TestThreeItems() { const int val1 = 100500; const int val2 = 100600; const int val3 = 100700; var d = new Deq<int>(); d.PushBack(val2); d.PushBack(val3); d.PushBack(val1); d = Sorter.Sort2(d); Assert.IsFalse(d.Empty); Assert.AreEqual(3, d.Count); Assert.AreEqual(val1, d.PopFront()); Assert.AreEqual(val2, d.PopFront()); Assert.AreEqual(val3, d.PopFront()); }
public void TestEmptyGetFront() { var d = new Deq<int>(); var val = d.Front; }
public void TestEmptyCountZero() { var d = new Deq <int>(); Assert.IsTrue(d.Count == 0); }
public void TestEmptyPopFront() { var d = new Deq<int>(); d.PopFront(); }
public void TestPushFront() { const int val = 100501; var d = new Deq<int>(); d.PushFront(val); Assert.IsFalse(d.Empty); Assert.AreEqual(1, d.Count); Assert.AreEqual(val, d.Back); Assert.AreEqual(val, d.Front); }
public void TestEmptyGetDeqElementByPositionMinus0() { var d = new Deq<int>(); d.GetDeqElementByPosition(-1); }