Skip to content

Commit e65a864

Browse files
committed
Add basic Echo client test
1 parent 53d3c8e commit e65a864

File tree

4 files changed

+224
-0
lines changed

4 files changed

+224
-0
lines changed

ipc/include/aws/greengrass/GreengrassCoreIpcModel.h

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,6 +2438,11 @@ namespace Aws
24382438
{
24392439
return static_cast<SubscribeToIoTCoreResponse *>(m_taggedResult.GetOperationResponse());
24402440
}
2441+
/**
2442+
* @return true if the response is associated with an expected response;
2443+
* false if the response is associated with an error.
2444+
*/
2445+
operator bool() const noexcept { return m_taggedResult == true; }
24412446
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
24422447
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
24432448
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2487,6 +2492,11 @@ namespace Aws
24872492
{
24882493
return static_cast<PublishToIoTCoreResponse *>(m_taggedResult.GetOperationResponse());
24892494
}
2495+
/**
2496+
* @return true if the response is associated with an expected response;
2497+
* false if the response is associated with an error.
2498+
*/
2499+
operator bool() const noexcept { return m_taggedResult == true; }
24902500
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
24912501
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
24922502
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2568,6 +2578,11 @@ namespace Aws
25682578
{
25692579
return static_cast<SubscribeToConfigurationUpdateResponse *>(m_taggedResult.GetOperationResponse());
25702580
}
2581+
/**
2582+
* @return true if the response is associated with an expected response;
2583+
* false if the response is associated with an error.
2584+
*/
2585+
operator bool() const noexcept { return m_taggedResult == true; }
25712586
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
25722587
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
25732588
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2617,6 +2632,11 @@ namespace Aws
26172632
{
26182633
return static_cast<DeleteThingShadowResponse *>(m_taggedResult.GetOperationResponse());
26192634
}
2635+
/**
2636+
* @return true if the response is associated with an expected response;
2637+
* false if the response is associated with an error.
2638+
*/
2639+
operator bool() const noexcept { return m_taggedResult == true; }
26202640
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
26212641
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
26222642
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2667,6 +2687,11 @@ namespace Aws
26672687
{
26682688
return static_cast<DeferComponentUpdateResponse *>(m_taggedResult.GetOperationResponse());
26692689
}
2690+
/**
2691+
* @return true if the response is associated with an expected response;
2692+
* false if the response is associated with an error.
2693+
*/
2694+
operator bool() const noexcept { return m_taggedResult == true; }
26702695
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
26712696
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
26722697
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2743,6 +2768,11 @@ namespace Aws
27432768
return static_cast<SubscribeToValidateConfigurationUpdatesResponse *>(
27442769
m_taggedResult.GetOperationResponse());
27452770
}
2771+
/**
2772+
* @return true if the response is associated with an expected response;
2773+
* false if the response is associated with an error.
2774+
*/
2775+
operator bool() const noexcept { return m_taggedResult == true; }
27462776
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
27472777
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
27482778
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2792,6 +2822,11 @@ namespace Aws
27922822
{
27932823
return static_cast<GetConfigurationResponse *>(m_taggedResult.GetOperationResponse());
27942824
}
2825+
/**
2826+
* @return true if the response is associated with an expected response;
2827+
* false if the response is associated with an error.
2828+
*/
2829+
operator bool() const noexcept { return m_taggedResult == true; }
27952830
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
27962831
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
27972832
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2877,6 +2912,11 @@ namespace Aws
28772912
{
28782913
return static_cast<SubscribeToTopicResponse *>(m_taggedResult.GetOperationResponse());
28792914
}
2915+
/**
2916+
* @return true if the response is associated with an expected response;
2917+
* false if the response is associated with an error.
2918+
*/
2919+
operator bool() const noexcept { return m_taggedResult == true; }
28802920
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
28812921
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
28822922
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2926,6 +2966,11 @@ namespace Aws
29262966
{
29272967
return static_cast<GetComponentDetailsResponse *>(m_taggedResult.GetOperationResponse());
29282968
}
2969+
/**
2970+
* @return true if the response is associated with an expected response;
2971+
* false if the response is associated with an error.
2972+
*/
2973+
operator bool() const noexcept { return m_taggedResult == true; }
29292974
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
29302975
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
29312976
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -2974,6 +3019,11 @@ namespace Aws
29743019
{
29753020
return static_cast<PublishToTopicResponse *>(m_taggedResult.GetOperationResponse());
29763021
}
3022+
/**
3023+
* @return true if the response is associated with an expected response;
3024+
* false if the response is associated with an error.
3025+
*/
3026+
operator bool() const noexcept { return m_taggedResult == true; }
29773027
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
29783028
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
29793029
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3022,6 +3072,11 @@ namespace Aws
30223072
{
30233073
return static_cast<ListComponentsResponse *>(m_taggedResult.GetOperationResponse());
30243074
}
3075+
/**
3076+
* @return true if the response is associated with an expected response;
3077+
* false if the response is associated with an error.
3078+
*/
3079+
operator bool() const noexcept { return m_taggedResult == true; }
30253080
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
30263081
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
30273082
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3070,6 +3125,11 @@ namespace Aws
30703125
{
30713126
return static_cast<CreateDebugPasswordResponse *>(m_taggedResult.GetOperationResponse());
30723127
}
3128+
/**
3129+
* @return true if the response is associated with an expected response;
3130+
* false if the response is associated with an error.
3131+
*/
3132+
operator bool() const noexcept { return m_taggedResult == true; }
30733133
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
30743134
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
30753135
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3118,6 +3178,11 @@ namespace Aws
31183178
{
31193179
return static_cast<GetThingShadowResponse *>(m_taggedResult.GetOperationResponse());
31203180
}
3181+
/**
3182+
* @return true if the response is associated with an expected response;
3183+
* false if the response is associated with an error.
3184+
*/
3185+
operator bool() const noexcept { return m_taggedResult == true; }
31213186
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
31223187
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
31233188
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3169,6 +3234,11 @@ namespace Aws
31693234
{
31703235
return static_cast<SendConfigurationValidityReportResponse *>(m_taggedResult.GetOperationResponse());
31713236
}
3237+
/**
3238+
* @return true if the response is associated with an expected response;
3239+
* false if the response is associated with an error.
3240+
*/
3241+
operator bool() const noexcept { return m_taggedResult == true; }
31723242
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
31733243
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
31743244
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3217,6 +3287,11 @@ namespace Aws
32173287
{
32183288
return static_cast<UpdateThingShadowResponse *>(m_taggedResult.GetOperationResponse());
32193289
}
3290+
/**
3291+
* @return true if the response is associated with an expected response;
3292+
* false if the response is associated with an error.
3293+
*/
3294+
operator bool() const noexcept { return m_taggedResult == true; }
32203295
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
32213296
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
32223297
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3265,6 +3340,11 @@ namespace Aws
32653340
{
32663341
return static_cast<UpdateConfigurationResponse *>(m_taggedResult.GetOperationResponse());
32673342
}
3343+
/**
3344+
* @return true if the response is associated with an expected response;
3345+
* false if the response is associated with an error.
3346+
*/
3347+
operator bool() const noexcept { return m_taggedResult == true; }
32683348
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
32693349
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
32703350
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3316,6 +3396,11 @@ namespace Aws
33163396
{
33173397
return static_cast<ValidateAuthorizationTokenResponse *>(m_taggedResult.GetOperationResponse());
33183398
}
3399+
/**
3400+
* @return true if the response is associated with an expected response;
3401+
* false if the response is associated with an error.
3402+
*/
3403+
operator bool() const noexcept { return m_taggedResult == true; }
33193404
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
33203405
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
33213406
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3364,6 +3449,11 @@ namespace Aws
33643449
{
33653450
return static_cast<RestartComponentResponse *>(m_taggedResult.GetOperationResponse());
33663451
}
3452+
/**
3453+
* @return true if the response is associated with an expected response;
3454+
* false if the response is associated with an error.
3455+
*/
3456+
operator bool() const noexcept { return m_taggedResult == true; }
33673457
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
33683458
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
33693459
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3415,6 +3505,11 @@ namespace Aws
34153505
{
34163506
return static_cast<GetLocalDeploymentStatusResponse *>(m_taggedResult.GetOperationResponse());
34173507
}
3508+
/**
3509+
* @return true if the response is associated with an expected response;
3510+
* false if the response is associated with an error.
3511+
*/
3512+
operator bool() const noexcept { return m_taggedResult == true; }
34183513
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
34193514
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
34203515
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3463,6 +3558,11 @@ namespace Aws
34633558
{
34643559
return static_cast<GetSecretValueResponse *>(m_taggedResult.GetOperationResponse());
34653560
}
3561+
/**
3562+
* @return true if the response is associated with an expected response;
3563+
* false if the response is associated with an error.
3564+
*/
3565+
operator bool() const noexcept { return m_taggedResult == true; }
34663566
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
34673567
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
34683568
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3511,6 +3611,11 @@ namespace Aws
35113611
{
35123612
return static_cast<UpdateStateResponse *>(m_taggedResult.GetOperationResponse());
35133613
}
3614+
/**
3615+
* @return true if the response is associated with an expected response;
3616+
* false if the response is associated with an error.
3617+
*/
3618+
operator bool() const noexcept { return m_taggedResult == true; }
35143619
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
35153620
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
35163621
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3562,6 +3667,11 @@ namespace Aws
35623667
{
35633668
return static_cast<ListNamedShadowsForThingResponse *>(m_taggedResult.GetOperationResponse());
35643669
}
3670+
/**
3671+
* @return true if the response is associated with an expected response;
3672+
* false if the response is associated with an error.
3673+
*/
3674+
operator bool() const noexcept { return m_taggedResult == true; }
35653675
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
35663676
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
35673677
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3643,6 +3753,11 @@ namespace Aws
36433753
{
36443754
return static_cast<SubscribeToComponentUpdatesResponse *>(m_taggedResult.GetOperationResponse());
36453755
}
3756+
/**
3757+
* @return true if the response is associated with an expected response;
3758+
* false if the response is associated with an error.
3759+
*/
3760+
operator bool() const noexcept { return m_taggedResult == true; }
36463761
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
36473762
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
36483763
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3694,6 +3809,11 @@ namespace Aws
36943809
{
36953810
return static_cast<ListLocalDeploymentsResponse *>(m_taggedResult.GetOperationResponse());
36963811
}
3812+
/**
3813+
* @return true if the response is associated with an expected response;
3814+
* false if the response is associated with an error.
3815+
*/
3816+
operator bool() const noexcept { return m_taggedResult == true; }
36973817
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
36983818
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
36993819
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3742,6 +3862,11 @@ namespace Aws
37423862
{
37433863
return static_cast<StopComponentResponse *>(m_taggedResult.GetOperationResponse());
37443864
}
3865+
/**
3866+
* @return true if the response is associated with an expected response;
3867+
* false if the response is associated with an error.
3868+
*/
3869+
operator bool() const noexcept { return m_taggedResult == true; }
37453870
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
37463871
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
37473872
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }
@@ -3792,6 +3917,11 @@ namespace Aws
37923917
{
37933918
return static_cast<CreateLocalDeploymentResponse *>(m_taggedResult.GetOperationResponse());
37943919
}
3920+
/**
3921+
* @return true if the response is associated with an expected response;
3922+
* false if the response is associated with an error.
3923+
*/
3924+
operator bool() const noexcept { return m_taggedResult == true; }
37953925
OperationError *GetOperationError() const noexcept { return m_taggedResult.GetOperationError(); }
37963926
RpcError GetRpcError() const noexcept { return m_taggedResult.GetRpcError(); }
37973927
ResultType GetResultType() const noexcept { return m_taggedResult.GetResultType(); }

ipc/tests/DefaultConnectionConfig.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <awstest/EchoTestRpcClient.h>
2+
3+
namespace Awstest
4+
{
5+
DefaultConnectionConfig::DefaultConnectionConfig() noexcept
6+
{
7+
m_hostName = Aws::Crt::String("127.0.0.1");
8+
m_port = 8033;
9+
m_socketDomain = Aws::Crt::Io::SocketDomain::IPv4;
10+
m_socketType = Aws::Crt::Io::SocketType::Stream;
11+
}
12+
} // namespace Awstest

0 commit comments

Comments
 (0)