コード例 #1
0
        public void Search_FindString_InMultiInt4StringBuffer()
        {
            var buffer = new Int4StringBuffer(TestStrings.DragulaLonger);

            m_Int4StringBuffer = buffer;

            var expectedIndex = TestStrings.DragulaLonger.Length - 3;

            m_Int4String = new Int4String(TestStrings.DragulaLonger[expectedIndex]);

            var array = m_Int4String.IntBytes;
            var index = Search.FindString(ref array, ref buffer.Data, ref buffer.Indices);

            Assert.AreEqual(expectedIndex, index);
        }
コード例 #2
0
        public void BeforeAll()
        {
            m_Result         = new NativeArray <int>(1, Allocator.Persistent);
            m_SmallerStrings = TestData.RandomStrings(10, MinLength, MaxLength);
            m_SmallerBuffer  = new Int4StringBuffer(m_SmallerStrings);

            // this is just to force this job to synchronously compile with Burst before perf test
            var tempInt4String = new Int4String(m_SmallerStrings[0]);

            m_SmallJob = new SingleStringSearchJobInt4(tempInt4String, m_SmallerBuffer, m_Result);
            m_SmallJob.Run();

            var array = tempInt4String.IntBytes;

            Search.FindString(ref array, ref m_SmallerBuffer.Data, ref m_SmallerBuffer.Indices);
            tempInt4String.Dispose();

            m_Strings = TestData.RandomStringsWithPrefix("/composition", StringCount, MinLength, MaxLength);
            m_Buffer  = new Int4StringBuffer(m_Strings);
        }
コード例 #3
0
 public void ConstructFromStringArray_Int4StringBuffer()
 {
     m_Int4StringBuffer = new Int4StringBuffer(TestStrings.Dragula);
     Assert.AreEqual(TestStrings.Dragula.Length, m_Int4StringBuffer.StringCount);
 }