~ubuntu-branches/ubuntu/oneiric/squid3/oneiric-security

« back to all changes in this revision

Viewing changes to src/tests/testUfs.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2007-05-13 16:03:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070513160316-2h6kn6h1z0q1fvyo
Tags: 3.0.PRE6-1
* New upstream release
  - Removed patches integrated upsteam:
    + 04-m68k-ftbfs

* debian/rules
  - Enable delay pools (Closes: #410785)
  - Enable cache digests (Closes: #416631)
  - Enable ICAP client
  - Raised Max Filedescriptor limit to 65536

* debian/control
  - Added real package dependency for httpd in squid3-cgi

* debian/patches/02-makefile-defaults
  - Fix default configuration file for cachemgr.cgi (Closes: #416630)

* debian/squid3.postinst
  - Fixed bashish in postinst (Closes: #411797)

* debian/patches/05-helpers-typo
  - Added upstream patch fixing compilation error in src/helpers.cc

* debian/patches/06-mem-obj-reference
  - Added upstream patch fixing a mem_obj reference in src/store.cc

* debian/patches/07-close-icap-connections
  - Added upstream patch fixing icap connection starvation

* debian/squid3.rc
  - Added LSB-compliant description to rc script

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
CPPUNIT_TEST_SUITE_REGISTRATION( testUfs );
18
18
 
19
19
typedef RefCount<UFSSwapDir> SwapDirPointer;
20
 
extern REMOVALPOLICYCREATE createRemovalPolicy_lru;
 
20
extern REMOVALPOLICYCREATE createRemovalPolicy_lru;     /* XXX fails with --enable-removal-policies=heap */
21
21
 
22
22
static void
23
23
addSwapDir(SwapDirPointer aStore)
119
119
    Store::Root().init();
120
120
 
121
121
    /* our swapdir must be scheduled to rebuild */
122
 
    CPPUNIT_ASSERT_EQUAL(1, StoreController::store_dirs_rebuilding);
 
122
    CPPUNIT_ASSERT_EQUAL(2, StoreController::store_dirs_rebuilding);
123
123
 
124
124
    /* rebuild is a scheduled event */
125
125
    StockEventLoop loop;
126
126
 
127
 
    while (StoreController::store_dirs_rebuilding)
 
127
    while (StoreController::store_dirs_rebuilding > 1)
128
128
        loop.runOnce();
129
129
 
130
130
    /* cannot use loop.run(); as the loop will never idle: the store-dir
132
132
     */
133
133
 
134
134
    /* nothing left to rebuild */
135
 
    CPPUNIT_ASSERT_EQUAL(0, StoreController::store_dirs_rebuilding);
 
135
    CPPUNIT_ASSERT_EQUAL(1, StoreController::store_dirs_rebuilding);
136
136
 
137
137
    /* add an entry */
138
138
    {
144
144
        HttpReply *rep = (HttpReply *) pe->getReply();  // bypass const
145
145
        rep->setHeaders(version, HTTP_OK, "dummy test object", "x-squid-internal/test", -1, -1, squid_curtime + 100000);
146
146
 
147
 
        storeSetPublicKey(pe);
 
147
        pe->setPublicKey();
148
148
 
149
 
        storeBuffer(pe);
 
149
        pe->buffer();
150
150
        /* TODO: remove this when the metadata is separated */
151
151
        {
152
152
            Packer p;
155
155
            packerClean(&p);
156
156
        }
157
157
 
158
 
        storeBufferFlush(pe);
159
 
        storeTimestampsSet(pe);
 
158
        pe->flush();
 
159
        pe->timestampsSet();
160
160
        pe->complete();
161
 
        storeSwapOut(pe);
 
161
        pe->swapOut();
162
162
        CPPUNIT_ASSERT(pe->swap_dirn == 0);
163
163
        CPPUNIT_ASSERT(pe->swap_filen == 0);
164
164
        pe->unlock();