MCPcopy Create free account
hub / github.com/BVLC/caffe / SetUp

Method SetUp

src/caffe/test/test_db.cpp:25–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 root_images_(string(EXAMPLES_SOURCE_DIR) + string("images/")) {}
24
25 virtual void SetUp() {
26 MakeTempDir(&source_);
27 source_ += "/db";
28 string keys[] = {"cat.jpg", "fish-bike.jpg"};
29 LOG(INFO) << "Using temporary db " << source_;
30 scoped_ptr<db::DB> db(db::GetDB(TypeParam::backend));
31 db->Open(this->source_, db::NEW);
32 scoped_ptr<db::Transaction> txn(db->NewTransaction());
33 for (int i = 0; i < 2; ++i) {
34 Datum datum;
35 ReadImageToDatum(root_images_ + keys[i], i, &datum);
36 string out;
37 CHECK(datum.SerializeToString(&out));
38 txn->Put(keys[i], out);
39 }
40 txn->Commit();
41 }
42
43 virtual ~DBTest() { }
44

Callers 15

InitMethod · 0.45
TYPED_TESTFunction · 0.45
TestForwardMethod · 0.45
TYPED_TESTFunction · 0.45
TestForwardMethod · 0.45
TYPED_TESTFunction · 0.45
TYPED_TESTFunction · 0.45
TYPED_TESTFunction · 0.45
TYPED_TESTFunction · 0.45
TYPED_TESTFunction · 0.45
TYPED_TESTFunction · 0.45
TYPED_TESTFunction · 0.45

Calls 7

MakeTempDirFunction · 0.85
GetDBFunction · 0.85
ReadImageToDatumFunction · 0.50
OpenMethod · 0.45
NewTransactionMethod · 0.45
PutMethod · 0.45
CommitMethod · 0.45

Tested by

no test coverage detected