Make QContiguousCache with zero capacity not crash
authorThiago Macieira <thiago.macieira@intel.com>
Tue, 25 Sep 2012 14:30:48 +0000 (16:30 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 19 Oct 2012 05:50:29 +0000 (07:50 +0200)
commit320c4e31e124f99601399d00935362b587c77510
treec2f66d1e11284fc7e9167d6a1cdf241da4500b60
parentc4b2d77f40a42a67480bb49aa63b0953c80c024a
Make QContiguousCache with zero capacity not crash

These containers don't make sense and will just result in no action
being taken (all items added will simply be discarded), but it
shouldn't crash due to a division by zero.

Update the documentation to explain the fact.

Task-number: QTBUG-27339
Change-Id: Ib9acf5c0a9a826e6853e7beaf5e56511fde98dc6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ian Walters <ian@walters.id.au>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qcontiguouscache.cpp
src/corelib/tools/qcontiguouscache.h
tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp