Example #1
0
 private void WriteRecords(StoragePage page, TestData[] data)
 {
     foreach (TestData test in data)
     {
         try
         {
             page.WriteRecord(test.recordIdx, test.data);
         }
         catch (Exception e)
         {
             Assert.AreEqual(test.exception, e.GetType().Name,
                             "Unexpected exception. Test Data = [{0}]", test.ToString());
         }
     }
 }
Example #2
0
        private int WriteTopPage(FileStreamWrapper stream, int lastPageAddress)
        {
            // update the header
            ListHdr header = this.pageHeaderList.Pop();

            header.NextPageIndex = lastPageAddress;

            // update the page
            StoragePage page = this.pageList.Pop();

            page.WriteRecord(ListHdr.HeaderRecordIdx, header);

            // get the page to write to
            int pageIdx = header.PageWriteIndex;

            // write the page
            pageIdx = page.WritePageData(stream, pageIdx);
            this.pageIdxList.Insert(0, pageIdx);

            return(pageIdx);
        }