|
@@ -138,6 +138,7 @@ TEST(Put, Positive) {
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
|
message["size"] = 1337;
|
|
|
+ message["chunks"] = 1;
|
|
|
|
|
|
ON_CALL(fileManager, openPutFile(testing::_))
|
|
|
.WillByDefault(testing::Return(true));
|
|
@@ -162,6 +163,7 @@ TEST(Put, Negative) {
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
|
message["size"] = 1337;
|
|
|
+ message["chunks"] = 1;
|
|
|
|
|
|
ON_CALL(fileManager, openPutFile(testing::_))
|
|
|
.WillByDefault(testing::Return(false));
|
|
@@ -188,6 +190,8 @@ TEST(Putdata, Positive) {
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
|
message["size"] = 1337;
|
|
|
+ const int chunks = 3;
|
|
|
+ message["chunks"] = chunks;
|
|
|
|
|
|
ON_CALL(fileManager, openPutFile(testing::_))
|
|
|
.WillByDefault(testing::Return(true));
|
|
@@ -207,7 +211,7 @@ TEST(Putdata, Positive) {
|
|
|
ON_CALL(fileManager, getPutBaseFileName())
|
|
|
.WillByDefault(testing::Return(filename));
|
|
|
|
|
|
- for (int remaining = 2; remaining >= 0; remaining--) {
|
|
|
+ for (int remaining = chunks - 1; remaining >= 0; remaining--) {
|
|
|
message = Json::Value();
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
@@ -238,6 +242,8 @@ TEST(Putdata, Cancel) {
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
|
message["size"] = 1337;
|
|
|
+ const int chunks = 3;
|
|
|
+ message["chunks"] = chunks;
|
|
|
|
|
|
ON_CALL(fileManager, openPutFile(testing::_))
|
|
|
.WillByDefault(testing::Return(true));
|
|
@@ -257,7 +263,7 @@ TEST(Putdata, Cancel) {
|
|
|
ON_CALL(fileManager, getPutBaseFileName())
|
|
|
.WillByDefault(testing::Return(filename));
|
|
|
|
|
|
- int remaining = 2;
|
|
|
+ int remaining = chunks - 1;
|
|
|
message = Json::Value();
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
@@ -304,6 +310,8 @@ TEST(Putdata, WrongRemaining) {
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|
|
|
message["size"] = 1337;
|
|
|
+ const int chunks = 3;
|
|
|
+ message["chunks"] = chunks;
|
|
|
|
|
|
ON_CALL(fileManager, openPutFile(testing::_))
|
|
|
.WillByDefault(testing::Return(true));
|
|
@@ -323,7 +331,7 @@ TEST(Putdata, WrongRemaining) {
|
|
|
ON_CALL(fileManager, getPutBaseFileName())
|
|
|
.WillByDefault(testing::Return(filename));
|
|
|
|
|
|
- int remaining = 2;
|
|
|
+ int remaining = chunks - 1;
|
|
|
message = Json::Value();
|
|
|
message["command"] = command;
|
|
|
message["file"] = filename;
|