Ejemplo n.º 1
0
        public void TestRowValueAggregatesOrder_bug45145()
        {
            InternalSheet sheet = InternalSheet.CreateSheet();

            RowRecord rr = new RowRecord(5);

            sheet.AddRow(rr);

            CellValueRecordInterface cvr = new BlankRecord();

            cvr.Column = 0;
            cvr.Row    = (5);
            sheet.AddValueRecord(5, cvr);


            int dbCellRecordPos = GetDbCellRecordPos(sheet);

            if (dbCellRecordPos == 252)
            {
                // The overt symptom of the bug
                // DBCELL record pos is1 calculated wrong if VRA comes before RRA
                throw new AssertionException("Identified  bug 45145");
            }

            Assert.AreEqual(242, dbCellRecordPos);
        }
Ejemplo n.º 2
0
        /**
         * Checks for bug introduced around r682282-r683880 that caused a second GUTS records
         * which in turn got the dimensions record out of alignment
         */
        public void TestGutsRecord_bug45640()
        {
            InternalSheet sheet = InternalSheet.CreateSheet();

            sheet.AddRow(new RowRecord(0));
            sheet.AddRow(new RowRecord(1));
            sheet.GroupRowRange(0, 1, true);
            sheet.ToString();
            IList recs  = sheet.Records;
            int   count = 0;

            for (int i = 0; i < recs.Count; i++)
            {
                if (recs[i] is GutsRecord)
                {
                    count++;
                }
            }
            if (count == 2)
            {
                throw new AssertionException("Identified bug 45640");
            }
            Assert.AreEqual(1, count);
        }
Ejemplo n.º 3
0
        public void TestSheetDimensions()
        {
            InternalSheet    sheet      = InternalSheet.CreateSheet();
            DimensionsRecord dimensions = (DimensionsRecord)sheet.FindFirstRecordBySid(DimensionsRecord.sid);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(1, dimensions.LastCol);  // plus pne
            Assert.AreEqual(1, dimensions.LastRow);  // plus pne

            RowRecord rr = new RowRecord(0);

            sheet.AddRow(rr);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(1, dimensions.LastCol);
            Assert.AreEqual(1, dimensions.LastRow);

            CellValueRecordInterface cvr;

            cvr        = new BlankRecord();
            cvr.Column = ((short)0);
            cvr.Row    = (0);
            sheet.AddValueRecord(0, cvr);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(1, dimensions.LastCol);
            Assert.AreEqual(1, dimensions.LastRow);

            cvr        = new BlankRecord();
            cvr.Column = ((short)1);
            cvr.Row    = (0);
            sheet.AddValueRecord(0, cvr);

            Assert.AreEqual(0, dimensions.FirstCol);
            Assert.AreEqual(0, dimensions.FirstRow);
            Assert.AreEqual(2, dimensions.LastCol);   //YK:  failed until Bugzilla 53414 was fixed
            Assert.AreEqual(1, dimensions.LastRow);
        }