OILS / mycpp / test_common.h View on Github | oilshell.org

24 lines, 14 significant
1// For unit tests only
2
3#ifndef TEST_COMMON_H
4#define TEST_COMMON_H
5
6#include "mycpp/gc_obj.h"
7
8class Point {
9 public:
10 Point(int x, int y) : x_(x), y_(y) {
11 }
12 int size() {
13 return x_ + y_;
14 }
15
16 static constexpr ObjHeader obj_header() {
17 return ObjHeader::ClassFixed(kZeroMask, sizeof(Point));
18 }
19
20 int x_;
21 int y_;
22};
23
24#endif // TEST_COMMON_H