blob: e89732e184dd5a26fd98831c1a4378b58a098b14 [file] [log] [blame]
Shih-wei Liao5460a1f2012-03-16 22:41:16 -07001//===- FactoriesTest.h ----------------------------------------------------===//
2//
3// The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9#ifndef FACTORIES_TEST_H
10#define FACTORIES_TEST_H
11#include <gtest.h>
12#include "mcld/ADT/TreeAllocator.h"
13#include "mcld/MC/MCLDFile.h"
14
Stephen Hines37b74a32014-11-26 18:48:20 -080015namespace mcldtest {
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070016
17/** \class FactoriesTest
18 * \brief Test cases for factories - NodeFactory and MCLDFileFactory.
19 *
Stephen Hines551ae4e2014-04-24 14:41:24 -070020 * \see Factories
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070021 */
Stephen Hines37b74a32014-11-26 18:48:20 -080022class FactoriesTest : public ::testing::Test {
23 public:
24 // Constructor can do set-up work for all test here.
25 FactoriesTest();
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070026
Stephen Hines37b74a32014-11-26 18:48:20 -080027 // Destructor can do clean-up work that doesn't throw exceptions here.
28 virtual ~FactoriesTest();
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070029
Stephen Hines37b74a32014-11-26 18:48:20 -080030 // SetUp() will be called immediately before each test.
31 virtual void SetUp();
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070032
Stephen Hines37b74a32014-11-26 18:48:20 -080033 // TearDown() will be called immediately after each test.
34 virtual void TearDown();
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070035
Stephen Hines37b74a32014-11-26 18:48:20 -080036 protected:
37 typedef mcld::NodeFactory<int> NodeAlloc;
38 typedef mcld::MCLDFileFactory FileAlloc;
39
40 protected:
41 NodeAlloc* m_pNodeAlloc;
42 FileAlloc* m_pFileAlloc;
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070043};
44
Stephen Hines37b74a32014-11-26 18:48:20 -080045} // namespace of mcldtest
Shih-wei Liao5460a1f2012-03-16 22:41:16 -070046
47#endif