ChecksumFile.hh 832 Bytes
Newer Older
1
// (C) Copyright 2016 by Autodesk, Inc.
2

3 4
#ifndef BASE_CHECKSUMFILE_HH_INCLUDE
#define BASE_CHECKSUMFILE_HH_INCLUDE
5

6 7
#ifdef TEST_ON

8
#include <Base/Test/Checksum.hh>
9 10

namespace Test {
11 12 13 14 15
namespace Checksum {

/*!
checksum for output files. It has a method record that add a file hash.
*/
16
class File : public Object
17 18
{
public:
19
  enum TagUsed { TAG_USED };
20

21 22
  //! Make sure the constructor caller is aware of the tag requirement 
  File(const char* _name, TagUsed) : Object(_name) {}
23

24
  void record(const char* _flnm);
25 26

  static const char* tag() { return "-file"; }
27
};
28 29


30 31
}//namespace Checksum
}//namespace Test
32

33 34 35 36 37 38 39
#define TEST_CHECKSUM_FILE(VRBL, NAME) \
  Test::Checksum::File VRBL(NAME"-file", Test::Checksum::File::TAG_USED)

#else//TEST_ON

#define TEST_CHECKSUM_FILE(VRBL, NAME) 

40
#endif//TEST_ON
41

42
#endif//BASE_CHECKSUMFILE_HH_INCLUDE