LRAUV  revA
CodedStr_Test.h
Go to the documentation of this file.
1 
9 #ifndef _CODEDSTR_TEST_H_
10 #define _CODEDSTR_TEST_H_
11 
12 #include "utils/CodedStr.h"
13 #include "utils/Str.h"
14 
15 #include <cxxtest/TestSuite.h>
16 
22 class CodedStr_Test : public CxxTest::TestSuite
23 {
24 public:
25 
27  void testRead( void )
28  {
29  Str str( " code=0026 name=\"DVL_micro\"\n" );
30  StrIOStream strIOStream( str );
31 
32  CodedStr* codedStr = CodedStr::Read( strIOStream );
33  TS_ASSERT( NULL != codedStr );
34  if( NULL != codedStr )
35  {
36  TS_ASSERT_EQUALS( codedStr->getCode(), 0x0026 );
37  TS_ASSERT_SAME_DATA( codedStr->cStr(), "DVL_micro", 10 );
38  delete codedStr;
39  }
40 
41  }
42 };
43 
44 #endif // _CODEDSTR_TEST_H
Units tests for class CodedStr
Definition: CodedStr_Test.h:22
Extends the Str class, adding an unsigned short code (actually, the codes are limited to 14 bits...
Definition: CodedStr.h:23
Wraps a Str with an IOStream class.
Definition: StrIOStream.h:24
Replacement for standard template class string.
Definition: Str.h:12
void testRead(void)
CodedStr::Read Unit Test.
Definition: CodedStr_Test.h:27
const char * cStr() const
Definition: Str.h:188
Contains the CodedStr class declaration.
static CodedStr * Read(InStream &inStream)
Definition: CodedStr.cpp:39
unsigned short getCode() const
Definition: CodedStr.h:31