mbed-os

Fork of mbed-os by erkin yucel

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 # This is similar to test1, but this time B2 also inherits from B1, which allows it to override its config data.
elessair 0:f269e3021894 2 # B2 also overrides base1_2, like D1.
elessair 0:f269e3021894 3 # The order of inheritace in F is also reversed ([D1, B2] instead of [B2, D1])
elessair 0:f269e3021894 4 # Since the last override of base1_2 in inheritance order is in B2, base1_2 must now
elessair 0:f269e3021894 5 # have the value that was overriden in B2, not in D1.
elessair 0:f269e3021894 6 # This test also shows that multiple inheritance works for a simple diamond shaped inheritance pattern
elessair 0:f269e3021894 7
elessair 0:f269e3021894 8 expected_results = {
elessair 0:f269e3021894 9 "f": {
elessair 0:f269e3021894 10 "desc": "test multiple target inheritance (diamond shape)",
elessair 0:f269e3021894 11 "target.base1_1": "v_base1_1_f",
elessair 0:f269e3021894 12 "target.base1_2": "v_base1_2_b2",
elessair 0:f269e3021894 13 "target.base1_3": "v_base1_3_b1",
elessair 0:f269e3021894 14 "target.derived1": "v_derived1_d1",
elessair 0:f269e3021894 15 "target.derived2": "v_derived2_f",
elessair 0:f269e3021894 16 "target.base2_1": "v_base2_1_f",
elessair 0:f269e3021894 17 "target.base2_2": "v_base2_2_b2",
elessair 0:f269e3021894 18 "target.f1_1": "v_f1_1_f_override",
elessair 0:f269e3021894 19 "target.f1_2": "v_f1_2_f"
elessair 0:f269e3021894 20 },
elessair 0:f269e3021894 21 "b2": {
elessair 0:f269e3021894 22 "desc": "another single inheritance test",
elessair 0:f269e3021894 23 "target.base1_1": "v_base1_1_b1",
elessair 0:f269e3021894 24 "target.base1_2": "v_base1_2_b2",
elessair 0:f269e3021894 25 "target.base1_3": "v_base1_3_b1",
elessair 0:f269e3021894 26 "target.base2_1": "v_base2_1_b2",
elessair 0:f269e3021894 27 "target.base2_2": "v_base2_2_b2"
elessair 0:f269e3021894 28 }
elessair 0:f269e3021894 29 }
elessair 0:f269e3021894 30