local v=require("cpp11_director_using_constructor")

-- Public base constructors
local a = v.PublicDerived1(0, "hi"):meth()
a = v.PublicDerived2():meth()
a = v.PublicDerived2(0, "hi"):meth()
a = v.PublicDerived3():meth()
a = v.PublicDerived3(0, "hi"):meth()
a = v.PublicDerived4():meth()
a = v.PublicDerived5():meth()

-- Protected base constructors
-- Cannot test most of these as the constructors are protected
v.ProtectedDerived5()

-- Mix of public and overloaded constructors
v.MixedDerived1a(0, "hi"):meth()
v.MixedDerived1a():meth()
v.MixedDerived1b(0, "hi"):meth()
v.MixedDerived1b():meth()
v.MixedDerived2a(0, "hi"):meth()
v.MixedDerived2a():meth()
v.MixedDerived2b(0, "hi"):meth()
v.MixedDerived2b():meth()
v.MixedDerived2c(0, "hi"):meth()
v.MixedDerived2c():meth()
v.MixedDerived2c(0):meth()
v.MixedDerived2d(0, "hi"):meth()
v.MixedDerived2d():meth()
v.MixedDerived2d(0):meth()
v.MixedDerived3a(0, "hi"):meth()
v.MixedDerived3a():meth()
v.MixedDerived3b(0, "hi"):meth()
v.MixedDerived3b():meth()
v.MixedDerived3c(0, "hi"):meth()
v.MixedDerived3c():meth()
v.MixedDerived3c(0):meth()
v.MixedDerived3d(0, "hi"):meth()
v.MixedDerived3d():meth()
v.MixedDerived3d(0):meth()
v.MixedDerived4a(0, "hi"):meth()
v.MixedDerived4a():meth()
v.MixedDerived4b(0, "hi"):meth()
v.MixedDerived4b():meth()
v.MixedDerived4c():meth()
v.MixedDerived4c(0):meth()
v.MixedDerived4d():meth()
v.MixedDerived4d(0):meth()
v.MixedDerived4e():meth()
v.MixedDerived4f():meth()

-- Mix of protected base constructors and overloading
v.ProotDerived1a():meth()
v.ProotDerived1b(0, "hi"):meth()
v.ProotDerived1b():meth()
v.ProotDerived1c(0, "hi"):meth()
v.ProotDerived1c():meth()
v.ProotDerived1d(0):meth()
v.ProotDerived1d():meth()
v.ProotDerived1e(0):meth()
v.ProotDerived1e():meth()
v.ProotDerived2a(0, "hi"):meth()
v.ProotDerived2b(0, "hi"):meth()
v.ProotDerived2c(0, "hi"):meth()
v.ProotDerived2c():meth()
v.ProotDerived2d(0, "hi"):meth()
v.ProotDerived2d():meth()
v.ProotDerived2e(0, "hi"):meth()
v.ProotDerived2e():meth()
v.ProotDerived2f(0, "hi"):meth()
v.ProotDerived2f():meth()
v.ProotDerived2f(0):meth()

-- Deeper inheritance chain
local db3 = v.DeepBase3(11)
db3 = v.DeepBase3(11, 22)
db3 = v.DeepBase3(11, 22, 33)
local dbp3 = v.DeepProtectedBase3(11, 22, 33)

-- Missing base
v.HiddenDerived1()

-- Templates and public base constructors (derive from non-template)
v.TemplatePublicDerived1Int(0, "hi"):meth()
v.TemplatePublicDerived2Int():meth()
v.TemplatePublicDerived2Int(0, "hi"):meth()
v.TemplatePublicDerived3Int():meth()
v.TemplatePublicDerived3Int(0, "hi"):meth()
v.TemplatePublicDerived4Int():meth()
v.TemplatePublicDerived5Int():meth()

-- Templates and public base constructors (derive from template)
v.TemplPublicDerived1Int(0, "hi"):meth()
v.TemplPublicDerived2Int():meth()
v.TemplPublicDerived2Int(0, "hi"):meth()
v.TemplPublicDerived3Int():meth()
v.TemplPublicDerived3Int(0, "hi"):meth()
v.TemplPublicDerived4Int():meth()
v.TemplPublicDerived5Int():meth()
v.TemplPublicDerived6Int(0, "hi"):meth()
v.TemplPublicDerived6Int():meth()

-- Templated constructors (public)
local tcb = v.TemplateConstructor1Base(0, "hi")
tcb = v.TemplateConstructor1Base("hi", "hi")
tcb = v.TemplateConstructor1Base(11.1, "hi")
tcb:normal_method()
tcb:template_method(0, "hi")
tcb:template_method("hey", "ho")

local tcd1 = v.TemplateConstructor1Derived(0, "hi")
tcd1 = v.TemplateConstructor1Derived("hi", "hi")
tcd1 = v.TemplateConstructor1Derived(11.1, "hi")
-- Not the best test as these are also in the base class, (should use introspection to check)
tcd1:normal_method()
tcd1:template_method(0, "hi")
tcd1:template_method("hey", "ho")

-- Templated constructors (protected)
local tcd2 = v.TemplateConstructor2Derived()
tcd2:normal_method()
tcd2:template_method(0, "hi")
tcd2:template_method("hey", "ho")
