Skip to content

Commit

Permalink
@20602303. Default file permission is now 755.
Browse files Browse the repository at this point in the history
git-svn-id: https://leveldb.googlecode.com/svn/trunk@20 62dab493-f737-651d-591e-8d6aee1b9529
  • Loading branch information
[email protected] committed Apr 12, 2011
1 parent 9e33808 commit f779e7a
Show file tree
Hide file tree
Showing 117 changed files with 628 additions and 275 deletions.
Empty file modified AUTHORS
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified README
100644 → 100755
Empty file.
8 changes: 0 additions & 8 deletions TODO
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
Before adding to chrome
-----------------------
- multi-threaded test/benchmark
- Allow missing crc32c in Table format?

Maybe afterwards
----------------

ss
- Stats

Expand Down
Empty file modified db/builder.cc
100644 → 100755
Empty file.
Empty file modified db/builder.h
100644 → 100755
Empty file.
21 changes: 15 additions & 6 deletions db/corruption_test.cc
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "leveldb/cache.h"
#include "leveldb/env.h"
#include "leveldb/table.h"
#include "leveldb/write_batch.h"
Expand All @@ -28,10 +29,12 @@ class CorruptionTest {
test::ErrorEnv env_;
Random rnd_;
std::string dbname_;
Cache* tiny_cache_;
Options options_;
DB* db_;

CorruptionTest() : rnd_(test::RandomSeed()) {
tiny_cache_ = NewLRUCache(100);
options_.env = &env_;
dbname_ = test::TmpDir() + "/db_test";
DestroyDB(dbname_, options_);
Expand All @@ -45,13 +48,15 @@ class CorruptionTest {
~CorruptionTest() {
delete db_;
DestroyDB(dbname_, Options());
delete tiny_cache_;
}

Status TryReopen(Options* options = NULL) {
delete db_;
db_ = NULL;
Options opt = (options ? *options : options_);
opt.env = &env_;
opt.block_cache = tiny_cache_;
return DB::Open(opt, dbname_, &db_);
}

Expand Down Expand Up @@ -160,12 +165,15 @@ class CorruptionTest {
ASSERT_TRUE(s.ok()) << s.ToString();
}

uint64_t Property(const std::string& name) {
uint64_t result;
if (!db_->GetProperty(name, &result)) {
result = ~static_cast<uint64_t>(0);
int Property(const std::string& name) {
std::string property;
int result;
if (db_->GetProperty(name, &property) &&
sscanf(property.c_str(), "%d", &result) == 1) {
return result;
} else {
return -1;
}
return result;
}

// Return the ith key
Expand Down Expand Up @@ -235,7 +243,7 @@ TEST(CorruptionTest, TableFileIndexData) {
dbi->TEST_CompactRange(0, "", "~");
dbi->TEST_CompactRange(1, "", "~");

Corrupt(kTableFile, -1000, 500);
Corrupt(kTableFile, -2000, 500);
Reopen();
Check(5000, 9999);
}
Expand Down Expand Up @@ -327,6 +335,7 @@ TEST(CorruptionTest, CompactionInputError) {
TEST(CorruptionTest, CompactionInputErrorParanoid) {
Options options;
options.paranoid_checks = true;
options.write_buffer_size = 1048576;
Reopen(&options);

Build(10);
Expand Down
Loading

0 comments on commit f779e7a

Please sign in to comment.