Ignore:
Timestamp:
05/07/2009 22:43:57 (3 years ago)
Author:
chris
Message:

Allow RaidFileWrite? to test that the reference count of an object is
correct before overwriting or deleting it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/raidfile/testraidfile.cpp

    r2506 r2543  
    628628        } 
    629629 
     630        // Test that creating and deleting a RaidFile with the wrong 
     631        // reference counts throws the expected errors. 
     632        { 
     633                RaidFileWrite write1(0, "write1", 1); 
     634                write1.Open(); 
     635                write1.Commit(); 
     636                TEST_CHECK_THROWS(write1.Delete(), RaidFileException, 
     637                        RequestedDeleteReferencedFile); 
     638        } 
     639 
     640        { 
     641                RaidFileWrite write1(0, "write1", 0); 
     642                write1.Open(true); 
     643                TEST_CHECK_THROWS(write1.Commit(), RaidFileException, 
     644                        RequestedModifyUnreferencedFile); 
     645                write1.Delete(); 
     646        } 
     647 
     648        { 
     649                TEST_CHECK_THROWS(RaidFileWrite write1(0, "write1", 2), 
     650                        RaidFileException, 
     651                        RequestedModifyMultiplyReferencedFile); 
     652        } 
     653 
    630654        // Create a RaidFile 
    631655        RaidFileWrite write1(0, "test1"); 
Note: See TracChangeset for help on using the changeset viewer.