File: ArrayTypeTest.hh

package info (click to toggle)
tyvis 20031216-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,024 kB
  • ctags: 2,985
  • sloc: cpp: 22,881; sh: 8,372; makefile: 353
file content (65 lines) | stat: -rw-r--r-- 1,539 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef ARRAY_TYPE_TEST_HH
#define ARRAY_TYPE_TEST_HH

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <string>
using std::string;

class ArrayTypeInfo;
class ArrayType;

class ArrayTypeTest : public CppUnit::TestFixture {
  CPPUNIT_TEST_SUITE( ArrayTypeTest);
  CPPUNIT_TEST( testConcatenation );
  CPPUNIT_TEST( testConstructor );
  CPPUNIT_TEST( testInsertion );
  CPPUNIT_TEST( testAnd );
  CPPUNIT_TEST( testNand );
  CPPUNIT_TEST( testOr );
  CPPUNIT_TEST( testNor );
  CPPUNIT_TEST( testNot );
  CPPUNIT_TEST( testXor );
  CPPUNIT_TEST( testXnor );
  CPPUNIT_TEST( testSLL );
  CPPUNIT_TEST( testSRL );
  CPPUNIT_TEST_SUITE_END();

public:

  void setUp();
  void tearDown();

  void testConstructor();
  void testConcatenation();
  void testInsertion();
  void testConcatenationTwoArrays();
  void testAnd();
  void testNand();
  void testOr();
  void testNor();
  void testNot();
  void testXor();
  void testXnor();
  void testSLL();
  void testSRL();

private:

  static const ArrayTypeInfo *getStringTypeInfo();
  static const ArrayTypeInfo *buildStringTypeInfo();
  static const ArrayTypeInfo *getBV4TypeInfo();
  static const ArrayTypeInfo *buildBV4TypeInfo();

  static ArrayType *initBitArray( const string &initPattern );
  static void initBitArray( ArrayType &toInit, const string &initPattern );

  const ArrayType *allOnes;
  const ArrayType *allZeros;
  const ArrayType *middleOnes;
  const ArrayType *middleZeros;

  static void fillArray( const ArrayType &toFill );
};

#endif