-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BICBridgeGRPCService Testing Methods Development #33
base: master
Are you sure you want to change the base?
Conversation
// Finally assemble the server. | ||
gRPCServer = builder.BuildAndStart(); | ||
std::cout << "Server listening on " << server_address << std::endl; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove extra whitespace
|
||
// Check that when no bridges are connected, listBridges can be called without any error | ||
EXPECT_EQ(val.ok(), true); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check that no bridges were returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check both that the grpc call succeed (which is what you're doing (val.ok is true) but also that the reply is what you expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more comments
|
||
// Per-test teardown | ||
// Called after each test | ||
void TearDown() override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we tear down the device/bridge/info services? I think so? Everything put together in setup should be freed in my opinion.
} | ||
|
||
// Resources shared by all tests. | ||
static cortec::implantapi::CExternalUnitInfo* unitInfo1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make these public variables and refer to them in tests as BICBridgeGRPCServiceTests.uintInfo1 (etc)
// Mock of a IImplantFactory object | ||
MockIImplantFactory* BICBridgeGRPCServiceTest::mockManager = nullptr; | ||
|
||
TEST_F(BICBridgeGRPCServiceTest, ListBridgesWithoutConnections) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may(tbd?) need to update this to be TEST_F(BICBridgeGRPCServiceTest theTestEnv, ...) to refer to the testenv to refer to the (now) public variables e.g. unitInfo1.
int myFunct(int x, int y)
{
return x+y;
}
|
||
// Check that when one bridge is connected, scanBridges can be called without any error | ||
EXPECT_EQ(val.ok(), true); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expect eq(reply->bridge_size(), 1) I think
|
||
// Check that when no bridges are connected, describeBridge can be called without any error | ||
EXPECT_EQ(val.ok(), true); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check that list is zero length? some other status check?
Moved back to draft status after student graduated without addressing final comments. |
Add in mock IImplant and IImplantFactory as well as tests for BICBridgeGRPCService