Fix row comparison function in tests 92/39592/2
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 19 May 2015 08:00:09 +0000 (10:00 +0200)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Tue, 19 May 2015 08:21:11 +0000 (01:21 -0700)
[Issue#] N/A
[Feature/Bug] N/A
[Problem] N/A
[Cause] The function was comparing the row with itself
[Solution] The pattern row is compared with the row read from db

[Verification] Run ckm-tests-internal

Change-Id: I2d98c3478f5e28ebd08bb1306edb5b00df8ab76b

tests/DBFixture.cpp

index 4c463c0..74c5146 100644 (file)
@@ -161,13 +161,12 @@ void DBFixture::compare_row(const DB::Row &lhs, const DB::Row &rhs)
 void DBFixture::check_DB_integrity(const DB::Row &rowPattern)
 {
     BOOST_REQUIRE_NO_THROW(m_db.saveRow(rowPattern));
-    DB::Row selectRow = rowPattern;
 
     DB::Crypto::RowOptional optional_row;
     BOOST_REQUIRE_NO_THROW(optional_row = m_db.getRow("name", "label", DataType::BINARY_DATA));
     BOOST_REQUIRE_MESSAGE(optional_row, "Select didn't return any row");
 
-    compare_row(selectRow, rowPattern);
+    compare_row(*optional_row, rowPattern);
     DB::Row name_duplicate = rowPattern;
     name_duplicate.data = createDefaultPass();
     name_duplicate.dataSize = name_duplicate.data.size();