Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit95ce5ec

Browse files
committed
remove test / mock dead code
1 parent82cd290 commit95ce5ec

File tree

5 files changed

+0
-44
lines changed

5 files changed

+0
-44
lines changed

‎contrib/test/mock-firebase.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ class MockFirebase : public FirebaseArduino {
2020
MOCK_CONST_METHOD2(begin,void (const String& host,const String& auth));
2121
};
2222

23-
24-
classMockFirebaseRequest :publicFirebaseRequest {
25-
public:
26-
MOCK_CONST_METHOD0(name,const std::string&());
27-
MOCK_CONST_METHOD0(response,const std::string&());
28-
MOCK_CONST_METHOD0(error,const FirebaseError&());
29-
};
30-
31-
classMockFirebaseStream :publicFirebaseStream {
32-
public:
33-
MOCK_METHOD0(available,bool());
34-
MOCK_METHOD1(read, Event(std::string& event));
35-
MOCK_CONST_METHOD0(error,const FirebaseError&());
36-
};
37-
3823
}// modem
3924
}// firebase
4025
#endif// TEST_MOCK_FIREBASE_H

‎contrib/test/modem/get-command_test.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ using ::testing::_;
1616
classGetCommandTest : public ::testing::Test {
1717
protected:
1818
voidSetUp()override {
19-
get_.reset(newMockFirebaseRequest());
2019
}
2120

2221
voidFeedCommand(const String& path) {
@@ -26,26 +25,20 @@ class GetCommandTest : public ::testing::Test {
2625
}
2726

2827
boolRunCommand(const FirebaseError& error) {
29-
EXPECT_CALL(*get_,error())
30-
.WillRepeatedly(ReturnRef(error));
31-
3228
GetCommandgetCmd(&fbase_);
3329
return getCmd.execute("GET", &in_, &out_);
3430
}
3531

3632
MockInputStream in_;
3733
MockOutputStream out_;
3834
MockFirebase fbase_;
39-
std::unique_ptr<MockFirebaseRequest> get_;
4035
};
4136

4237
TEST_F(GetCommandTest, gets) {
4338
const Stringpath("/test/path");
4439
FeedCommand(path);
4540

4641
const Stringvalue("Test value");
47-
EXPECT_CALL(*get_,response())
48-
.WillOnce(ReturnRef(value));
4942

5043
EXPECT_CALL(out_,print(String("+")))
5144
.WillOnce(Return(1));

‎contrib/test/modem/push-command_test.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ using ::testing::_;
1717
classPushCommandTest : public ::testing::Test {
1818
protected:
1919
voidSetUp()override {
20-
push_.reset(newMockFirebaseRequest());
2120
}
2221

2322
voidFeedCommand(const String& path,const String& data) {
@@ -41,20 +40,13 @@ class PushCommandTest : public ::testing::Test {
4140
}
4241

4342
boolRunExpectingData(const String& data,const FirebaseError& error) {
44-
EXPECT_CALL(*push_,error())
45-
.WillRepeatedly(ReturnRef(error));
46-
47-
EXPECT_CALL(fbase_,pushPtr(_,EncodeForJson(data)))
48-
.WillOnce(Return(ByMove(std::move(push_))));
49-
5043
PushCommandpushCmd(&fbase_);
5144
return pushCmd.execute("PUSH", &in_, &out_);
5245
}
5346

5447
MockInputStream in_;
5548
MockOutputStream out_;
5649
MockFirebase fbase_;
57-
std::unique_ptr<MockFirebaseRequest> push_;
5850
};
5951

6052
TEST_F(PushCommandTest, sendsData) {

‎contrib/test/modem/remove-command_test.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ using ::testing::_;
1616
classRemoveCommandTest : public ::testing::Test {
1717
protected:
1818
voidSetUp()override {
19-
remove_.reset(newMockFirebaseRequest());
2019
}
2120

2221
voidFeedCommand(const String& path) {
@@ -26,11 +25,6 @@ class RemoveCommandTest : public ::testing::Test {
2625
}
2726

2827
boolRunCommand(const FirebaseError& error) {
29-
EXPECT_CALL(*remove_,error())
30-
.WillRepeatedly(ReturnRef(error));
31-
32-
EXPECT_CALL(fbase_,removePtr(_))
33-
.WillOnce(Return(ByMove(std::move(remove_))));
3428

3529
RemoveCommandcommand(&fbase_);
3630
return command.execute("REMOVE", &in_, &out_);
@@ -39,7 +33,6 @@ class RemoveCommandTest : public ::testing::Test {
3933
MockInputStream in_;
4034
MockOutputStream out_;
4135
MockFirebase fbase_;
42-
std::unique_ptr<MockFirebaseRequest> remove_;
4336
};
4437

4538
TEST_F(RemoveCommandTest, success) {

‎contrib/test/modem/set-command_test.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ using ::testing::_;
1717
classSetCommandTest : public ::testing::Test {
1818
protected:
1919
voidSetUp()override {
20-
set_.reset(newMockFirebaseRequest());
2120
}
2221

2322
voidFeedCommand(const String& path,const String& data) {
@@ -41,11 +40,6 @@ class SetCommandTest : public ::testing::Test {
4140
}
4241

4342
boolRunExpectingData(const String& data,const FirebaseError& error) {
44-
EXPECT_CALL(*set_,error())
45-
.WillRepeatedly(ReturnRef(error));
46-
47-
EXPECT_CALL(fbase_,setPtr(_,EncodeForJson(data)))
48-
.WillOnce(Return(ByMove(std::move(set_))));
4943

5044
SetCommandsetCmd(&fbase_);
5145
return setCmd.execute("SET", &in_, &out_);
@@ -54,7 +48,6 @@ class SetCommandTest : public ::testing::Test {
5448
MockInputStream in_;
5549
MockOutputStream out_;
5650
MockFirebase fbase_;
57-
std::unique_ptr<MockFirebaseRequest> set_;
5851
};
5952

6053
TEST_F(SetCommandTest, sendsData) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp