ASSERT_EQ instead of EXPECT_EQ in tests

because that's what we actually want, to crash right now, no point in continuing
This commit is contained in:
2024-03-15 22:37:26 +01:00
parent 0095f9ff69
commit 8e9ed2b715
6 changed files with 89 additions and 89 deletions

View File

@@ -26,11 +26,11 @@ TEST(BuzhashTest, SimpleTest) {
for (int i = 0; i < loremipsum.length(); i++) { for (int i = 0; i < loremipsum.length(); i++) {
b2.feed((uint8_t) loremipsum[i]); b2.feed((uint8_t) loremipsum[i]);
if (b2.get() == h1) { if (b2.get() == h1) {
EXPECT_EQ(i, loremipsum.find("e eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p")); ASSERT_EQ(i, loremipsum.find("e eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non p"));
h1found = true; h1found = true;
break; break;
} }
} }
EXPECT_EQ(h1found, true); ASSERT_EQ(h1found, true);
} }
} }

View File

@@ -9,15 +9,15 @@
TEST(CLITest, Backup) { TEST(CLITest, Backup) {
int ret = system("../../../tests/clitests/scripts/backup.sh"); int ret = system("../../../tests/clitests/scripts/backup.sh");
EXPECT_EQ(WEXITSTATUS(ret), 0); ASSERT_EQ(WEXITSTATUS(ret), 0);
} }
TEST(CLITest, Ignore) { TEST(CLITest, Ignore) {
int ret = system("../../../tests/clitests/scripts/ignore.sh"); int ret = system("../../../tests/clitests/scripts/ignore.sh");
EXPECT_EQ(WEXITSTATUS(ret), 0); ASSERT_EQ(WEXITSTATUS(ret), 0);
} }
TEST(CLITest, Diff) { TEST(CLITest, Diff) {
int ret = system("../../../tests/clitests/scripts/diff.sh"); int ret = system("../../../tests/clitests/scripts/diff.sh");
EXPECT_EQ(WEXITSTATUS(ret), 0); ASSERT_EQ(WEXITSTATUS(ret), 0);
} }

View File

