ChecksumDebugEvent.hh 1.65 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
// (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.

#ifndef BASE_CHECKSUMCOUNT_HH_INCLUDE
#define BASE_CHECKSUMCOUNT_HH_INCLUDE

14
15
16
#include <Base/Debug/DebOut.hh>
#include <Base/Test/IChecksum.hh>

17
18
19
20
21
#if defined(TEST_ON) && defined(DEB_ON)

// The functions in this file are used to count the number of errors and warnings
// and makes sense only if both the debug and test macro are on.

22
23
24
25
namespace Base {
struct CodeLink;
}//namespace Base

26
27
namespace Test {
namespace Checksum {
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
namespace Debug {

class Event : public IChecksum
{
public:
  Event(const char* _name) : IChecksum(_name), nmbr_(0) {}

  virtual void record(const std::string& _evnt, const Base::CodeLink& _lnk);

  virtual Severity compare(
    IStream& _str0, //!<[in] First stream with checksum data
    IStream& _str1, //!<[in] Second stream with checksum data
    OStream& _os,   //!<[out] Description of the difference.
    const Path* _dir0 = nullptr, //!<[in] FIrst test directory
    const Path* _dir1 = nullptr  //!<[in] Second test directory
    ) const;
  
  virtual void record_number() const;
46

47
48
49
protected:
  int nmbr_;
};
50

51
52
extern Event error;
extern Event warning;
53

54
}//namespace Debug
55
56
57
58
59
60
61
}//namespace Checksum
}//namespace Test

#endif//defined(TEST_ON) && defined(DEB_ON)

#endif//BASE_CHECKSUMCOUNT_HH_INCLUDE