~kiwec/ke

ke/test/TestUtils.h -rw-r--r-- 435 bytes
1cc8481d — Wolf Clément Fix compilation 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.h"
#include "../src/Line.h"

/// 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;
  }
};