@@ -11,32 +11,32 @@ TEST(CryptoTests, AES) {
std::string in = "hello1"; std::string in = "hello1";
auto enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e"); auto enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e");
auto dec = AES::decrypt(enc, "p1", "e"); auto dec = AES::decrypt(enc, "p1", "e");
EXPECT_EQ(in, std::string(dec.begin(), dec.end())); ASSERT_EQ(in, std::string(dec.begin(), dec.end()));
in = ""; in = "";
enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e"); enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e");
dec = AES::decrypt(enc, "p1", "e"); dec = AES::decrypt(enc, "p1", "e");
EXPECT_EQ(in, std::string(dec.begin(), dec.end())); ASSERT_EQ(in, std::string(dec.begin(), dec.end()));
in = "1234567890asdfg"; in = "1234567890asdfg";
enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e"); enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e");
dec = AES::decrypt(enc, "p1", "e"); dec = AES::decrypt(enc, "p1", "e");
EXPECT_EQ(in, std::string(dec.begin(), dec.end())); ASSERT_EQ(in, std::string(dec.begin(), dec.end()));
in = "1234567890asdfgh"; in = "1234567890asdfgh";
enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e"); enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e");
dec = AES::decrypt(enc, "p1", "e"); dec = AES::decrypt(enc, "p1", "e");
EXPECT_EQ(in, std::string(dec.begin(), dec.end())); ASSERT_EQ(in, std::string(dec.begin(), dec.end()));
in = "1234567890asdfghe"; in = "1234567890asdfghe";
enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e"); enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e");
dec = AES::decrypt(enc, "p1", "e"); dec = AES::decrypt(enc, "p1", "e");
EXPECT_EQ(in, std::string(dec.begin(), dec.end())); ASSERT_EQ(in, std::string(dec.begin(), dec.end()));
in = "1234567890asdfgheq"; in = "1234567890asdfgheq";
enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e"); enc = AES::encrypt(std::vector<char>(in.begin(), in.end()), "p1", "e");
dec = AES::decrypt(enc, "p1", "e"); dec = AES::decrypt(enc, "p1", "e");
EXPECT_EQ(in, std::string(dec.begin(), dec.end())); ASSERT_EQ(in, std::string(dec.begin(), dec.end()));
} }
TEST(CryptoTests, SHA) { TEST(CryptoTests, SHA) {
@@ -47,6 +47,6 @@ TEST(CryptoTests, SHA) {
auto out = SHA::calculate(data); auto out = SHA::calculate(data);
EXPECT_EQ(out.size(), 32); ASSERT_EQ(out.size(), 32);
for (int i = 0; i < out.size(); i++) { EXPECT_EQ(static_cast<uint8_t>(out[i]), excepted[i]); } for (int i = 0; i < out.size(); i++) { ASSERT_EQ(static_cast<uint8_t>(out[i]), excepted[i]); }
} }

View File

@@ -61,7 +61,7 @@ TEST(FullTest, Simple) {
} }
{ {
try { try {
EXPECT_EQ(std::filesystem::is_directory("Simple/testtores/testdir"), true); ASSERT_EQ(std::filesystem::is_directory("Simple/testtores/testdir"), true);
} catch (...) { } catch (...) {
std::cerr << "Empty directory doesn't exist!" << std::endl; std::cerr << "Empty directory doesn't exist!" << std::endl;
throw; throw;
@@ -71,11 +71,11 @@ TEST(FullTest, Simple) {
std::ifstream o(std::filesystem::path("Simple/testtores") / ("f" + std::to_string(i)), std::ifstream o(std::filesystem::path("Simple/testtores") / ("f" + std::to_string(i)),
std::ios::binary | std::ios::in); std::ios::binary | std::ios::in);
try { try {
EXPECT_EQ(o.is_open(), true); ASSERT_EQ(o.is_open(), true);
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
char c; char c;
EXPECT_EQ(o.get(c).operator bool(), true); ASSERT_EQ(o.get(c).operator bool(), true);
EXPECT_EQ(static_cast<char>(j % 256), c); ASSERT_EQ(static_cast<char>(j % 256), c);
} }
} catch (...) { } catch (...) {
std::cerr << "Error comparing file " << i << std::endl; std::cerr << "Error comparing file " << i << std::endl;
@@ -150,16 +150,16 @@ TEST(FullTest, SimpleWithIgnore) {
cmd.run(Context{&logger, repo.get()}); cmd.run(Context{&logger, repo.get()});
} }
{ {
EXPECT_EQ(std::filesystem::is_directory("SimpleWithIgnore/testtores/testdir"), true); ASSERT_EQ(std::filesystem::is_directory("SimpleWithIgnore/testtores/testdir"), true);
for (int i = 0; i < 257; i++) { for (int i = 0; i < 257; i++) {
std::ifstream o(std::filesystem::path("SimpleWithIgnore/testtores") / ("f" + std::to_string(i)), std::ifstream o(std::filesystem::path("SimpleWithIgnore/testtores") / ("f" + std::to_string(i)),
std::ios::binary | std::ios::in); std::ios::binary | std::ios::in);
EXPECT_EQ(o.is_open(), true); ASSERT_EQ(o.is_open(), true);
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
char c; char c;
EXPECT_EQ(o.get(c).operator bool(), true); ASSERT_EQ(o.get(c).operator bool(), true);
EXPECT_EQ(static_cast<char>(j % 256), c); ASSERT_EQ(static_cast<char>(j % 256), c);
} }
} }
@@ -167,31 +167,31 @@ TEST(FullTest, SimpleWithIgnore) {
std::ifstream file("SimpleWithIgnore/testtores/testdir2/.ignore"); std::ifstream file("SimpleWithIgnore/testtores/testdir2/.ignore");
std::string s; std::string s;
file >> s; file >> s;
EXPECT_EQ(s, "hello.txt"); ASSERT_EQ(s, "hello.txt");
} }
{ {
std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir3/.ignore"); std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir3/.ignore");
std::string s; std::string s;
file >> s; file >> s;
EXPECT_EQ(s, ".*\\.txt"); ASSERT_EQ(s, ".*\\.txt");
} }
{ {
std::ifstream file("SimpleWithIgnore/testtores/testdir2/hello.txt"); std::ifstream file("SimpleWithIgnore/testtores/testdir2/hello.txt");
EXPECT_EQ(!file, true); ASSERT_EQ(!file, true);
} }
{ {
std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir3/hello.txt"); std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir3/hello.txt");
EXPECT_EQ(!file, true); ASSERT_EQ(!file, true);
} }
{ {
std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir3/asdf.txt"); std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir3/asdf.txt");
EXPECT_EQ(!file, true); ASSERT_EQ(!file, true);
} }
{ {
std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir4/asdf.txt"); std::ifstream file("SimpleWithIgnore/testtores/testdir2/testdir4/asdf.txt");
std::string s; std::string s;
file >> s; file >> s;
EXPECT_EQ(s, "asdf2"); ASSERT_EQ(s, "asdf2");
} }
} }
} }
@@ -237,16 +237,16 @@ TEST(FullTest, SimpleWithCompress) {
cmd.run(Context{&logger, repo.get()}); cmd.run(Context{&logger, repo.get()});
} }
{ {
EXPECT_EQ(std::filesystem::is_directory("SimpleWithCompress/testtores/testdir"), true); ASSERT_EQ(std::filesystem::is_directory("SimpleWithCompress/testtores/testdir"), true);
for (int i = 0; i < 257; i++) { for (int i = 0; i < 257; i++) {
std::ifstream o(std::filesystem::path("SimpleWithCompress/testtores") / ("f" + std::to_string(i)), std::ifstream o(std::filesystem::path("SimpleWithCompress/testtores") / ("f" + std::to_string(i)),
std::ios::binary | std::ios::in); std::ios::binary | std::ios::in);
EXPECT_EQ(o.is_open(), true); ASSERT_EQ(o.is_open(), true);
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
char c; char c;
EXPECT_EQ(o.get(c).operator bool(), true); ASSERT_EQ(o.get(c).operator bool(), true);
EXPECT_EQ(static_cast<char>(j % 256), c); ASSERT_EQ(static_cast<char>(j % 256), c);
} }
} }
} }
@@ -290,10 +290,10 @@ TEST(FullTest, SimpleWithCompEnd) {
bool ok = true; bool ok = true;
try { try {
EXPECT_EQ(repo->open(), false); ASSERT_EQ(repo->open(), false);
ok = false; ok = false;
} catch (...) {} } catch (...) {}
EXPECT_EQ(ok, true); ASSERT_EQ(ok, true);
} }
{ {
Config conf; Config conf;
@@ -312,16 +312,16 @@ TEST(FullTest, SimpleWithCompEnd) {
cmd.run(Context{&logger, repo.get()}); cmd.run(Context{&logger, repo.get()});
} }
{ {
EXPECT_EQ(std::filesystem::is_directory("SimpleWithCompEnd/testtores/testdir"), true); ASSERT_EQ(std::filesystem::is_directory("SimpleWithCompEnd/testtores/testdir"), true);
for (int i = 0; i < 257; i++) { for (int i = 0; i < 257; i++) {
std::ifstream o(std::filesystem::path("SimpleWithCompEnd/testtores") / ("f" + std::to_string(i)), std::ifstream o(std::filesystem::path("SimpleWithCompEnd/testtores") / ("f" + std::to_string(i)),
std::ios::binary | std::ios::in); std::ios::binary | std::ios::in);
EXPECT_EQ(o.is_open(), true); ASSERT_EQ(o.is_open(), true);
for (int j = 0; j < i; j++) { for (int j = 0; j < i; j++) {
char c; char c;
EXPECT_EQ(o.get(c).operator bool(), true); ASSERT_EQ(o.get(c).operator bool(), true);
EXPECT_EQ(static_cast<char>(j % 256), c); ASSERT_EQ(static_cast<char>(j % 256), c);
} }
} }
} }
@@ -440,7 +440,7 @@ TEST(FullTest, Fuzz) {
auto outstr = runnerout.str(); auto outstr = runnerout.str();
if (outstr.find("Error") == std::string::npos) ok = false; if (outstr.find("Error") == std::string::npos) ok = false;
} catch (...) {} } catch (...) {}
EXPECT_EQ(ok, true); ASSERT_EQ(ok, true);
} }
} }
} }

