added test for set, better error messages

This commit is contained in:
john30
2014-11-22 08:44:24 +01:00
parent 80c42df040
commit 75eb227ade
+12 -7
View File
@@ -84,11 +84,15 @@ int main()
{"x;;bcd", "99", "10feffff0199", "00", ""},
{"x;;bcd", "-", "10feffff01ff", "00", ""},
{"x;;bcd", "", "10feffff019a", "00", "rw"},
{"x;16;uch", "15", "10feffff11000102030405060708090a0b0c0d0e0f10", "00", "W"},
{"x;16;uch", "15", "10feffff11000102030405060708090a0b0c0d0e0f10", "00", "W"},
{"x;17;uch", "", "10feffff00", "00", "c"},
{"x;s3;uch", "2", "1025ffff0310111213", "0300010203", "W"},
{"x;s3;uch", "2", "1025ffff00", "00000002", ""},
{"x;s3;uch;;;;y;m2;uch", "2;3","1025ffff020003", "00000002", ""},
{"x;s3;uch", "2", "1025ffff0310111213", "0300010203", "W"},
{"x;s3;uch", "2", "1025ffff00", "03000002", ""},
{"x;3;uch", "2", "1025ffff03010101", "03000002", "W"},
{"x;3;uch", "1", "1025ffff03010101", "03000002", "sW"},
{"x;1;uch", "2", "1025ffff00", "0102", ""},
{"x;1;uch", "1", "1025ffff0101", "00", "s"},
{"x;s3;uch;;;;y;m2;uch", "2;3","1025ffff020003", "03000002", ""},
{"x;;uch", "38", "10feffff0126", "00", ""},
{"x;;uch", "0", "10feffff0100", "00", ""},
{"x;;uch", "254", "10feffff01fe", "00", ""},
@@ -225,17 +229,18 @@ int main()
else
std::cout << "\"" << check[0] << "\": failed create OK" << std::endl;
continue;
} else if (result != RESULT_OK) {
}
if (result != RESULT_OK) {
std::cout << "\"" << check[0] << "\": create error: "
<< getResultCode(result) << std::endl;
continue;
}
if (fields == NULL) {
std::cout << "\"" << check[0] << "\": create error: empty" << std::endl;
std::cout << "\"" << check[0] << "\": create error: NULL" << std::endl;
continue;
}
if (it != entries.end()) {
std::cout << "\"" << check[0] << "\": create error: non-empty" << std::endl;
std::cout << "\"" << check[0] << "\": create error: trailing input" << std::endl;
continue;
}
std::cout << "\"" << check[0] << "\": create OK" << std::endl;