summaryrefslogtreecommitdiff
path: root/tests/test_file_cache.cc
AgeCommit message (Collapse)AuthorFilesLines
2009-11-19Fix test_file_cache for the new temp API.Daniel Burrows1-43/+47
2009-11-14Fix the path to a test file in case that a build directory is usedJens Seidel1-1/+2
Without this fix "make check" will fail if called outside of the source directory.
2009-10-25Deal with the fact that dirname can modify its argument.Daniel Burrows1-1/+10
2009-10-25Actually test the file cache's version 2 -> version 3 upgrade.Daniel Burrows1-1/+1
2009-10-17Add support to the file cache for storing the modification times of cached ↵Daniel Burrows1-34/+169
files. This has no impact on the cache replacement policy: the CacheId field is still used to implement an LRU policy. This information will be useful for items that are fetched from the network: we can use it to avoid fetching a second copy of a file when the current data is already up-to-date, without just not checking for updates (and hence possibly storing an out-of-date version of the file forever). This will be used for screenshot support, since unlike changelogs, screenshots might change. (it could be used for changelogs too, but since the changelog of a given version never changes, it's probably overkill for the time being -- maybe once we can read non-Debian changelogs this will make sense)
2009-08-22Fix the file-and-memory test to be less fragile.Daniel Burrows1-1/+1
This unfortunately doesn't test that memory is actually used; I'm not sure how to test that. Anyway, it's not guaranteed that all the items will be available unless the file cache is large enough to hold them all -- it coincidentally worked in previous builds, but won't work with compressed cache entries, which behave differently due to having different sizes for the items that are stored.
2009-08-19Fix the new test.Daniel Burrows1-8/+11
* The order in which entries were touched was wrong (I was touching the entry that should have been least-recently-used last ... oops). * Need to generate a new temporary file for each sub-test; otherwise we end up re-opening the same cache that was used for the last test, leading to trouble when we try to reset the test.
2009-08-19Add test cases to verify what happens when values are evicted from the cache.Daniel Burrows1-0/+81
2009-08-19Test some more cases of storing things in the file cache.Daniel Burrows1-0/+23
2009-08-17Fix the raw_istream_iterator used in the test case for the file cache.Daniel Burrows1-2/+5
2009-08-17Add a sanity-check of the raw istream iterator class (the rest of the file ↵Daniel Burrows1-0/+16
cache test is meaningless if it doesn't work).
2009-08-14Improve the message that gets printed when a key is missing in the cache.Daniel Burrows1-1/+1
2009-08-14Write a first test of getItem()/putItem().Daniel Burrows1-0/+164
2009-08-06Add a partially implemented cache for downloaded files.Daniel Burrows1-0/+51
The plan is to use BLOB storage in sqlite. This is less than entirely efficient, but it should avoid having a lot of small files hanging around and having to manage the cache contents myself. Hopefully the load on the cache will be low enough that the BLOBs are reasonable. I've split them into a separate table in the hope that it'll help. The only thing not implemented at the moment is actually putting files in and getting them out, i.e. the most important part. The tests are only just started, too.