AWS IoT Device SDK C: Shadow
AWS IoT Device Shadow library
Return to main page ↑
aws_iot_tests_shadow_system.c File Reference

Full system tests for the AWS IoT Shadow library. More...

#include "iot_config.h"
#include <stdio.h>
#include <string.h>
#include "iot_init.h"
#include "private/aws_iot_shadow_internal.h"
#include "aws_iot_doc_parser.h"
#include "platform/iot_clock.h"
#include "platform/iot_threads.h"
#include <IOT_TEST_NETWORK_HEADER>
#include "iot_mqtt.h"
#include "unity_fixture.h"

Data Structures

struct  _operationCompleteParams_t
 Parameter 1 of _operationComplete.
 

Macros

#define THING_NAME_LENGTH   ( sizeof( AWS_IOT_TEST_SHADOW_THING_NAME ) - 1 )
 The length of AWS_IOT_TEST_SHADOW_THING_NAME.
 
#define TEST_SHADOW_DOCUMENT   "{\"state\":{\"reported\":{\"key\":\"value\"}},\"clientToken\":\"shadowtest\"}"
 The Shadow document used for these tests.
 
#define TEST_SHADOW_DOCUMENT_LENGTH   ( sizeof( TEST_SHADOW_DOCUMENT ) - 1 )
 The length of TEST_SHADOW_DOCUMENT.
 

Functions

static void _operationComplete (void *pArgument, AwsIotShadowCallbackParam_t *pOperation)
 Shadow operation completion callback function. Checks parameters and unblocks the main test thread.
 
static void _deltaCallback (void *pArgument, AwsIotShadowCallbackParam_t *pCallback)
 Shadow delta callback. Checks parameters and unblocks the main test thread.
 
static void _updatedCallback (void *pArgument, AwsIotShadowCallbackParam_t *pCallback)
 Shadow updated callback. Checks parameters and unblocks the main test thread.
 
static void _updateGetDeleteAsync (IotMqttQos_t qos)
 Run the Update-Get-Delete asynchronous tests at various QoS.
 
static void _updateGetDeleteBlocking (IotMqttQos_t qos)
 Run the Update-Get-Delete blocking tests at various QoS.
 
static void _setupShadowTests ()
 Initializes libraries and establishes an MQTT connection for the Shadow tests.
 
static void _cleanupShadowTests ()
 Cleans up libraries and closes the MQTT connection for the Shadow tests.
 
 TEST_GROUP (Shadow_System)
 Test group for Shadow system tests.
 
 TEST_SETUP (Shadow_System)
 Test setup for Shadow system tests.
 
 TEST_TEAR_DOWN (Shadow_System)
 Test tear down for Shadow system tests.
 
 TEST_GROUP_RUNNER (Shadow_System)
 Test group runner for Shadow system tests.
 
void TEST_Shadow_System_UpdateGetDeleteAsyncQoS0_ (void)
 Update-Get-Delete asynchronous (QoS 0).
 
void TEST_Shadow_System_UpdateGetDeleteAsyncQoS1_ (void)
 Update-Get-Delete asynchronous (QoS 1).
 
void TEST_Shadow_System_UpdateGetDeleteBlockingQoS0_ (void)
 Update-Get-Delete blocking (QoS 0).
 
void TEST_Shadow_System_UpdateGetDeleteBlockingQoS1_ (void)
 Update-Get-Delete blocking (QoS 1).
 
void TEST_Shadow_System_DeltaCallback_ (void)
 Tests the Shadow delta callback.
 
void TEST_Shadow_System_UpdatedCallback_ (void)
 Tests the Shadow updated callback.
 

Variables

static const struct IotNetworkServerInfo _serverInfo = IOT_TEST_NETWORK_SERVER_INFO_INITIALIZER
 Network server info to share among the tests.
 
static IotMqttConnection_t _mqttConnection = IOT_MQTT_CONNECTION_INITIALIZER
 Network credential info to share among the tests. More...
 

Detailed Description

Full system tests for the AWS IoT Shadow library.

Variable Documentation

◆ _mqttConnection

Network credential info to share among the tests.

An MQTT connection to share among the tests.