mrfioc2  2.3.0
Classes | Functions | Variables
linkoptionsTest.c File Reference
#include <stdio.h>
#include <string.h>
#include "linkoptions.h"
#include "epicsUnitTest.h"
#include "epicsString.h"
#include "testMain.h"
Include dependency graph for linkoptionsTest.c:

Go to the source code of this file.

Classes

struct  adev
 

Functions

 MAIN (linkoptionsTest)
 

Variables

const char one [] ="BEE=4.2, A=42, Color=Green, name=fred"
 
const char two [] ="BEE=2.4, Color=Blue, name=ralph"
 

Function Documentation

◆ MAIN()

MAIN ( linkoptionsTest  )

Definition at line 42 of file linkoptionsTest.c.

43 {
44  (void)argc;
45  (void)argv;
46 
47  struct adev X;
48 
49  testPlan(10);
50 
51  X.a=0;
52  X.b=0.0;
53  X.c[0]='\0';
54  X.d=0;
55 
56  testOk1(linkOptionsStore(myStructDef, &X, one, 0)==0);
57 
58  testOk1(X.a==42);
59  testOk1(X.b==4.2);
60  testOk1(strcmp(X.c, "fred")==0);
61  testOk1(X.d==2);
62 
63  X.a=14;
64  X.b=0.0;
65  X.c[0]='\0';
66  X.d=0;
67 
68  testOk1(linkOptionsStore(myStructDef, &X, two, 0)==0);
69 
70  testOk1(X.a==14);
71  testOk1(X.b==2.4);
72  testOk1(strcmp(X.c, "ralph")==0);
73  testOk1(X.d==3);
74 
75  return 0;
76 }
int epicsShareAPI linkOptionsStore(const linkOptionDef *opts, void *user, const char *str, int options)
Parse a string a store the result.
Definition: linkoptions.c:135
const char two[]
const char one[]

Variable Documentation

◆ one

const char one[] ="BEE=4.2, A=42, Color=Green, name=fred"

Definition at line 39 of file linkoptionsTest.c.

◆ two

const char two[] ="BEE=2.4, Color=Blue, name=ralph"

Definition at line 40 of file linkoptionsTest.c.