View File

@@ -29,18 +29,18 @@ TEST(Chunk, Deserialize) {
std::vector<char> data2{'q', 'w', 'e', 'r', 'b'}; std::vector<char> data2{'q', 'w', 'e', 'r', 'b'};
Chunk o2e(777, {1}, data2); Chunk o2e(777, {1}, data2);
EXPECT_EQ(o1.id, o1e.id); ASSERT_EQ(o1.id, o1e.id);
EXPECT_EQ(o2.id, o2e.id); ASSERT_EQ(o2.id, o2e.id);
EXPECT_EQ((int) o1.type, (int) o1e.type); ASSERT_EQ((int) o1.type, (int) o1e.type);
EXPECT_EQ((int) o2.type, (int) o2e.type); ASSERT_EQ((int) o2.type, (int) o2e.type);
EXPECT_EQ(o1.data.size(), o1e.data.size()); ASSERT_EQ(o1.data.size(), o1e.data.size());
EXPECT_EQ(o2.data.size(), o2e.data.size()); ASSERT_EQ(o2.data.size(), o2e.data.size());
for (int i = 0; i < o1.data.size(); i++) { EXPECT_EQ(o1.data[i], o1e.data[i]); } for (int i = 0; i < o1.data.size(); i++) { ASSERT_EQ(o1.data[i], o1e.data[i]); }
for (int i = 0; i < o2.data.size(); i++) { EXPECT_EQ(o2.data[i], o2e.data[i]); } for (int i = 0; i < o2.data.size(); i++) { ASSERT_EQ(o2.data[i], o2e.data[i]); }
for (int i = 0; i < o1.SHA.size(); i++) { EXPECT_EQ(o1.SHA[i], o1e.SHA[i]); } for (int i = 0; i < o1.SHA.size(); i++) { ASSERT_EQ(o1.SHA[i], o1e.SHA[i]); }
for (int i = 0; i < o2.SHA.size(); i++) { EXPECT_EQ(o2.SHA[i], o2e.SHA[i]); } for (int i = 0; i < o2.SHA.size(); i++) { ASSERT_EQ(o2.SHA[i], o2e.SHA[i]); }
} }
} }

