Mercurial > hg > orthanc
diff UnitTestsSources/FileStorageTests.cpp @ 1135:67c3c1e4a6e0
index-only mode, and custom storage area with plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 09 Sep 2014 15:55:43 +0200 |
parents | bf67431a7383 |
children | 6e7e5ed91c2d |
line wrap: on
line diff
--- a/UnitTestsSources/FileStorageTests.cpp Tue Sep 09 12:53:49 2014 +0200 +++ b/UnitTestsSources/FileStorageTests.cpp Tue Sep 09 15:55:43 2014 +0200 @@ -63,7 +63,8 @@ FilesystemStorage s("UnitTestsStorage"); std::string data = Toolbox::GenerateUuid(); - std::string uid = s.Create(&data[0], data.size(), FileContentType_Unknown); + std::string uid = Toolbox::GenerateUuid(); + s.Create(uid.c_str(), &data[0], data.size(), FileContentType_Unknown); std::string d; s.Read(d, uid, FileContentType_Unknown); ASSERT_EQ(d.size(), data.size()); @@ -77,7 +78,8 @@ std::vector<uint8_t> data; StringToVector(data, Toolbox::GenerateUuid()); - std::string uid = s.Create(&data[0], data.size(), FileContentType_Unknown); + std::string uid = Toolbox::GenerateUuid(); + s.Create(uid.c_str(), &data[0], data.size(), FileContentType_Unknown); std::string d; s.Read(d, uid, FileContentType_Unknown); ASSERT_EQ(d.size(), data.size()); @@ -94,7 +96,9 @@ for (unsigned int i = 0; i < 10; i++) { std::string t = Toolbox::GenerateUuid(); - u.push_back(s.Create(&t[0], t.size(), FileContentType_Unknown)); + std::string uid = Toolbox::GenerateUuid(); + s.Create(uid.c_str(), &t[0], t.size(), FileContentType_Unknown); + u.push_back(uid); } std::set<std::string> ss;