~kiwec/ke

ref: 2133c126a17a4627ffb76143c19c287e9c272749 ke/test/TestUtils.h -rw-r--r-- 439 bytes
2133c126 — Wolf Clément Add error, info and success messages 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <string>

#define TEST_NO_MAIN
#include "acutest.h"

#include "../src/Document.hpp"
#include "../src/Line.hpp"

/// TestLine doesn't require a Text document to be created beforehand'
class TestLine : public Line {
public:
  TestLine(std::wstring text) : Line(nullptr, 0, 1) {
    m_doc = new Text();
    m_doc->insert(text.c_str(), text.length(), 0);
    calc_size();
  }
  
  ~TestLine() {
    delete m_doc;
  }
};