View File

@@ -32,8 +32,8 @@ TEST(FileRepository, Deserialize) {
repo.putObject(o2); repo.putObject(o2);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777);
} }
{ {
Config conf; Config conf;
@@ -45,8 +45,8 @@ TEST(FileRepository, Deserialize) {
std::string o2k(16, '\0'); std::string o2k(16, '\0');
o2k[0] = 1; o2k[0] = 1;
o2k[1] = 2; o2k[1] = 2;
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777);
auto o1o = repo.getObject(666); auto o1o = repo.getObject(666);
auto o2o = repo.getObject(777); auto o2o = repo.getObject(777);
@@ -61,18 +61,18 @@ TEST(FileRepository, Deserialize) {
std::vector<char> data2{'q', 'w', 'e', 'r', static_cast<char>(255)}; std::vector<char> data2{'q', 'w', 'e', 'r', static_cast<char>(255)};
Chunk o2e(777, o2k, data2); Chunk o2e(777, o2k, data2);
EXPECT_EQ(o1.id, o1e.id); ASSERT_EQ(o1.id, o1e.id);
EXPECT_EQ(o2.id, o2e.id); ASSERT_EQ(o2.id, o2e.id);
EXPECT_EQ((int) o1.type, (int) o1e.type); ASSERT_EQ((int) o1.type, (int) o1e.type);
EXPECT_EQ((int) o2.type, (int) o2e.type); ASSERT_EQ((int) o2.type, (int) o2e.type);
auto o1d = o1.data; auto o1d = o1.data;
auto o1ed = o1e.data; auto o1ed = o1e.data;
auto o2d = o2.data; auto o2d = o2.data;
auto o2ed = o2e.data; auto o2ed = o2e.data;
EXPECT_EQ(o1.data.size(), o1e.data.size()); ASSERT_EQ(o1.data.size(), o1e.data.size());
EXPECT_EQ(o2.data.size(), o2e.data.size()); ASSERT_EQ(o2.data.size(), o2e.data.size());
for (int i = 0; i < o1.data.size(); i++) { EXPECT_EQ(o1.data[i], o1e.data[i]); } for (int i = 0; i < o1.data.size(); i++) { ASSERT_EQ(o1.data[i], o1e.data[i]); }
for (int i = 0; i < o2.data.size(); i++) { EXPECT_EQ(o2.data[i], o2e.data[i]); } for (int i = 0; i < o2.data.size(); i++) { ASSERT_EQ(o2.data[i], o2e.data[i]); }
} }
} }
@@ -103,8 +103,8 @@ TEST(FileRepository, Filters) {
repo.putObject(o2); repo.putObject(o2);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777);
} }
{ {
Config conf; Config conf;
@@ -160,8 +160,8 @@ TEST(FileRepository, Filters) {
std::string o2k(16, '\0'); std::string o2k(16, '\0');
o2k[0] = 1; o2k[0] = 1;
o2k[1] = 2; o2k[1] = 2;
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 666);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 777);
auto o1o = repo.getObject(666); auto o1o = repo.getObject(666);
auto o2o = repo.getObject(777); auto o2o = repo.getObject(777);
@@ -176,18 +176,18 @@ TEST(FileRepository, Filters) {
std::vector<char> data2{'q', 'w', 'e', 'r', 'b'}; std::vector<char> data2{'q', 'w', 'e', 'r', 'b'};
Chunk o2e(777, o2k, data2); Chunk o2e(777, o2k, data2);
EXPECT_EQ(o1.id, o1e.id); ASSERT_EQ(o1.id, o1e.id);
EXPECT_EQ(o2.id, o2e.id); ASSERT_EQ(o2.id, o2e.id);
EXPECT_EQ((int) o1.type, (int) o1e.type); ASSERT_EQ((int) o1.type, (int) o1e.type);
EXPECT_EQ((int) o2.type, (int) o2e.type); ASSERT_EQ((int) o2.type, (int) o2e.type);
auto o1d = o1.data; auto o1d = o1.data;
auto o1ed = o1e.data; auto o1ed = o1e.data;
auto o2d = o2.data; auto o2d = o2.data;
auto o2ed = o2e.data; auto o2ed = o2e.data;
EXPECT_EQ(o1.data.size(), o1e.data.size()); ASSERT_EQ(o1.data.size(), o1e.data.size());
EXPECT_EQ(o2.data.size(), o2e.data.size()); ASSERT_EQ(o2.data.size(), o2e.data.size());
for (int i = 0; i < o1.data.size(); i++) { EXPECT_EQ(o1.data[i], o1e.data[i]); } for (int i = 0; i < o1.data.size(); i++) { ASSERT_EQ(o1.data[i], o1e.data[i]); }
for (int i = 0; i < o2.data.size(); i++) { EXPECT_EQ(o2.data[i], o2e.data[i]); } for (int i = 0; i < o2.data.size(); i++) { ASSERT_EQ(o2.data[i], o2e.data[i]); }
} }
} }
@@ -209,15 +209,15 @@ TEST(FileRepository, IDsDisabled) {
std::vector<char> data2{'q', 'w', 'e', 'r', 'b'}; std::vector<char> data2{'q', 'w', 'e', 'r', 'b'};
Chunk o2(repo.getId(), o2k, data2); Chunk o2(repo.getId(), o2k, data2);
EXPECT_EQ(o1.id, 1); ASSERT_EQ(o1.id, 1);
EXPECT_EQ(o2.id, 2); ASSERT_EQ(o2.id, 2);
repo.putObject(o1); repo.putObject(o1);
repo.putObject(o2); repo.putObject(o2);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 1); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 1);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 2); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 2);
} }
{ {
Config conf; Config conf;
@@ -239,22 +239,22 @@ TEST(FileRepository, IDsDisabled) {
std::vector<char> data2{'q', 'w', 'e', 'r', 'b'}; std::vector<char> data2{'q', 'w', 'e', 'r', 'b'};
Chunk o2e(2, o2k, data2); Chunk o2e(2, o2k, data2);
EXPECT_EQ(o1.id, o1e.id); ASSERT_EQ(o1.id, o1e.id);
EXPECT_EQ(o2.id, o2e.id); ASSERT_EQ(o2.id, o2e.id);
EXPECT_EQ((int) o1.type, (int) o1e.type); ASSERT_EQ((int) o1.type, (int) o1e.type);
EXPECT_EQ((int) o2.type, (int) o2e.type); ASSERT_EQ((int) o2.type, (int) o2e.type);
auto o1d = o1.data; auto o1d = o1.data;
auto o1ed = o1e.data; auto o1ed = o1e.data;
auto o2d = o2.data; auto o2d = o2.data;
auto o2ed = o2e.data; auto o2ed = o2e.data;
EXPECT_EQ(o1.data.size(), o1e.data.size()); ASSERT_EQ(o1.data.size(), o1e.data.size());
EXPECT_EQ(o2.data.size(), o2e.data.size()); ASSERT_EQ(o2.data.size(), o2e.data.size());
for (int i = 0; i < o1.data.size(); i++) { EXPECT_EQ(o1.data[i], o1e.data[i]); } for (int i = 0; i < o1.data.size(); i++) { ASSERT_EQ(o1.data[i], o1e.data[i]); }
for (int i = 0; i < o2.data.size(); i++) { EXPECT_EQ(o2.data[i], o2e.data[i]); } for (int i = 0; i < o2.data.size(); i++) { ASSERT_EQ(o2.data[i], o2e.data[i]); }
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 1); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o1k), 1);
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 2); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 2);
repo.deleteObject(o1); repo.deleteObject(o1);
@@ -267,12 +267,12 @@ TEST(FileRepository, IDsDisabled) {
std::string o2k(16, '\0'); std::string o2k(16, '\0');
o2k[0] = 1; o2k[0] = 1;
EXPECT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 2); ASSERT_EQ(repo.getObjectId(Object::ObjectType::Chunk, o2k), 2);
auto id = repo.getId(); auto id = repo.getId();
EXPECT_EQ(id, 1); ASSERT_EQ(id, 1);
std::vector<char> data1{'a', 'b', 'c', 'e'}; std::vector<char> data1{'a', 'b', 'c', 'e'};
Chunk o1(id, o2k, data1); Chunk o1(id, o2k, data1);
EXPECT_EQ(repo.getId(), 3); ASSERT_EQ(repo.getId(), 3);
} }
} }