cppunit-cvs Mailing List for CppUnit - C++ port of JUnit (Page 7)
Brought to you by:
blep
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(94) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(114) |
Mar
(80) |
Apr
|
May
|
Jun
(36) |
Jul
(67) |
Aug
(37) |
Sep
(33) |
Oct
(28) |
Nov
(91) |
Dec
(16) |
2006 |
Jan
(1) |
Feb
(7) |
Mar
(45) |
Apr
|
May
|
Jun
(36) |
Jul
(7) |
Aug
|
Sep
(32) |
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
(29) |
Feb
(11) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(35) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(13) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(15) |
From: Baptiste L. <bl...@us...> - 2006-09-02 11:24:57
|
Update of /cvsroot/cppunit/cppunit2/makefiles/vs71 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13370/makefiles/vs71 Modified Files: cpput_lib.vcproj Log Message: - added LazyMessage, a simple proxy class that avoid building Message until it is really needed (assertion failed). Index: cpput_lib.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/makefiles/vs71/cpput_lib.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cpput_lib.vcproj 5 Jun 2006 12:02:56 -0000 1.4 --- cpput_lib.vcproj 2 Sep 2006 11:24:53 -0000 1.5 *************** *** 211,214 **** --- 211,217 ---- </File> <File + RelativePath="..\..\src\cpput\message.cpp"> + </File> + <File RelativePath="..\..\include\cpput\message.h"> </File> |
From: Baptiste L. <bl...@us...> - 2006-09-01 20:12:18
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32087/doc Added Files: SConscript Log Message: - added missing sconscript. --- NEW FILE: SConscript --- Import( 'env' ) import os.path if 'doxygen' in env['TOOLS']: doc_topdir = env['ROOTBUILD_DIR'] doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in', SUBST_DICT = { '%CPPUNIT_VERSION%' : env['CPPUNIT_VERSION'], '%TOPDIR%' : env.Dir('#').abspath, '%DOC_TOPDIR%' : str(doc_topdir) } ) doc_cmd = env.Doxygen( doxyfile ) env.Alias('doc', doc_cmd) env.AlwaysBuild(doc_cmd) for dir in doc_cmd: filename = os.path.split(dir.path)[1] targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % filename ) zip_doc_cmd = env.TarGz( targz_path, [env.Dir(dir)], TARGZ_BASEDIR = doc_topdir ) env.Alias( 'doc-dist', zip_doc_cmd ) |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:59:52
|
Update of /cvsroot/cppunit/cppunit2/src/cpptl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27173/src/cpptl Added Files: deque.cpp json_batchallocator.h json_internalarray.inl json_internalmap.inl json_valueiterator.inl Log Message: - synchronized with lastest jsoncpp. --- NEW FILE: json_batchallocator.h --- #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED # define JSONCPP_BATCHALLOCATOR_H_INCLUDED # include <stdlib.h> # include <assert.h> # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { /* Fast memory allocator. * * This memory allocator allocates memory for a batch of object (specified by * the page size, the number of object in each page). * * It does not allow the destruction of a single object. All the allocated objects * can be destroyed at once. The memory can be either released or reused for future * allocation. * * The in-place new operator must be used to construct the object using the pointer * returned by allocate. */ template<typename AllocatedType ,const unsigned int objectPerAllocation> class BatchAllocator { public: typedef AllocatedType Type; BatchAllocator( unsigned int objectsPerPage = 255 ) : freeHead_( 0 ) , objectsPerPage_( objectsPerPage ) { // printf( "Size: %d => %s\n", sizeof(AllocatedType), typeid(AllocatedType).name() ); assert( sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *) ); // We must be able to store a slist in the object free space. assert( objectsPerPage >= 16 ); batches_ = allocateBatch( 0 ); // allocated a dummy page currentBatch_ = batches_; } ~BatchAllocator() { for ( BatchInfo *batch = batches_; batch; ) { BatchInfo *nextBatch = batch->next_; free( batch ); batch = nextBatch; } } /// allocate space for an array of objectPerAllocation object. /// @warning it is the responsability of the caller to call objects constructors. AllocatedType *allocate() { if ( freeHead_ ) // returns node from free list. { AllocatedType *object = freeHead_; freeHead_ = *(AllocatedType **)object; return object; } if ( currentBatch_->used_ == currentBatch_->end_ ) { currentBatch_ = currentBatch_->next_; while ( currentBatch_ && currentBatch_->used_ == currentBatch_->end_ ) currentBatch_ = currentBatch_->next_; if ( !currentBatch_ ) // no free batch found, allocate a new one { currentBatch_ = allocateBatch( objectsPerPage_ ); currentBatch_->next_ = batches_; // insert at the head of the list batches_ = currentBatch_; } } AllocatedType *allocated = currentBatch_->used_; currentBatch_->used_ += objectPerAllocation; return allocated; } /// Release the object. /// @warning it is the responsability of the caller to actually destruct the object. void release( AllocatedType *object ) { assert( object != 0 ); *(AllocatedType **)object = freeHead_; freeHead_ = object; } private: struct BatchInfo { BatchInfo *next_; AllocatedType *used_; AllocatedType *end_; AllocatedType buffer_[objectPerAllocation]; }; // disabled copy constructor and assignement operator. BatchAllocator( const BatchAllocator & ); void operator =( const BatchAllocator &); static BatchInfo *allocateBatch( unsigned int objectsPerPage ) { const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType)* objectPerAllocation + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; BatchInfo *batch = static_cast<BatchInfo*>( malloc( mallocSize ) ); batch->next_ = 0; batch->used_ = batch->buffer_; batch->end_ = batch->buffer_ + objectsPerPage; return batch; } BatchInfo *batches_; BatchInfo *currentBatch_; /// Head of a single linked list within the allocated space of freeed object AllocatedType *freeHead_; unsigned int objectsPerPage_; }; } // namespace Json # endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED --- NEW FILE: json_internalarray.inl --- // included by json_value.cpp // everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueArrayAllocator::~ValueArrayAllocator() { } // ////////////////////////////////////////////////////////////////// // class DefaultValueArrayAllocator // ////////////////////////////////////////////////////////////////// #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destructArray( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast<Value **>( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; #else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray(); // placement new return array; } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray( other ); // placement new return array; } virtual void destructArray( ValueInternalArray *array ) { if ( array ) { array->~ValueInternalArray(); arraysAllocator_.release( array ); } } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast<Value **>( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast<Value *>( pagesAllocator_.allocate() ); } virtual void releaseArrayPage( Value *value ) { if ( value ) pagesAllocator_.release( value ); } private: BatchAllocator<ValueInternalArray,1> arraysAllocator_; BatchAllocator<Value,ValueInternalArray::itemsPerPage> pagesAllocator_; }; #endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR static ValueArrayAllocator *&arrayAllocator() { static DefaultValueArrayAllocator defaultAllocator; static ValueArrayAllocator *arrayAllocator = &defaultAllocator; return arrayAllocator; } static struct DummyArrayAllocatorInitializer { DummyArrayAllocatorInitializer() { arrayAllocator(); // ensure arrayAllocator() statics are initialized before main(). } } dummyArrayAllocatorInitializer; // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// bool ValueInternalArray::equals( const IteratorState &x, const IteratorState &other ) { return x.array_ == other.array_ && x.currentItemIndex_ == other.currentItemIndex_ && x.currentPageIndex_ == other.currentPageIndex_; } void ValueInternalArray::increment( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ != it.array_->size_, "ValueInternalArray::increment(): moving iterator beyond end" ); ++(it.currentItemIndex_); if ( it.currentItemIndex_ == itemsPerPage ) { it.currentItemIndex_ = 0; ++(it.currentPageIndex_); } } void ValueInternalArray::decrement( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_ && it.currentItemIndex_ == 0, "ValueInternalArray::decrement(): moving iterator beyond end" ); if ( it.currentItemIndex_ == 0 ) { it.currentItemIndex_ = itemsPerPage-1; --(it.currentPageIndex_); } else { --(it.currentItemIndex_); } } Value & ValueInternalArray::unsafeDereference( const IteratorState &it ) { return (*(it.currentPageIndex_))[it.currentItemIndex_]; } Value & ValueInternalArray::dereference( const IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ < it.array_->size_, "ValueInternalArray::dereference(): dereferencing invalid iterator" ); return unsafeDereference( it ); } void ValueInternalArray::makeBeginIterator( IteratorState &it ) const { it.array_ = const_cast<ValueInternalArray *>( this ); it.currentItemIndex_ = 0; it.currentPageIndex_ = pages_; } void ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const { it.array_ = const_cast<ValueInternalArray *>( this ); it.currentItemIndex_ = index % itemsPerPage; it.currentPageIndex_ = pages_ + index / itemsPerPage; } void ValueInternalArray::makeEndIterator( IteratorState &it ) const { makeIterator( it, size_ ); } ValueInternalArray::ValueInternalArray() : pages_( 0 ) , size_( 0 ) , pageCount_( 0 ) { } ValueInternalArray::ValueInternalArray( const ValueInternalArray &other ) : pages_( 0 ) , pageCount_( 0 ) , size_( other.size_ ) { PageIndex minNewPages = other.size_ / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); IteratorState itOther; other.makeBeginIterator( itOther ); Value *value; for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) ) { if ( index % itemsPerPage == 0 ) { PageIndex pageIndex = index / itemsPerPage; value = arrayAllocator()->allocateArrayPage(); pages_[pageIndex] = value; } new (value) Value( dereference( itOther ) ); } } ValueInternalArray & ValueInternalArray::operator =( const ValueInternalArray &other ) { ValueInternalArray temp( other ); swap( temp ); return *this; } ValueInternalArray::~ValueInternalArray() { // destroy all constructed items IteratorState it; IteratorState itEnd; makeBeginIterator( it); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } // release all pages PageIndex lastPageIndex = size_ / itemsPerPage; for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); // release pages index arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ ); } void ValueInternalArray::swap( ValueInternalArray &other ) { Value **tempPages = pages_; pages_ = other.pages_; other.pages_ = tempPages; ArrayIndex tempSize = size_; size_ = other.size_; other.size_ = tempSize; PageIndex tempPageCount = pageCount_; pageCount_ = other.pageCount_; other.pageCount_ = tempPageCount; } void ValueInternalArray::clear() { ValueInternalArray dummy; swap( dummy ); } void ValueInternalArray::resize( ArrayIndex newSize ) { if ( newSize == 0 ) clear(); else if ( newSize < size_ ) { IteratorState it; IteratorState itEnd; makeIterator( it, newSize ); makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; PageIndex lastPageIndex = size_ / itemsPerPage; for ( ; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); size_ = newSize; } else if ( newSize > size_ ) resolveReference( newSize ); } void ValueInternalArray::makeIndexValid( ArrayIndex index ) { // Need to enlarge page index ? if ( index >= pageCount_ * itemsPerPage ) { PageIndex minNewPages = (index + 1) / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); } // Need to allocate new pages ? ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage : size_; if ( nextPageIndex <= index ) { PageIndex pageIndex = nextPageIndex / itemsPerPage; PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; for ( ; pageToAllocate-- > 0; ++pageIndex ) pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); } // Initialize all new entries IteratorState it; IteratorState itEnd; makeIterator( it, size_ ); size_ = index + 1; makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); new (value) Value(); // Construct a default value using placement new } } Value & ValueInternalArray::resolveReference( ArrayIndex index ) { if ( index >= size_ ) makeIndexValid( index ); return pages_[index/itemsPerPage][index%itemsPerPage]; } Value * ValueInternalArray::find( ArrayIndex index ) const { if ( index >= size_ ) return 0; return &(pages_[index/itemsPerPage][index%itemsPerPage]); } ValueInternalArray::ArrayIndex ValueInternalArray::size() const { return size_; } int ValueInternalArray::distance( const IteratorState &x, const IteratorState &y ) { return indexOf(y) - indexOf(x); } ValueInternalArray::ArrayIndex ValueInternalArray::indexOf( const IteratorState &iterator ) { if ( !iterator.array_ ) return ArrayIndex(-1); return ArrayIndex( (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage + iterator.currentItemIndex_ ); } int ValueInternalArray::compare( const ValueInternalArray &other ) const { int sizeDiff( size_ - other.size_ ); if ( sizeDiff != 0 ) return sizeDiff; for ( ArrayIndex index =0; index < size_; ++index ) { int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( other.pages_[index/itemsPerPage][index%itemsPerPage] ); if ( diff != 0 ) return diff; } return 0; } --- NEW FILE: deque.cpp --- #include <cpptl/deque.h> namespace CppTL { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class DequeBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// DequeBase::DequeBase() { initialize(); } DequeBase::~DequeBase() { delete [] pageMapBuffer_; } void DequeBase::initialize() { pageMapBuffer_ = 0; pageMap_ = 0; pageMapBufferSize_ = 0; usedPages_ = 0; firstPageStartIndex_ = 0; lastPageEndIndex_ = 0; } void DequeBase::swap( DequeBase &other ) { CppTL::swap( pageMapBuffer_, other.pageMapBuffer_ ); CppTL::swap( pageMap_, other.pageMap_ ); CppTL::swap( pageMapBufferSize_, other.pageMapBufferSize_ ); CppTL::swap( usedPages_, other.usedPages_ ); CppTL::swap( firstPageStartIndex_, other.firstPageStartIndex_ ); CppTL::swap( lastPageEndIndex_, other.lastPageEndIndex_ ); } void DequeBase::prependPage( void *newPage ) { growPageMap( 1, 0 ); CPPTL_ASSERT_MESSAGE( pageMap_ > pageMapBuffer_, "DequeBase::growPageMap(): logic bug" ); *--pageMap_ = newPage; ++usedPages_; } void DequeBase::appendPage( void *newPage ) { growPageMap( 0, 1 ); CPPTL_ASSERT_MESSAGE( usedPages_ < pageMapBufferSize_, "DequeBase::growPageMap(): logic bug" ); pageMap_[ usedPages_++ ] = newPage; } void DequeBase::growPageMap( size_t pagesToPrepend, size_t pagesToAppend ) { size_t minNewSize = usedPages_ + pagesToPrepend + pagesToAppend; size_t maxAvailableFront = pageMap_ - pageMapBuffer_; size_t maxAvailableBack = pageMapBufferSize_ - usedPages_; if ( minNewSize > pageMapBufferSize_ || maxAvailableFront < pagesToPrepend || maxAvailableBack < pagesToAppend ) // not enough space, need to realloc { const size_t minGrowth = 32; size_t baseSize = CPPTL_MAX( minNewSize, pageMapBufferSize_ + minGrowth ); size_t newSize = baseSize/2 + baseSize; void **oldBuffer = pageMapBuffer_; typedef void *VoidPtr; pageMapBuffer_ = new VoidPtr[pageMapBufferSize_]; // may throw if not enough memory delete [] oldBuffer; pageMapBufferSize_ = newSize; size_t zeroIndex = (pageMapBufferSize_ - minNewSize) / 2; pageMap_ = pageMapBuffer_ + sizeof(void*) * zeroIndex; memmove( pageMap_, pageMapBuffer_ + sizeof(void*) * maxAvailableFront, sizeof(void*) * usedPages_ ); } } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class DequeIteratorCommonBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// DequeIteratorCommonBase::DequeIteratorCommonBase() : pageMapBegin_( 0 ) , pageMapEnd_( 0 ) , pageMapCurrent_( 0 ) , indexInCurrentPage_( 0 ) , firstPageStartIndex_( 0 ) , lastPageStartIndex_( 0 ) { } DequeIteratorCommonBase::DequeIteratorCommonBase( void **pageMapBegin, void **pageMapEnd, void **pageMapCurrent, size_t indexInCurrentPage, size_t firstPageStartIndex, size_t lastPageStartIndex ) : pageMapBegin_( pageMapBegin ) , pageMapEnd_( pageMapEnd ) , pageMapCurrent_( pageMapCurrent ) , indexInCurrentPage_( indexInCurrentPage ) , firstPageStartIndex_( firstPageStartIndex ) , lastPageStartIndex_( lastPageStartIndex ) { } void DequeIteratorCommonBase::increment() { CPPTL_ASSERT_MESSAGE( pageMapCurrent_ != pageMapEnd_ || indexInCurrentPage_ != lastPageStartIndex_, "DequeIterator: incrementing beyond end" ); ++indexInCurrentPage_; if ( indexInCurrentPage_ == elementPerPage ) { ++pageMapCurrent_; indexInCurrentPage_ = 0; } } void DequeIteratorCommonBase::decrement() { CPPTL_ASSERT_MESSAGE( pageMapCurrent_ != pageMapBegin_ || indexInCurrentPage_ != firstPageStartIndex_, "DequeIterator: decrementing beyond beginning" ); if ( indexInCurrentPage_ == 0 ) { --pageMapCurrent_; indexInCurrentPage_ = elementPerPage - 1; } else { --indexInCurrentPage_; } } void DequeIteratorCommonBase::advance( difference_type n ) { if ( n > 0 ) { n += indexInCurrentPage_; size_t inPageAdvance = n % elementPerPage; size_t fullPageAdvance = n / elementPerPage; CPPTL_ASSERT_MESSAGE( pageMapEnd_-pageMapCurrent_ < fullPageAdvance, "DequeIterator: advancing beyond end" ); CPPTL_ASSERT_MESSAGE( pageMapCurrent_ + fullPageAdvance + 1 != pageMapEnd_ || inPageAdvance < lastPageStartIndex_, "DequeIterator: advancing beyond end" ); pageMapCurrent_ += fullPageAdvance; indexInCurrentPage_ = inPageAdvance; } else if ( n < 0 ) { n = indexInCurrentPage_ - n; if ( n >= 0 ) { indexInCurrentPage_ = n; } else { size_t inPageAdvance = -n % elementPerPage; size_t fullPageAdvance = -n / elementPerPage; CPPTL_ASSERT_MESSAGE( pageMapCurrent_-pageMapBegin_ < fullPageAdvance, "DequeIterator: advancing beyond beginning" ); CPPTL_ASSERT_MESSAGE( pageMapCurrent_ - fullPageAdvance == pageMapBegin_ || inPageAdvance >= firstPageStartIndex_, "DequeIterator: advancing beyond beginning" ); pageMapCurrent_ -= fullPageAdvance; indexInCurrentPage_ = inPageAdvance; } } } DequeIteratorCommonBase::difference_type DequeIteratorCommonBase::computeDistance( const DequeIteratorCommonBase &other ) const { difference_type pageDistance = difference_type(pageMapCurrent_ - pageMapBegin_) - difference_type(other.pageMapCurrent_ - other.pageMapBegin_); difference_type indexDistance( indexInCurrentPage_ - other.indexInCurrentPage_ ); return pageDistance * elementPerPage + indexDistance; } DequeIteratorCommonBase::size_t DequeIteratorCommonBase::index() const { return (pageMapCurrent_ - pageMapBegin_) * elementPerPage + indexInCurrentPage_ - firstPageStartIndex_; } } // namespace CppTL --- NEW FILE: json_valueiterator.inl --- // included by json_value.cpp // everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIteratorBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIteratorBase::ValueIteratorBase() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) : current_( current ) { } #else ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) : isArray_( true ) { iterator_.array_ = state; } ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) : isArray_( false ) { iterator_.map_ = state; } #endif Value & ValueIteratorBase::deref() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_->second; #else if ( isArray_ ) return ValueInternalArray::dereference( iterator_.array_ ); return ValueInternalMap::value( iterator_.map_ ); #endif } void ValueIteratorBase::increment() { #ifndef JSON_VALUE_USE_INTERNAL_MAP ++current_; #else if ( isArray_ ) ValueInternalArray::increment( iterator_.array_ ); ValueInternalMap::increment( iterator_.map_ ); #endif } void ValueIteratorBase::decrement() { #ifndef JSON_VALUE_USE_INTERNAL_MAP --current_; #else if ( isArray_ ) ValueInternalArray::decrement( iterator_.array_ ); ValueInternalMap::decrement( iterator_.map_ ); #endif } ValueIteratorBase::difference_type ValueIteratorBase::computeDistance( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP # ifdef JSON_USE_CPPTL_SMALLMAP return current_ - other.current_; # else return difference_type( std::distance( current_, other.current_ ) ); # endif #else if ( isArray_ ) return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); #endif } bool ValueIteratorBase::isEqual( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_ == other.current_; #else if ( isArray_ ) return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); #endif } void ValueIteratorBase::copy( const SelfType &other ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP current_ = other.current_; #else if ( isArray_ ) iterator_.array_ = other.iterator_.array_; iterator_.map_ = other.iterator_.map_; #endif } Value ValueIteratorBase::key() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( czstring.c_str() ) { if ( czstring.isStaticString() ) return Value( StaticString( czstring.c_str() ) ); return Value( czstring.c_str() ); } return Value( czstring.index() ); #else if ( isArray_ ) return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); bool isStatic; const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); if ( isStatic ) return Value( StaticString( memberName ) ); return Value( memberName ); #endif } Value::UInt ValueIteratorBase::index() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( !czstring.c_str() ) return czstring.index(); return Value::UInt( -1 ); #else if ( isArray_ ) return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); return Value::UInt( -1 ); #endif } const char * ValueIteratorBase::memberName() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const char *name = (*current_).first.c_str(); return name ? name : ""; #else if ( !isArray_ ) return ValueInternalMap::key( iterator_.map_ ); return ""; #endif } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueConstIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueConstIterator::ValueConstIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueConstIterator & ValueConstIterator::operator =( const ValueIteratorBase &other ) { copy( other ); return *this; } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIterator::ValueIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueIterator::ValueIterator( const ValueConstIterator &other ) : ValueIteratorBase( other ) { } ValueIterator::ValueIterator( const ValueIterator &other ) : ValueIteratorBase( other ) { } ValueIterator & ValueIterator::operator =( const SelfType &other ) { copy( other ); return *this; } --- NEW FILE: json_internalmap.inl --- // included by json_value.cpp // everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalMap // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// /** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) ); * This optimization is used by the fast allocator. */ ValueInternalLink::ValueInternalLink() : previous_( 0 ) , next_( 0 ) { } ValueInternalLink::~ValueInternalLink() { for ( int index =0; index < itemPerLink; ++index ) { if ( !items_[index].isItemAvailable() ) { if ( !items_[index].isMemberNameStatic() ) free( keys_[index] ); } else break; } } ValueMapAllocator::~ValueMapAllocator() { } #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; #else /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap(); // placement new return map; } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap( other ); // placement new return map; } virtual void destructMap( ValueInternalMap *map ) { if ( map ) { map->~ValueInternalMap(); mapsAllocator_.release( map ); } } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { ValueInternalLink *link = linksAllocator_.allocate(); memset( link, 0, sizeof(ValueInternalLink) ); return link; } virtual void releaseMapLink( ValueInternalLink *link ) { link->~ValueInternalLink(); linksAllocator_.release( link ); } private: BatchAllocator<ValueInternalMap,1> mapsAllocator_; BatchAllocator<ValueInternalLink,1> linksAllocator_; }; #endif static ValueMapAllocator *&mapAllocator() { static DefaultValueMapAllocator defaultAllocator; static ValueMapAllocator *mapAllocator = &defaultAllocator; return mapAllocator; } static struct DummyMapAllocatorInitializer { DummyMapAllocatorInitializer() { mapAllocator(); // ensure mapAllocator() statics are initialized before main(). } } dummyMapAllocatorInitializer; // h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. /* use linked list hash map. buckets array is a container. linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) value have extra state: valid, available, deleted */ ValueInternalMap::ValueInternalMap() : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { } ValueInternalMap::ValueInternalMap( const ValueInternalMap &other ) : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { reserve( other.itemCount_ ); IteratorState it; IteratorState itEnd; other.makeBeginIterator( it ); other.makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { bool isStatic; const char *memberName = key( it, isStatic ); const Value &aValue = value( it ); resolveReference(memberName, isStatic) = aValue; } } ValueInternalMap & ValueInternalMap::operator =( const ValueInternalMap &other ) { ValueInternalMap dummy( other ); swap( dummy ); return *this; } ValueInternalMap::~ValueInternalMap() { if ( buckets_ ) { for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex ) { ValueInternalLink *link = buckets_[bucketIndex].next_; while ( link ) { ValueInternalLink *linkToRelease = link; link = link->next_; mapAllocator()->releaseMapLink( linkToRelease ); } } mapAllocator()->releaseMapBuckets( buckets_ ); } } void ValueInternalMap::swap( ValueInternalMap &other ) { ValueInternalLink *tempBuckets = buckets_; buckets_ = other.buckets_; other.buckets_ = tempBuckets; ValueInternalLink *tempTailLink = tailLink_; tailLink_ = other.tailLink_; other.tailLink_ = tempTailLink; BucketIndex tempBucketsSize = bucketsSize_; bucketsSize_ = other.bucketsSize_; other.bucketsSize_ = tempBucketsSize; BucketIndex tempItemCount = itemCount_; itemCount_ = other.itemCount_; other.itemCount_ = tempItemCount; } void ValueInternalMap::clear() { ValueInternalMap dummy; swap( dummy ); } ValueInternalMap::BucketIndex ValueInternalMap::size() const { return itemCount_; } bool ValueInternalMap::reserveDelta( BucketIndex growth ) { return reserve( itemCount_ + growth ); } bool ValueInternalMap::reserve( BucketIndex newItemCount ) { if ( !buckets_ && newItemCount > 0 ) { buckets_ = mapAllocator()->allocateMapBuckets( 1 ); bucketsSize_ = 1; tailLink_ = &buckets_[0]; } // BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; return true; } const Value * ValueInternalMap::find( const char *key ) const { if ( !bucketsSize_ ) return 0; HashKey hashedKey = hash( key ); BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( const ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; current = current->next_ ) { for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return 0; if ( strcmp( key, current->keys_[index] ) == 0 ) return ¤t->items_[index]; } } return 0; } Value * ValueInternalMap::find( const char *key ) { const ValueInternalMap *constThis = this; return const_cast<Value *>( constThis->find( key ) ); } Value & ValueInternalMap::resolveReference( const char *key, bool isStatic ) { HashKey hashedKey = hash( key ); if ( bucketsSize_ ) { BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink **previous = 0; BucketIndex index; for ( ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; previous = ¤t->next_, current = current->next_ ) { for ( index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return setNewItem( key, isStatic, current, index ); if ( strcmp( key, current->keys_[index] ) == 0 ) return current->items_[index]; } } } reserveDelta( 1 ); return unsafeAdd( key, isStatic, hashedKey ); } void ValueInternalMap::remove( const char *key ) { HashKey hashedKey = hash( key ); if ( !bucketsSize_ ) return; BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( ValueInternalLink *link = &buckets_[bucketIndex]; link != 0; link = link->next_ ) { BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) return; if ( strcmp( key, link->keys_[index] ) == 0 ) { doActualRemove( link, index, bucketIndex ); return; } } } } void ValueInternalMap::doActualRemove( ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex ) { // find last item of the bucket and swap it with the 'removed' one. // set removed items flags to 'available'. // if last page only contains 'available' items, then desallocate it (it's empty) ValueInternalLink *&lastLink = getLastLinkInBucket( index ); BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 for ( ; lastItemIndex < ValueInternalLink::itemPerLink; ++lastItemIndex ) // may be optimized with dicotomic search { if ( lastLink->items_[lastItemIndex].isItemAvailable() ) break; } BucketIndex lastUsedIndex = lastItemIndex - 1; Value *valueToDelete = &link->items_[index]; Value *valueToPreserve = &lastLink->items_[lastUsedIndex]; if ( valueToDelete != valueToPreserve ) valueToDelete->swap( *valueToPreserve ); if ( lastUsedIndex == 0 ) // page is now empty { // remove it from bucket linked list and delete it. ValueInternalLink *linkPreviousToLast = lastLink->previous_; if ( linkPreviousToLast != 0 ) // can not deleted bucket link. { mapAllocator()->releaseMapLink( lastLink ); linkPreviousToLast->next_ = 0; lastLink = linkPreviousToLast; } } else { Value dummy; valueToPreserve->swap( dummy ); // restore deleted to default Value. valueToPreserve->setItemUsed( false ); } --itemCount_; } ValueInternalLink *& ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex ) { if ( bucketIndex == bucketsSize_ - 1 ) return tailLink_; ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_; if ( !previous ) previous = &buckets_[bucketIndex]; return previous; } Value & ValueInternalMap::setNewItem( const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index ) { char *duplicatedKey = valueAllocator()->makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); link->items_[index].setMemberNameIsStatic( isStatic ); return link->items_[index]; // items already default constructed. } Value & ValueInternalMap::unsafeAdd( const char *key, bool isStatic, HashKey hashedKey ) { JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." ); BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex ); ValueInternalLink *link = previousLink; BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) break; } if ( index == ValueInternalLink::itemPerLink ) // need to add a new page { ValueInternalLink *newLink = mapAllocator()->allocateMapLink(); index = 0; link->next_ = newLink; previousLink = newLink; link = newLink; } return setNewItem( key, isStatic, link, index ); } ValueInternalMap::HashKey ValueInternalMap::hash( const char *key ) const { HashKey hash = 0; while ( *key ) hash += *key++ * 37; return hash; } int ValueInternalMap::compare( const ValueInternalMap &other ) const { int sizeDiff( itemCount_ - other.itemCount_ ); if ( sizeDiff != 0 ) return sizeDiff; // Strict order guaranty is required. Compare all keys FIRST, then compare values. IteratorState it; IteratorState itEnd; makeBeginIterator( it ); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { if ( !other.find( key( it ) ) ) return 1; } // All keys are equals, let's compare values makeBeginIterator( it ); for ( ; !equals(it,itEnd); increment(it) ) { const Value *otherValue = other.find( key( it ) ); int valueDiff = value(it).compare( *otherValue ); if ( valueDiff != 0 ) return valueDiff; } return 0; } void ValueInternalMap::makeBeginIterator( IteratorState &it ) const { it.map_ = const_cast<ValueInternalMap *>( this ); it.bucketIndex_ = 0; it.itemIndex_ = 0; it.link_ = buckets_; } void ValueInternalMap::makeEndIterator( IteratorState &it ) const { it.map_ = const_cast<ValueInternalMap *>( this ); it.bucketIndex_ = bucketsSize_; it.itemIndex_ = 0; it.link_ = 0; } bool ValueInternalMap::equals( const IteratorState &x, const IteratorState &other ) { return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; } void ValueInternalMap::incrementBucket( IteratorState &iterator ) { ++iterator.bucketIndex_; JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_, "ValueInternalMap::increment(): attempting to iterate beyond end." ); if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ ) iterator.link_ = 0; else iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); iterator.itemIndex_ = 0; } void ValueInternalMap::increment( IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." ); ++iterator.itemIndex_; if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink ) { JSON_ASSERT_MESSAGE( iterator.link_ != 0, "ValueInternalMap::increment(): attempting to iterate beyond end." ); iterator.link_ = iterator.link_->next_; if ( iterator.link_ == 0 ) incrementBucket( iterator ); } else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() ) { incrementBucket( iterator ); } } void ValueInternalMap::decrement( IteratorState &iterator ) { if ( iterator.itemIndex_ == 0 ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." ); if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] ) { JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." ); --(iterator.bucketIndex_); } iterator.link_ = iterator.link_->previous_; iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; } } const char * ValueInternalMap::key( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->keys_[iterator.itemIndex_]; } const char * ValueInternalMap::key( const IteratorState &iterator, bool &isStatic ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); return iterator.link_->keys_[iterator.itemIndex_]; } Value & ValueInternalMap::value( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->items_[iterator.itemIndex_]; } int ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) { int offset = 0; IteratorState it = x; while ( !equals( it, y ) ) increment( it ); return offset; } |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:51:25
|
Update of /cvsroot/cppunit/cppunit2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24232 Modified Files: sconstruct Log Message: - opentest library has been moved to its own project: http://www.sf.net/projects/opentest/ Index: sconstruct =================================================================== RCS file: /cvsroot/cppunit/cppunit2/sconstruct,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** sconstruct 5 Jun 2006 14:03:23 -0000 1.28 --- sconstruct 1 Sep 2006 19:51:22 -0000 1.29 *************** *** 92,96 **** env['DIST_DIR'] = DIST_DIR env_testing = env.Copy( ) ! env_testing.Append( LIBS = ['cpput','opentest','cpptl'] ) env_cpptl = env.Copy() --- 92,96 ---- env['DIST_DIR'] = DIST_DIR env_testing = env.Copy( ) ! env_testing.Append( LIBS = ['cpput','cpptl'] ) env_cpptl = env.Copy() *************** *** 150,156 **** buildProjectInDirectory( 'src/cpput' ) buildProjectInDirectory( 'src/cpptl' ) - buildProjectInDirectory( 'src/opentest' ) buildProjectInDirectory( 'src/cpputtest' ) - buildProjectInDirectory( 'src/opentesttest' ) buildProjectInDirectory( 'src/jsontestrunner' ) #buildProjectInDirectory( 'examples/input_based_test' ) --- 150,154 ---- *************** *** 160,165 **** buildProjectInDirectory( 'examples/log_demo' ) buildProjectInDirectory( 'examples/stringize_demo' ) ! buildProjectInDirectory( 'examples/opentest_demo' ) #buildProjectInDirectory( 'src/qttestdriver' ) - buildProjectInDirectory( 'test/shmem_test' ) buildProjectInDirectory( 'doc' ) --- 158,162 ---- buildProjectInDirectory( 'examples/log_demo' ) buildProjectInDirectory( 'examples/stringize_demo' ) ! ##buildProjectInDirectory( 'examples/opentest_demo' ) #buildProjectInDirectory( 'src/qttestdriver' ) buildProjectInDirectory( 'doc' ) |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:48:28
|
Update of /cvsroot/cppunit/cppunit2/src/cpptl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22940/src/cpptl Modified Files: json_reader.cpp json_value.cpp json_writer.cpp Log Message: - synchronized with lastest jsoncpp. Index: json_value.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpptl/json_value.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_value.cpp 5 Jun 2006 13:22:58 -0000 1.3 --- json_value.cpp 1 Sep 2006 19:48:11 -0000 1.4 *************** *** 5,11 **** #ifdef JSON_USE_CPPTL # include <cpptl/conststring.h> - # include <cpptl/enumerator.h> #endif #include <stddef.h> // size_t #define JSON_ASSERT_UNREACHABLE assert( false ) --- 5,13 ---- #ifdef JSON_USE_CPPTL # include <cpptl/conststring.h> [...1090 lines suppressed...] + if ( value_.map_ ) + { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator( it ); + return iterator( it ); + } + break; + #else case arrayValue: case objectValue: if ( value_.map_ ) return iterator( value_.map_->end() ); ! break; ! #endif default: ! break; } + return iterator(); } Index: json_reader.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpptl/json_reader.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_reader.cpp 5 Jun 2006 13:22:58 -0000 1.3 --- json_reader.cpp 1 Sep 2006 19:48:11 -0000 1.4 *************** *** 584,588 **** Char c = *current++; unicode *= 16; ! if ( c >=0 && c <= 9 ) unicode += c - '0'; else if ( c >= 'a' && c <= 'f' ) --- 584,588 ---- Char c = *current++; unicode *= 16; ! if ( c >= '0' && c <= '9' ) unicode += c - '0'; else if ( c >= 'a' && c <= 'f' ) Index: json_writer.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpptl/json_writer.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_writer.cpp 3 Mar 2006 07:54:55 -0000 1.3 --- json_writer.cpp 1 Sep 2006 19:48:11 -0000 1.4 *************** *** 14,18 **** { *--current = 0; - char *end = current; do { --- 14,17 ---- |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:48:25
|
Update of /cvsroot/cppunit/cppunit2/scons-tools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22940/scons-tools Modified Files: doxygen.py Log Message: - synchronized with lastest jsoncpp. Index: doxygen.py =================================================================== RCS file: /cvsroot/cppunit/cppunit2/scons-tools/doxygen.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** doxygen.py 5 Jun 2006 13:22:58 -0000 1.1 --- doxygen.py 1 Sep 2006 19:48:11 -0000 1.2 *************** *** 1,2 **** --- 1,6 ---- + # Big issue: + # emitter depends on doxyfile which is generated from doxyfile.in. + # build fails after cleaning and relaunching the build. + import os import os.path *************** *** 100,107 **** exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) for node in data.get("INPUT", []): ! if os.path.isfile(node): ! sources.add(node) ! elif os.path.isdir(node): if recursive: for root, dirs, files in os.walk(node): --- 104,117 ---- exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) + doxyfile_dir = str( node.dir ) + + ## print 'running from', os.getcwd() for node in data.get("INPUT", []): ! node_real_path = os.path.normpath( os.path.join( doxyfile_dir, node ) ) ! if os.path.isfile(node_real_path): ! ## print str(node), 'is a file' ! sources.append(node) ! elif os.path.isdir(node_real_path): ! ## print str(node), 'is a directory' if recursive: for root, dirs, files in os.walk(node): *************** *** 114,120 **** if pattern_check and not exclude_check: sources.append(filename) else: for pattern in file_patterns: ! sources.extend(glob.glob("/".join([node, pattern]))) sources = map( lambda path: env.File(path), sources ) return sources --- 124,133 ---- if pattern_check and not exclude_check: sources.append(filename) + ## print ' adding source', os.path.abspath( filename ) else: for pattern in file_patterns: ! sources.extend(glob.glob(os.path.join( node, pattern))) ! ## else: ! ## print str(node), 'is neither a file nor a directory' sources = map( lambda path: env.File(path), sources ) return sources *************** *** 136,139 **** --- 149,153 ---- } + ## print '#### DoxyEmitter:', source[0].abspath, os.path.exists( source[0].abspath ) data = DoxyfileParse(source[0].get_contents()) *************** *** 152,156 **** # set up cleaning stuff for node in targets: ! env.Clean(node, node) return (targets, source) --- 166,171 ---- # set up cleaning stuff for node in targets: ! clean_cmd = env.Clean(node, node) ! env.Depends( clean_cmd, source ) return (targets, source) *************** *** 168,172 **** doxyfile_builder = env.Builder( ! action = env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}"), emitter = DoxyEmitter, target_factory = env.fs.Entry, --- 183,188 ---- doxyfile_builder = env.Builder( ! action = env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}", ! varlist=['$SOURCES']), emitter = DoxyEmitter, target_factory = env.fs.Entry, |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:48:16
|
Update of /cvsroot/cppunit/cppunit2/include/json In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22940/include/json Modified Files: config.h forwards.h value.h Log Message: - synchronized with lastest jsoncpp. Index: config.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/config.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.h 5 Jun 2006 13:22:58 -0000 1.2 --- config.h 1 Sep 2006 19:48:11 -0000 1.3 *************** *** 7,11 **** --- 7,22 ---- /// If defined, indicates that json may leverage CppTL library //# define JSON_USE_CPPTL 1 + /// If defined, indicates that cpptl vector based map should be used instead of std::map + /// as Value container. //# define JSON_USE_CPPTL_SMALLMAP 1 + /// If defined, indicates that Json specific container should be used + /// (hash table & simple deque container with customizable allocator). + /// THIS FEATURE IS STILL EXPERIMENTAL! + //# define JSON_VALUE_USE_INTERNAL_MAP 1 + /// Force usage of standard new/malloc based allocator instead of memory pool based allocator. + /// The memory pools allocator used optimization (initializing Value and ValueInternalLink + /// as if it was a POD) that may cause some validation tool to report errors. + /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. + //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 Index: value.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/value.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** value.h 5 Jun 2006 13:22:58 -0000 1.2 --- value.h 1 Sep 2006 19:48:11 -0000 1.3 *************** *** 15,18 **** --- 15,20 ---- # endif + /** \brief JSON (JavaScript Object Notation). + */ namespace Json { *************** *** 39,46 **** }; ! # ifdef JSON_USE_CPPTL ! typedef CppTL::AnyEnumerator<const char *> EnumMemberNames; ! typedef CppTL::AnyEnumerator<const Value &> EnumValues; ! # endif /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value. --- 41,84 ---- }; ! //# ifdef JSON_USE_CPPTL ! // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames; ! // typedef CppTL::AnyEnumerator<const Value &> EnumValues; ! //# endif ! ! /** \brief Lightweight wrapper to tag static string. ! * ! * Value constructor and objectValue member assignement takes advantage of the ! * StaticString and avoid the cost of string duplication when storing the ! * string or the member name. ! * ! * Example of usage: ! * \code ! * Json::Value aValue( StaticString("some text") ); ! * Json::Value object; ! * static const StaticString code("code"); ! * object[code] = 1234; ! * \endcode ! */ ! class JSON_API StaticString ! { ! public: ! explicit StaticString( const char *czstring ) ! : str_( czstring ) ! { ! } ! ! operator const char *() const ! { ! return str_; ! } ! ! const char *c_str() const ! { ! return str_; ! } ! ! private: ! const char *str_; ! }; /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value. *************** *** 73,76 **** --- 111,119 ---- class JSON_API Value { + friend class ValueIteratorBase; + # ifdef JSON_VALUE_USE_INTERNAL_MAP + friend class ValueInternalLink; + friend class ValueInternalMap; + # endif public: typedef std::vector<std::string> Members; *************** *** 79,82 **** --- 122,126 ---- typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; + typedef UInt ArrayIndex; static const Value null; *************** *** 84,89 **** static const Int maxInt; static const UInt maxUInt; - private: class CZString { --- 128,135 ---- static const Int maxInt; static const UInt maxUInt; + private: + #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + # ifndef JSON_VALUE_USE_INTERNAL_MAP class CZString { *************** *** 104,107 **** --- 150,154 ---- int index() const; const char *c_str() const; + bool isStaticString() const; private: void swap( CZString &other ); *************** *** 111,119 **** public: ! # ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map<CZString, Value> ObjectValues; ! # else typedef CppTL::SmallMap<CZString, Value> ObjectValues; ! # endif public: --- 158,168 ---- public: ! # ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map<CZString, Value> ObjectValues; ! # else typedef CppTL::SmallMap<CZString, Value> ObjectValues; ! # endif // ifndef JSON_USE_CPPTL_SMALLMAP ! # endif // ifndef JSON_VALUE_USE_INTERNAL_MAP ! #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION public: *************** *** 123,126 **** --- 172,185 ---- Value( double value ); Value( const char *value ); + /** \brief Constructs a value from a static string. + * Like other value string constructor but do not duplicate the string for + * internal storage. The given string must remain alive after the call to this + * constructor. + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * \endcode + */ + Value( const StaticString &value ); Value( const std::string &value ); # ifdef JSON_USE_CPPTL *************** *** 195,210 **** Value &append( const Value &value ); ! // Access an object value by name, create a null member if it does not exist. Value &operator[]( const char *key ); ! // Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const char *key ) const; ! // Access an object value by name, create a null member if it does not exist. Value &operator[]( const std::string &key ); ! // Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const std::string &key ) const; # ifdef JSON_USE_CPPTL ! // Access an object value by name, create a null member if it does not exist. Value &operator[]( const CppTL::ConstString &key ); ! // Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const CppTL::ConstString &key ) const; # endif --- 254,280 ---- Value &append( const Value &value ); ! /// Access an object value by name, create a null member if it does not exist. Value &operator[]( const char *key ); ! /// Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const char *key ) const; ! /// Access an object value by name, create a null member if it does not exist. Value &operator[]( const std::string &key ); ! /// Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const std::string &key ) const; + /** \brief Access an object value by name, create a null member if it does not exist. + * If the object as no entry for that name, then the member name used to store + * the new entry is not duplicated. + * Example of use: + * \code + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + Value &operator[]( const StaticString &key ); # ifdef JSON_USE_CPPTL ! /// Access an object value by name, create a null member if it does not exist. Value &operator[]( const CppTL::ConstString &key ); ! /// Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const CppTL::ConstString &key ) const; # endif *************** *** 232,239 **** Members getMemberNames() const; ! # ifdef JSON_USE_CPPTL ! EnumMemberNames enumMemberNames() const; ! EnumValues enumValues() const; ! # endif void setComment( const char *comment, --- 302,309 ---- Members getMemberNames() const; ! //# ifdef JSON_USE_CPPTL ! // EnumMemberNames enumMemberNames() const; ! // EnumValues enumValues() const; ! //# endif void setComment( const char *comment, *************** *** 253,256 **** --- 323,352 ---- private: + Value &resolveReference( const char *key, + bool isStatic ); + + # ifdef JSON_VALUE_USE_INTERNAL_MAP + inline bool isItemAvailable() const + { + return itemIsUsed_ == 0; + } + + inline void setItemUsed( bool isUsed = true ) + { + itemIsUsed_ = isUsed ? 1 : 0; + } + + inline bool isMemberNameStatic() const + { + return memberNameIsStatic_ == 0; + } + + inline void setMemberNameIsStatic( bool isStatic ) + { + memberNameIsStatic_ = isStatic ? 1 : 0; + } + # endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP + + private: struct CommentInfo { *************** *** 263,274 **** }; ! struct MemberNamesTransform ! { ! typedef const char *result_type; ! const char *operator()( const CZString &name ) const ! { ! return name.c_str(); ! } ! }; union ValueHolder --- 359,370 ---- }; ! //struct MemberNamesTransform ! //{ ! // typedef const char *result_type; ! // const char *operator()( const CZString &name ) const ! // { ! // return name.c_str(); ! // } ! //}; union ValueHolder *************** *** 279,290 **** bool bool_; char *string_; ObjectValues *map_; } value_; ValueType type_ : 8; ! bool allocated_ : 1; CommentInfo *comments_; }; /** \brief Experimental and untested: base class for Value iterators. * --- 375,809 ---- bool bool_; char *string_; + # ifdef JSON_VALUE_USE_INTERNAL_MAP + ValueInternalArray *array_; + ValueInternalMap *map_; + #else ObjectValues *map_; + # endif } value_; ValueType type_ : 8; ! int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. ! # ifdef JSON_VALUE_USE_INTERNAL_MAP ! unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. ! int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. ! # endif CommentInfo *comments_; }; + /** \brief Experimental and untested: represents an element of the "path" to access a node. + */ + class PathArgument + { + public: + friend class Path; + + PathArgument(); + PathArgument( Value::UInt index ); + PathArgument( const char *key ); + PathArgument( const std::string &key ); + + private: + enum Kind + { + kindNone = 0, + kindIndex, + kindKey + }; + std::string key_; + Value::UInt index_; + Kind kind_; + }; + + /** \brief Experimental and untested: represents a "path" to access a node. + * + * Syntax: + * - "." => root node + * - ".[n]" => elements at index 'n' of root node (an array value) + * - ".name" => member named 'name' of root node (an object value) + * - ".name1.name2.name3" + * - ".[0][1][2].name1[3]" + * - ".%" => member name is provided as parameter + * - ".[%]" => index is provied as parameter + */ + class Path + { + public: + Path( const std::string &path, + const PathArgument &a1 = PathArgument(), + const PathArgument &a2 = PathArgument(), + const PathArgument &a3 = PathArgument(), + const PathArgument &a4 = PathArgument(), + const PathArgument &a5 = PathArgument() ); + + const Value &resolve( const Value &root ) const; + Value resolve( const Value &root, + const Value &defaultValue ) const; + /// Creates the "path" to access the specified node and returns a reference on the node. + Value &make( Value &root ) const; + + private: + typedef std::vector<const PathArgument *> InArgs; + typedef std::vector<PathArgument> Args; + + void makePath( const std::string &path, + const InArgs &in ); + void addPathInArg( const std::string &path, + const InArgs &in, + InArgs::const_iterator &itInArg, + PathArgument::Kind kind ); + void invalidPath( const std::string &path, + int location ); + + Args args_; + }; + + /** \brief Allocator to customize member name and string value memory management done by Value. + * + * - makeMemberName() and releaseMemberName() are called to respectively duplicate and + * free an Json::objectValue member name. + * - duplicateStringValue() and releaseStringValue() are called similarly to + * duplicate and free a Json::stringValue value. + */ + class ValueAllocator + { + public: + enum { unknown = -1 }; + + virtual ~ValueAllocator(); + + virtual char *makeMemberName( const char *memberName ) = 0; + virtual void releaseMemberName( char *memberName ) = 0; + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) = 0; + virtual void releaseStringValue( char *value ) = 0; + }; + + #ifdef JSON_VALUE_USE_INTERNAL_MAP + /** \brief Allocator to customize Value internal map. + * Below is an example of a simple implementation (default implementation actually + * use memory pool for speed). + * \code + class DefaultValueMapAllocator : public ValueMapAllocator + { + public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() + { + return new ValueInternalMap(); + } + + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) + { + return new ValueInternalMap( other ); + } + + virtual void destructMap( ValueInternalMap *map ) + { + delete map; + } + + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) + { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets( ValueInternalLink *links ) + { + delete [] links; + } + + virtual ValueInternalLink *allocateMapLink() + { + return new ValueInternalLink(); + } + + virtual void releaseMapLink( ValueInternalLink *link ) + { + delete link; + } + }; + * \endcode + */ + class JSON_API ValueMapAllocator + { + public: + virtual ~ValueMapAllocator(); + virtual ValueInternalMap *newMap() = 0; + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0; + virtual void destructMap( ValueInternalMap *map ) = 0; + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0; + virtual void releaseMapBuckets( ValueInternalLink *links ) = 0; + virtual ValueInternalLink *allocateMapLink() = 0; + virtual void releaseMapLink( ValueInternalLink *link ) = 0; + }; + + /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). + * \internal previous_ & next_ allows for bidirectional traversal. + */ + class JSON_API ValueInternalLink + { + public: + enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. + enum InternalFlags { + flagAvailable = 0, + flagUsed = 1 + }; + + ValueInternalLink(); + + ~ValueInternalLink(); + + Value items_[itemPerLink]; + char *keys_[itemPerLink]; + ValueInternalLink *previous_; + ValueInternalLink *next_; + }; + + + /** \brief A linked page based hash-table implementation used internally by Value. + * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked + * list in each bucket to handle collision. There is an addional twist in that + * each node of the collision linked list is a page containing a fixed amount of + * value. This provides a better compromise between memory usage and speed. + * + * Each bucket is made up of a chained list of ValueInternalLink. The last + * link of a given bucket can be found in the 'previous_' field of the following bucket. + * The last link of the last bucket is stored in tailLink_ as it has no following bucket. + * Only the last link of a bucket may contains 'available' item. The last link always + * contains at least one element unless is it the bucket one very first link. + */ + class JSON_API ValueInternalMap + { + friend class ValueIteratorBase; + friend class Value; + public: + typedef unsigned int HashKey; + typedef unsigned int BucketIndex; + + # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState + { + ValueInternalMap *map_; + ValueInternalLink *link_; + BucketIndex itemIndex_; + BucketIndex bucketIndex_; + }; + # endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalMap(); + ValueInternalMap( const ValueInternalMap &other ); + ValueInternalMap &operator =( const ValueInternalMap &other ); + ~ValueInternalMap(); + + void swap( ValueInternalMap &other ); + + BucketIndex size() const; + + void clear(); + + bool reserveDelta( BucketIndex growth ); + + bool reserve( BucketIndex newItemCount ); + + const Value *find( const char *key ) const; + + Value *find( const char *key ); + + Value &resolveReference( const char *key, + bool isStatic ); + + void remove( const char *key ); + + void doActualRemove( ValueInternalLink *link, + BucketIndex index, + BucketIndex bucketIndex ); + + ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex ); + + Value &setNewItem( const char *key, + bool isStatic, + ValueInternalLink *link, + BucketIndex index ); + + Value &unsafeAdd( const char *key, + bool isStatic, + HashKey hashedKey ); + + HashKey hash( const char *key ) const; + + int compare( const ValueInternalMap &other ) const; + + private: + void makeBeginIterator( IteratorState &it ) const; + void makeEndIterator( IteratorState &it ) const; + static bool equals( const IteratorState &x, const IteratorState &other ); + static void increment( IteratorState &iterator ); + static void incrementBucket( IteratorState &iterator ); + static void decrement( IteratorState &iterator ); + static const char *key( const IteratorState &iterator ); + static const char *key( const IteratorState &iterator, bool &isStatic ); + static Value &value( const IteratorState &iterator ); + static int distance( const IteratorState &x, const IteratorState &y ); + + private: + ValueInternalLink *buckets_; + ValueInternalLink *tailLink_; + BucketIndex bucketsSize_; + BucketIndex itemCount_; + }; + + /** \brief A simplified deque implementation used internally by Value. + * \internal + * It is based on a list of fixed "page", each page contains a fixed number of items. + * Instead of using a linked-list, a array of pointer is used for fast item look-up. + * Look-up for an element is as follow: + * - compute page index: pageIndex = itemIndex / itemsPerPage + * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] + * + * Insertion is amortized constant time (only the array containing the index of pointers + * need to be reallocated when items are appended). + */ + class JSON_API ValueInternalArray + { + friend class Value; + friend class ValueIteratorBase; + public: + enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. + typedef Value::ArrayIndex ArrayIndex; + typedef unsigned int PageIndex; + + # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState // Must be a POD + { + ValueInternalArray *array_; + Value **currentPageIndex_; + unsigned int currentItemIndex_; + }; + # endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalArray(); + ValueInternalArray( const ValueInternalArray &other ); + ValueInternalArray &operator =( const ValueInternalArray &other ); + ~ValueInternalArray(); + void swap( ValueInternalArray &other ); + + void clear(); + void resize( ArrayIndex newSize ); + + Value &resolveReference( ArrayIndex index ); + + Value *find( ArrayIndex index ) const; + + ArrayIndex size() const; + + int compare( const ValueInternalArray &other ) const; + + private: + static bool equals( const IteratorState &x, const IteratorState &other ); + static void increment( IteratorState &iterator ); + static void decrement( IteratorState &iterator ); + static Value &dereference( const IteratorState &iterator ); + static Value &unsafeDereference( const IteratorState &iterator ); + static int distance( const IteratorState &x, const IteratorState &y ); + static ArrayIndex indexOf( const IteratorState &iterator ); + void makeBeginIterator( IteratorState &it ) const; + void makeEndIterator( IteratorState &it ) const; + void makeIterator( IteratorState &it, ArrayIndex index ) const; + + void makeIndexValid( ArrayIndex index ); + + Value **pages_; + ArrayIndex size_; + PageIndex pageCount_; + }; + + /** \brief Allocator to customize Value internal array. + * Below is an example of a simple implementation (actual implementation use + * memory pool). + \code + class DefaultValueArrayAllocator : public ValueArrayAllocator + { + public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() + { + } + + virtual ValueInternalArray *newArray() + { + return new ValueInternalArray(); + } + + virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) + { + return new ValueInternalArray( other ); + } + + virtual void destruct( ValueInternalArray *array ) + { + delete array; + } + + virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount ) + { + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast<Value **>( newIndexes ); + } + virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) + { + if ( indexes ) + free( indexes ); + } + + virtual Value *allocateArrayPage() + { + return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); + } + + virtual void releaseArrayPage( Value *value ) + { + if ( value ) + free( value ); + } + }; + \endcode + */ + class JSON_API ValueArrayAllocator + { + public: + virtual ~ValueArrayAllocator(); + virtual ValueInternalArray *newArray() = 0; + virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0; + virtual void destructArray( ValueInternalArray *array ) = 0; + /** \brief Reallocate array page index. + * Reallocates an array of pointer on each page. + * \param indexes [input] pointer on the current index. May be \c NULL. + * [output] pointer on the new index of at least + * \a minNewIndexCount pages. + * \param indexCount [input] current number of pages in the index. + * [output] number of page the reallocated index can handle. + * \b MUST be >= \a minNewIndexCount. + * \param minNewIndexCount Minimum number of page the new index must be able to + * handle. + */ + virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex &indexCount, + ValueInternalArray::PageIndex minNewIndexCount ) = 0; + virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) = 0; + virtual Value *allocateArrayPage() = 0; + virtual void releaseArrayPage( Value *value ) = 0; + }; + #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + + /** \brief Experimental and untested: base class for Value iterators. * *************** *** 298,302 **** --- 817,826 ---- ValueIteratorBase(); + #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIteratorBase( const Value::ObjectValues::iterator ¤t ); + #else + ValueIteratorBase( const ValueInternalArray::IteratorState &state ); + ValueIteratorBase( const ValueInternalMap::IteratorState &state ); + #endif bool operator ==( const SelfType &other ) const *************** *** 315,318 **** --- 839,851 ---- } + /// Returns either the index or the member name of the referenced value as a Value. + Value key() const; + + /// Returns the index of the referenced Value. -1 if it is not an arrayValue. + Value::UInt index() const; + + /// Returns the member name of the referenced Value. "" if it is not an objectValue. + const char *memberName() const; + protected: Value &deref() const; *************** *** 329,333 **** --- 862,875 ---- private: + #ifndef JSON_VALUE_USE_INTERNAL_MAP Value::ObjectValues::iterator current_; + #else + union + { + ValueInternalArray::IteratorState array_; + ValueInternalMap::IteratorState map_; + } iterator_; + bool isArray_; + #endif }; *************** *** 337,340 **** --- 879,883 ---- class ValueConstIterator : public ValueIteratorBase { + friend class Value; public: typedef unsigned int size_t; *************** *** 345,351 **** --- 888,901 ---- ValueConstIterator(); + private: /*! \internal Use by Value to create an iterator. */ + #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t ); + #else + ValueConstIterator( const ValueInternalArray::IteratorState &state ); + ValueConstIterator( const ValueInternalMap::IteratorState &state ); + #endif + public: SelfType &operator =( const ValueIteratorBase &other ); *************** *** 387,390 **** --- 937,941 ---- class ValueIterator : public ValueIteratorBase { + friend class Value; public: typedef unsigned int size_t; *************** *** 397,403 **** --- 948,961 ---- ValueIterator( const ValueConstIterator &other ); ValueIterator( const ValueIterator &other ); + private: /*! \internal Use by Value to create an iterator. */ + #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIterator( const Value::ObjectValues::iterator ¤t ); + #else + ValueIterator( const ValueInternalArray::IteratorState &state ); + ValueIterator( const ValueInternalMap::IteratorState &state ); + #endif + public: SelfType &operator =( const SelfType &other ); *************** *** 436,507 **** - - /** \brief Experimental and untested: represents an element of the "path" to access a node. - */ - class PathArgument - { - public: - friend class Path; - - PathArgument(); - PathArgument( Value::UInt index ); - PathArgument( const char *key ); - PathArgument( const std::string &key ); - - private: - enum Kind - { - kindNone = 0, - kindIndex, - kindKey - }; - std::string key_; - Value::UInt index_; - Kind kind_; - }; - - /** \brief Experimental and untested: represents a "path" to access a node. - * - * Syntax: - * - "." => root node - * - ".[n]" => elements at index 'n' of root node (an array value) - * - ".name" => member named 'name' of root node (an object value) - * - ".name1.name2.name3" - * - ".[0][1][2].name1[3]" - * - ".%" => member name is provided as parameter - * - ".[%]" => index is provied as parameter - */ - class Path - { - public: - Path( const std::string &path, - const PathArgument &a1 = PathArgument(), - const PathArgument &a2 = PathArgument(), - const PathArgument &a3 = PathArgument(), - const PathArgument &a4 = PathArgument(), - const PathArgument &a5 = PathArgument() ); - - const Value &resolve( const Value &root ) const; - Value resolve( const Value &root, - const Value &defaultValue ) const; - /// Creates the "path" to access the specified node and returns a reference on the node. - Value &make( Value &root ) const; - - private: - typedef std::vector<const PathArgument *> InArgs; - typedef std::vector<PathArgument> Args; - - void makePath( const std::string &path, - const InArgs &in ); - void addPathInArg( const std::string &path, - const InArgs &in, - InArgs::const_iterator &itInArg, - PathArgument::Kind kind ); - void invalidPath( const std::string &path, - int location ); - - Args args_; - }; - } // namespace Json --- 994,997 ---- Index: forwards.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/json/forwards.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** forwards.h 5 Jun 2006 13:22:58 -0000 1.2 --- forwards.h 1 Sep 2006 19:48:11 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- // value.h + class StaticString; class Path; class PathArgument; *************** *** 17,20 **** --- 18,28 ---- class ValueIterator; class ValueConstIterator; + #ifdef JSON_VALUE_USE_INTERNAL_MAP + class ValueAllocator; + class ValueMapAllocator; + class ValueInternalLink; + class ValueInternalArray; + class ValueInternalMap; + #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP } // namespace Json |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:48:14
|
Update of /cvsroot/cppunit/cppunit2/src/jsontestrunner In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22940/src/jsontestrunner Modified Files: main.cpp Log Message: - synchronized with lastest jsoncpp. Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/jsontestrunner/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 5 Jun 2006 13:22:58 -0000 1.1 --- main.cpp 1 Sep 2006 19:48:11 -0000 1.2 *************** *** 1,4 **** #include <json/json.h> ! //#include <stdexcept> #include <stdio.h> --- 1,4 ---- #include <json/json.h> ! #include <algorithm> // sort #include <stdio.h> *************** *** 66,69 **** --- 66,70 ---- fprintf( fout, "%s={}\n", path.c_str() ); Json::Value::Members members( value.getMemberNames() ); + std::sort( members.begin(), members.end() ); std::string suffix = *(path.end()-1) == '.' ? "" : "."; for ( Json::Value::Members::iterator it = members.begin(); |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:46:16
|
Update of /cvsroot/cppunit/cppunit2/devtools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22225/devtools Modified Files: syncwithjsoncpp.py Log Message: - synchronize with clean checkout instead of dev dir. Index: syncwithjsoncpp.py =================================================================== RCS file: /cvsroot/cppunit/cppunit2/devtools/syncwithjsoncpp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** syncwithjsoncpp.py 1 Sep 2006 19:31:32 -0000 1.2 --- syncwithjsoncpp.py 1 Sep 2006 19:46:10 -0000 1.3 *************** *** 16,20 **** } ! jsoncpp_dir = '../../jsoncpp' cppunit2_dir = '..' --- 16,20 ---- } ! jsoncpp_dir = '../../jsoncpp.svn' cppunit2_dir = '..' *************** *** 28,32 **** if os.path.isdir( source_dir ): print 'Analysing', source_dir ! for ext in 'cpp h py'.split(): ext = '*.' + ext source_files = glob.glob(os.path.join(source_dir, ext)) --- 28,32 ---- if os.path.isdir( source_dir ): print 'Analysing', source_dir ! for ext in 'cpp h py inl'.split(): ext = '*.' + ext source_files = glob.glob(os.path.join(source_dir, ext)) |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:31:35
|
Update of /cvsroot/cppunit/cppunit2/devtools In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16670/devtools Modified Files: syncwithjsoncpp.py Log Message: - fixed bug (failure when target file did not exist). Index: syncwithjsoncpp.py =================================================================== RCS file: /cvsroot/cppunit/cppunit2/devtools/syncwithjsoncpp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** syncwithjsoncpp.py 5 Jun 2006 13:22:58 -0000 1.1 --- syncwithjsoncpp.py 1 Sep 2006 19:31:32 -0000 1.2 *************** *** 34,42 **** dest_path = os.path.join( target_dir, os.path.split(source)[1] ) print ' => Copying %s to %s' % (source,dest_path) ! os.unlink( dest_path ) shutil.copyfile( source, dest_path ) else: print 'Direct file copy %s to %s' % (source_dir,target_dir) ! os.unlink( target_dir ) shutil.copyfile( source_dir, target_dir ) --- 34,44 ---- dest_path = os.path.join( target_dir, os.path.split(source)[1] ) print ' => Copying %s to %s' % (source,dest_path) ! if os.path.exists( dest_path ): ! os.unlink( dest_path ) shutil.copyfile( source, dest_path ) else: print 'Direct file copy %s to %s' % (source_dir,target_dir) ! if os.path.exists( target_dir ): ! os.unlink( target_dir ) shutil.copyfile( source_dir, target_dir ) |
Update of /cvsroot/cppunit/cppunit2/src/opentest In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15145/src/opentest Removed Files: SConscript interfaces.cpp obsolete_texttestdriver.cpp remoteinterfaces.cpp serializer.cpp sharedmemorytransport.cpp Log Message: - opentest library has been moved to its own project: http://www.sf.net/projects/opentest/ --- obsolete_texttestdriver.cpp DELETED --- --- SConscript DELETED --- --- sharedmemorytransport.cpp DELETED --- --- remoteinterfaces.cpp DELETED --- --- serializer.cpp DELETED --- --- interfaces.cpp DELETED --- |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:28:04
|
Update of /cvsroot/cppunit/cppunit2/test/shmem_test In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15145/test/shmem_test Removed Files: SConscript main.cpp Log Message: - opentest library has been moved to its own project: http://www.sf.net/projects/opentest/ --- main.cpp DELETED --- --- SConscript DELETED --- |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:28:03
|
Update of /cvsroot/cppunit/cppunit2/makefiles/vs71 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15145/makefiles/vs71 Modified Files: cppunit2.sln examples_opentest_demo.vcproj Removed Files: opentest_test.vcproj Log Message: - opentest library has been moved to its own project: http://www.sf.net/projects/opentest/ Index: examples_opentest_demo.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/makefiles/vs71/examples_opentest_demo.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** examples_opentest_demo.vcproj 7 Mar 2006 23:02:55 -0000 1.2 --- examples_opentest_demo.vcproj 1 Sep 2006 19:27:59 -0000 1.3 *************** *** 121,125 **** --- 121,152 ---- <Files> <File + RelativePath="..\..\examples\opentest_demo\main.cpp"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + ObjectFile="$(IntDir)/$(InputName)1.obj"/> + </FileConfiguration> + </File> + <File RelativePath="..\..\test\shmem_test\main.cpp"> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="TRUE"> + <Tool + Name="VCCLCompilerTool"/> + </FileConfiguration> </File> </Files> Index: cppunit2.sln =================================================================== RCS file: /cvsroot/cppunit/cppunit2/makefiles/vs71/cppunit2.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cppunit2.sln 11 Dec 2005 17:16:08 -0000 1.3 --- cppunit2.sln 1 Sep 2006 19:27:58 -0000 1.4 *************** *** 14,37 **** EndProjectSection EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opentest_lib", "opentest_lib.vcproj", "{6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opentest_test", "opentest_test.vcproj", "{FA200A48-CBCD-4A3D-8CA4-5F083610B696}" - ProjectSection(ProjectDependencies) = postProject - {79273A0D-700E-4AFA-B7F2-14D4CC325521} = {79273A0D-700E-4AFA-B7F2-14D4CC325521} - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D} = {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D} - {4037D758-74CD-412B-B67C-BA3CA89FEF28} = {4037D758-74CD-412B-B67C-BA3CA89FEF28} - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "examples_opentest_demo", "examples_opentest_demo.vcproj", "{544D6860-E43B-4677-81B6-1FD70687B99D}" - ProjectSection(ProjectDependencies) = postProject - {79273A0D-700E-4AFA-B7F2-14D4CC325521} = {79273A0D-700E-4AFA-B7F2-14D4CC325521} - {2506991E-13CA-49C9-8686-AACDE35C21B6} = {2506991E-13CA-49C9-8686-AACDE35C21B6} - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D} = {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D} - {FA200A48-CBCD-4A3D-8CA4-5F083610B696} = {FA200A48-CBCD-4A3D-8CA4-5F083610B696} - {4037D758-74CD-412B-B67C-BA3CA89FEF28} = {4037D758-74CD-412B-B67C-BA3CA89FEF28} - EndProjectSection - EndProject Global GlobalSection(SolutionConfiguration) = preSolution --- 14,17 ---- *************** *** 59,80 **** {2506991E-13CA-49C9-8686-AACDE35C21B6}.Release.ActiveCfg = Release|Win32 {2506991E-13CA-49C9-8686-AACDE35C21B6}.Release.Build.0 = Release|Win32 - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}.Debug.ActiveCfg = Debug|Win32 - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}.Debug.Build.0 = Debug|Win32 - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}.dummy.ActiveCfg = Debug|Win32 - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}.dummy.Build.0 = Debug|Win32 - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}.Release.ActiveCfg = Release|Win32 - {6F7EEF30-F58C-4AEF-8406-AAA16D6D384D}.Release.Build.0 = Release|Win32 - {FA200A48-CBCD-4A3D-8CA4-5F083610B696}.Debug.ActiveCfg = Debug|Win32 - {FA200A48-CBCD-4A3D-8CA4-5F083610B696}.Debug.Build.0 = Debug|Win32 - {FA200A48-CBCD-4A3D-8CA4-5F083610B696}.dummy.ActiveCfg = Debug|Win32 - {FA200A48-CBCD-4A3D-8CA4-5F083610B696}.dummy.Build.0 = Debug|Win32 - {FA200A48-CBCD-4A3D-8CA4-5F083610B696}.Release.ActiveCfg = Release|Win32 - {FA200A48-CBCD-4A3D-8CA4-5F083610B696}.Release.Build.0 = Release|Win32 - {544D6860-E43B-4677-81B6-1FD70687B99D}.Debug.ActiveCfg = Debug|Win32 - {544D6860-E43B-4677-81B6-1FD70687B99D}.Debug.Build.0 = Debug|Win32 - {544D6860-E43B-4677-81B6-1FD70687B99D}.dummy.ActiveCfg = Debug|Win32 - {544D6860-E43B-4677-81B6-1FD70687B99D}.dummy.Build.0 = Debug|Win32 - {544D6860-E43B-4677-81B6-1FD70687B99D}.Release.ActiveCfg = Release|Win32 - {544D6860-E43B-4677-81B6-1FD70687B99D}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution --- 39,42 ---- --- opentest_test.vcproj DELETED --- |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:28:03
|
Update of /cvsroot/cppunit/cppunit2/src/opentesttest In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15145/src/opentesttest Removed Files: .cvsignore SConscript main.cpp mockhelper.h packetstest.cpp packetstest.h remoteinterfacestest.cpp serializertest.cpp serializertest.h Log Message: - opentest library has been moved to its own project: http://www.sf.net/projects/opentest/ --- .cvsignore DELETED --- --- main.cpp DELETED --- --- packetstest.cpp DELETED --- --- serializertest.h DELETED --- --- serializertest.cpp DELETED --- --- remoteinterfacestest.cpp DELETED --- --- packetstest.h DELETED --- --- mockhelper.h DELETED --- --- SConscript DELETED --- |
From: Baptiste L. <bl...@us...> - 2006-09-01 19:28:03
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15145/include/opentest Removed Files: config.h connector.h forwards.h interfaces.h remoteinterfaces.h resourcelist.h serializedtesttransport.h serializer.h sharedmemorytransport.h testplan.h texttestdriver.h Log Message: - opentest library has been moved to its own project: http://www.sf.net/projects/opentest/ --- config.h DELETED --- --- forwards.h DELETED --- --- texttestdriver.h DELETED --- --- connector.h DELETED --- --- serializedtesttransport.h DELETED --- --- resourcelist.h DELETED --- --- serializer.h DELETED --- --- interfaces.h DELETED --- --- remoteinterfaces.h DELETED --- --- sharedmemorytransport.h DELETED --- --- testplan.h DELETED --- |
From: Baptiste L. <bl...@us...> - 2006-07-28 05:54:05
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11512 Modified Files: ChangeLog Log Message: * src/msvc6/TesRunner/TestRunner.rc: * src/msvc6/testpluginrunner/TestPlugInRunner.rc: Fixed bug #1528212 (some resources wrongly tagged as French). Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.249 retrieving revision 1.250 diff -C2 -d -r1.249 -r1.250 *** ChangeLog 28 Jul 2006 05:45:21 -0000 1.249 --- ChangeLog 28 Jul 2006 05:53:50 -0000 1.250 *************** *** 4,7 **** --- 4,11 ---- unzip clients. Fixed bug #1527877 . + * src/msvc6/TesRunner/TestRunner.rc: + * src/msvc6/testpluginrunner/TestPlugInRunner.rc: Fixed bug #1528212 + (some resources wrongly tagged as French). + 2006-06-29 Baptiste Lepilleur <bl...@us...> * include/cppunit/ui/text/TextTestRunner.h |
From: Baptiste L. <bl...@us...> - 2006-07-28 05:54:05
|
Update of /cvsroot/cppunit/cppunit/examples/msvc6/CppUnitTestApp In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11512/examples/msvc6/CppUnitTestApp Modified Files: CppUnitTestApp.rc Log Message: * src/msvc6/TesRunner/TestRunner.rc: * src/msvc6/testpluginrunner/TestPlugInRunner.rc: Fixed bug #1528212 (some resources wrongly tagged as French). Index: CppUnitTestApp.rc =================================================================== RCS file: /cvsroot/cppunit/cppunit/examples/msvc6/CppUnitTestApp/CppUnitTestApp.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CppUnitTestApp.rc 1 Jun 2001 19:34:42 -0000 1.1 --- CppUnitTestApp.rc 28 Jul 2006 05:53:51 -0000 1.2 *************** *** 124,127 **** --- 124,136 ---- ///////////////////////////////////////////////////////////////////////////// // + // Icon + // + + // Icon with lowest ID value placed first to ensure application icon + // remains consistent on all systems. + IDR_MAINFRAME ICON DISCARDABLE "res\\CppUnitTestApp.ico" + + ///////////////////////////////////////////////////////////////////////////// + // // String Table // *************** *** 182,194 **** #endif // APSTUDIO_INVOKED - - ///////////////////////////////////////////////////////////////////////////// - // - // Icon - // - - // Icon with lowest ID value placed first to ensure application icon - // remains consistent on all systems. - IDR_MAINFRAME ICON DISCARDABLE "res\\CppUnitTestApp.ico" #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// --- 191,194 ---- |
From: Baptiste L. <bl...@us...> - 2006-07-28 05:53:58
|
Update of /cvsroot/cppunit/cppunit/src/msvc6/testrunner In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11512/src/msvc6/testrunner Modified Files: TestRunner.rc Log Message: * src/msvc6/TesRunner/TestRunner.rc: * src/msvc6/testpluginrunner/TestPlugInRunner.rc: Fixed bug #1528212 (some resources wrongly tagged as French). Index: TestRunner.rc =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/msvc6/testrunner/TestRunner.rc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestRunner.rc 3 Jul 2002 07:02:49 -0000 1.9 --- TestRunner.rc 28 Jul 2006 05:53:51 -0000 1.10 *************** *** 174,189 **** END - #endif // English (U.S.) resources - ///////////////////////////////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////////////////////////////// - // French (France) resources - - #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) - #ifdef _WIN32 - LANGUAGE LANG_FRENCH, SUBLANG_FRENCH - #pragma code_page(1252) - #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// --- 174,177 ---- *************** *** 202,206 **** END ! #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// --- 190,194 ---- END ! #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// |
From: Baptiste L. <bl...@us...> - 2006-07-28 05:53:58
|
Update of /cvsroot/cppunit/cppunit/src/msvc6/testpluginrunner In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11512/src/msvc6/testpluginrunner Modified Files: TestPlugInRunner.rc Log Message: * src/msvc6/TesRunner/TestRunner.rc: * src/msvc6/testpluginrunner/TestPlugInRunner.rc: Fixed bug #1528212 (some resources wrongly tagged as French). Index: TestPlugInRunner.rc =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/msvc6/testpluginrunner/TestPlugInRunner.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestPlugInRunner.rc 3 Jul 2002 07:02:49 -0000 1.4 --- TestPlugInRunner.rc 28 Jul 2006 05:53:51 -0000 1.5 *************** *** 163,168 **** // ! CPP_UNIT_TEST_RUNNER_IDB_ERROR_TYPE BITMAP DISCARDABLE "res\\errortype.bmp" ! CPP_UNIT_TEST_RUNNER_IDB_TEST_TYPE BITMAP DISCARDABLE "res\\test_type.bmp" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// --- 163,193 ---- // ! CPP_UNIT_TEST_RUNNER_IDB_ERROR_TYPE BITMAP DISCARDABLE "res\\errortype.bmp" ! CPP_UNIT_TEST_RUNNER_IDB_TEST_TYPE BITMAP DISCARDABLE "res\\test_type.bmp" ! ! ///////////////////////////////////////////////////////////////////////////// ! // ! // Icon ! // ! ! // Icon with lowest ID value placed first to ensure application icon ! // remains consistent on all systems. ! CPP_UNIT_TEST_RUNNER_PLUG_IN_IDR_TEST_PLUGIN_RUNNER ICON DISCARDABLE "res\\TestPlugInRunner.ico" ! ! ///////////////////////////////////////////////////////////////////////////// ! // ! // String Table ! // ! ! STRINGTABLE DISCARDABLE ! BEGIN ! IDS_ERROR_SELECT_TEST "You must select a test!" ! IDS_ERRORLIST_TYPE "Type" ! IDS_ERRORLIST_NAME "Name" ! IDS_ERRORLIST_FAILED_CONDITION "Failed Condition" ! IDS_ERRORLIST_LINE_NUMBER "Line Number" ! IDS_ERRORLIST_FILE_NAME "File Name" ! END ! #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// *************** *** 215,243 **** #endif // APSTUDIO_INVOKED - - ///////////////////////////////////////////////////////////////////////////// - // - // Icon - // - - // Icon with lowest ID value placed first to ensure application icon - // remains consistent on all systems. - CPP_UNIT_TEST_RUNNER_PLUG_IN_IDR_TEST_PLUGIN_RUNNER ICON DISCARDABLE "res\\TestPlugInRunner.ico" - - ///////////////////////////////////////////////////////////////////////////// - // - // String Table - // - - STRINGTABLE DISCARDABLE - BEGIN - IDS_ERROR_SELECT_TEST "You must select a test!" - IDS_ERRORLIST_TYPE "Type" - IDS_ERRORLIST_NAME "Name" - IDS_ERRORLIST_FAILED_CONDITION "Failed Condition" - IDS_ERRORLIST_LINE_NUMBER "Line Number" - IDS_ERRORLIST_FILE_NAME "File Name" - END - #endif // French (France) resources ///////////////////////////////////////////////////////////////////////////// --- 240,243 ---- |
From: Baptiste L. <bl...@us...> - 2006-07-28 05:45:29
|
Update of /cvsroot/cppunit/cppunit/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8950/lib Added Files: .keepme Log Message: * Makefile.am: * lib/.keepme: added dummy file to prevent lib/ removal by some unzip clients. Fixed bug #1527877 . --- NEW FILE: .keepme --- |
From: Baptiste L. <bl...@us...> - 2006-07-28 05:45:29
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8950 Modified Files: ChangeLog Makefile.am Log Message: * Makefile.am: * lib/.keepme: added dummy file to prevent lib/ removal by some unzip clients. Fixed bug #1527877 . Index: Makefile.am =================================================================== RCS file: /cvsroot/cppunit/cppunit/Makefile.am,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Makefile.am 4 Mar 2006 21:47:05 -0000 1.36 --- Makefile.am 28 Jul 2006 05:45:21 -0000 1.37 *************** *** 22,26 **** contrib/xml-xsl/tests.xml \ contrib/xml-xsl/report.xsl \ ! src/CppUnitLibraries.dsw m4sources = \ --- 22,27 ---- contrib/xml-xsl/tests.xml \ contrib/xml-xsl/report.xsl \ ! src/CppUnitLibraries.dsw \ ! lib/.keepme m4sources = \ Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.248 retrieving revision 1.249 diff -C2 -d -r1.248 -r1.249 *** ChangeLog 29 Jun 2006 19:53:40 -0000 1.248 --- ChangeLog 28 Jul 2006 05:45:21 -0000 1.249 *************** *** 1,3 **** ! 2006-06-29 Baptiste Lepilleur <gai...@fr...> * include/cppunit/ui/text/TextTestRunner.h * src/cppunit/TextTestRunner.cpp: applied patch #1210013 to remove --- 1,8 ---- ! 2006-06-29 Baptiste Lepilleur <bl...@us...> ! * Makefile.am: ! * lib/.keepme: added dummy file to prevent lib/ removal by some ! unzip clients. Fixed bug #1527877 . ! ! 2006-06-29 Baptiste Lepilleur <bl...@us...> [...1659 lines suppressed...] * Added some items to the TODO list for VC++ TestRunner. --- 3378,3382 ---- history anymore. ! 2001-05-19 Baptiste Lepilleur <bl...@us...> * Added some items to the TODO list for VC++ TestRunner. *************** *** 3398,3402 **** * Updated hierarchy example to use TextTestRunner. ! 2001-05-18 Baptiste Lepilleur <gai...@fr...> * Symbol CU_USE_TYPEINFO must be defined instead of USE_TYPEINFO --- 3403,3407 ---- * Updated hierarchy example to use TextTestRunner. ! 2001-05-18 Baptiste Lepilleur <bl...@us...> * Symbol CU_USE_TYPEINFO must be defined instead of USE_TYPEINFO |
From: Baptiste L. <bl...@us...> - 2006-07-25 06:55:35
|
Update of /cvsroot/cppunit/cppunit/src/msvc6/DSPlugIn In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7935/src/msvc6/DSPlugIn Modified Files: DSPlugIn.dsp Log Message: - fixed bug #1527879 (SourceSafe traces in project) Index: DSPlugIn.dsp =================================================================== RCS file: /cvsroot/cppunit/cppunit/src/msvc6/DSPlugIn/DSPlugIn.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DSPlugIn.dsp 10 Jul 2002 18:50:02 -0000 1.7 --- DSPlugIn.dsp 25 Jul 2006 06:55:30 -0000 1.8 *************** *** 26,31 **** # Begin Project # PROP AllowPerConfigDependencies 0 - # PROP Scc_ProjName "DSPlugIn" - # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe --- 26,29 ---- |
From: Baptiste L. <bl...@us...> - 2006-06-29 21:36:08
|
Update of /cvsroot/cppunit/cppunit/doc In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15184/doc Modified Files: makedox.bat Log Message: - bumped version to 1.12.0 Index: makedox.bat =================================================================== RCS file: /cvsroot/cppunit/cppunit/doc/makedox.bat,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** makedox.bat 5 Mar 2006 09:59:40 -0000 1.11 --- makedox.bat 29 Jun 2006 21:11:30 -0000 1.12 *************** *** 1,3 **** ! SET VERSION=1.11.6 doxygen CppUnit-win.dox xcopy FAQ html /Y --- 1,3 ---- ! SET VERSION=1.12.0 doxygen CppUnit-win.dox xcopy FAQ html /Y |
From: Baptiste L. <bl...@us...> - 2006-06-29 21:35:11
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15184 Modified Files: NEWS configure.in Log Message: - bumped version to 1.12.0 Index: NEWS =================================================================== RCS file: /cvsroot/cppunit/cppunit/NEWS,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** NEWS 29 Jun 2006 19:53:40 -0000 1.96 --- NEWS 29 Jun 2006 21:11:30 -0000 1.97 *************** *** 1,3 **** ! New in CppUnit 1.11.6: ---------------------- --- 1,3 ---- ! New in CppUnit 1.12.0: ---------------------- Index: configure.in =================================================================== RCS file: /cvsroot/cppunit/cppunit/configure.in,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** configure.in 5 Mar 2006 09:59:40 -0000 1.84 --- configure.in 29 Jun 2006 21:11:30 -0000 1.85 *************** *** 15,20 **** # CPPUNIT_MAJOR_VERSION=1 ! CPPUNIT_MINOR_VERSION=11 ! CPPUNIT_MICRO_VERSION=6 CPPUNIT_INTERFACE_AGE=0 CPPUNIT_BINARY_AGE=0 --- 15,20 ---- # CPPUNIT_MAJOR_VERSION=1 ! CPPUNIT_MINOR_VERSION=12 ! CPPUNIT_MICRO_VERSION=0 CPPUNIT_INTERFACE_AGE=0 CPPUNIT_BINARY_AGE=0 |
From: Baptiste L. <bl...@us...> - 2006-06-29 21:35:07
|
Update of /cvsroot/cppunit/cppunit/include/cppunit In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15184/include/cppunit Modified Files: Portability.h Log Message: - bumped version to 1.12.0 Index: Portability.h =================================================================== RCS file: /cvsroot/cppunit/cppunit/include/cppunit/Portability.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Portability.h 5 Jul 2005 21:17:40 -0000 1.27 --- Portability.h 29 Jun 2006 21:11:30 -0000 1.28 *************** *** 21,25 **** // Version number of package #ifndef CPPUNIT_VERSION ! #define CPPUNIT_VERSION "1.10.4" #endif --- 21,25 ---- // Version number of package #ifndef CPPUNIT_VERSION ! #define CPPUNIT_VERSION "1.12.0" #endif |