ChecksumFile.hh 1.22 KB
Newer Older
1 2 3 4 5 6 7 8 9
// (C) Copyright 2016 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk,  Inc.,  and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of  this information  by  anyone  other  than  authorized
// employees of Autodesk, Inc.  is granted  only under a written
// non-disclosure agreement,  expressly  prescribing  the  scope
// and manner of such use.
10 11
#ifndef BASE_CHECKSUMFILE_HH_INCLUDE
#define BASE_CHECKSUMFILE_HH_INCLUDE
12

13 14
#ifdef TEST_ON

15
#include <Base/Test/Checksum.hh>
16 17

namespace Test {
18 19 20 21 22
namespace Checksum {

/*!
checksum for output files. It has a method record that add a file hash.
*/
23
class File : public Object
24 25
{
public:
26
  enum TagUsed { TAG_USED };
27

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

31
  void record(const char* _flnm);
32 33

  static const char* tag() { return "-file"; }
34
};
35 36


37 38
}//namespace Checksum
}//namespace Test
39

40 41 42 43 44 45 46
#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) 

47
#endif//TEST_ON
48

49
#endif//BASE_CHECKSUMFILE_HH_INCLUDE