trick/test/SIM_test_varserv/models/varserv/include/VS.hh
Jacqueline Deans 9c8799610f
Variable Server - var_send_once and integration test (#1330)
* Adds the send_once command and message type, which allows a user to request a variable to be sent immediately and only once (intended to replace the var_add, var_send, var_clear idiom that is commonly used for this purpose)
* Minor refactoring of variable server internals to reduce repeated code
* Adds SIM_test_varserv to integration test to test basic variable server functionality
* Changes graphics client for SIM_billiards to use var_send_once as an example of intended use
* Add documentation for var_send_once in docs and tutorial
* Set exit_code_enabled in trick unit tests to be true by default
* Patch for failing bookworm build
2022-08-18 10:47:07 -05:00

65 lines
1.3 KiB
C++

/********************************* TRICK HEADER *******************************
PURPOSE: ( Variable server test )
REFERENCES: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
PROGRAMMERS: ( (Lindsay Landry) (L3) (9-12-2013) )
********************************************************************************/
#include <wchar.h>
#include <string.h>
#include "trick_utils/comm/include/tc.h"
#include "trick_utils/comm/include/tc_proto.h"
#ifndef VS_HH
#define VS_HH
class VSTest {
public:
unsigned short port_num;
const char * hostest;
char got_read[80];
double cycle_rate;
TCDevice comm_device;
char a;
unsigned char b;
short c;
unsigned short d;
int e; /* m xy-position */
unsigned int f;
long g;
unsigned long h;
float i;
double j;
long long k;
unsigned long long l;
bool m;
int n[5];
VSTest();
~VSTest();
int init();
int default_vars();
int vs_write(char* cmd_buffer);
int vs_read();
void printLine();
int shutdown();
// TEST FUNCTIONS
int testAddRemove();
int testExists();
int testPause();
int testSendOnce();
int testUnits();
private:
int get_line(char* thing);
int strcmp_IgnoringWhiteSpace(const char* s1, const char* s2);
};
#endif