Commit ac3d2db8 authored by John Parent's avatar John Parent
Browse files

Forward decl test

parent f14721ad
Pipeline #232643 failed with stages
in 18 minutes and 32 seconds
......@@ -7,12 +7,6 @@
// Could clearly be solved by an include here, not in all cases.
class Type;
template <typename T>
class Stump
{
};
class Datum
{
public:
......@@ -23,7 +17,4 @@ private:
Type* l;
};
template <typename T>
void stumpy(Stump<T> a) {}
#endif // DATUM
import unittest
import sys
from datamod import Type, Datum
class TestForwardDeclHandle(unittest.TestCase):
def test_type(self):
t = Type()
self.assertEqual(t.i, 10)
def test_Datum(self):
t = Type()
d = Datum()
d.set_type(t)
self.assertEqual(d.get_type().i, 10)
if __name__ == "__main__":
unittest.main()
......@@ -4,7 +4,8 @@
class Type
{
public:
Type() {}
Type() {this->i = 10;}
int i;
};
......
......@@ -2,14 +2,6 @@ files:
datum.h:
classes:
Datum:
Stump:
inst:
- int
- float
functions:
stumpy:
inst:
- int
type.h:
classes:
Type:
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment