|
11 | 11 |
|
12 | 12 | SCENARIO("generic_type_index", "[core][java_types]")
|
13 | 13 | {
|
14 |
| - GIVEN("Generic type LGenericClass<TX;TY;>; and parameters X, Y, Z") |
| 14 | + GIVEN("Generic type LGenericClass<TX;Tvalue;>; and parameters X, value, Z") |
15 | 15 | {
|
16 | 16 | const auto symbol_type = symbol_typet("java::GenericClass");
|
17 | 17 | const auto generic_symbol_type = java_generic_symbol_typet(
|
18 |
| - symbol_type, "LGenericClass<TX;TY;>;", "PrefixClassName"); |
| 18 | + symbol_type, "LGenericClass<TX;Tvalue;>;", "PrefixClassName"); |
19 | 19 | java_generic_parametert paramX("PrefixClassName::X", symbol_typet());
|
20 |
| - java_generic_parametert paramY("PrefixClassName::Y", symbol_typet()); |
| 20 | + java_generic_parametert value("PrefixClassName::value", symbol_typet()); |
21 | 21 | java_generic_parametert paramZ("PrefixClassName::Z", symbol_typet());
|
22 | 22 |
|
23 | 23 | WHEN("Looking for parameter indexes")
|
24 | 24 | {
|
25 | 25 | const auto indexX = generic_symbol_type.generic_type_index(paramX);
|
26 |
| - const auto indexY = generic_symbol_type.generic_type_index(paramY); |
| 26 | + const auto index_value = generic_symbol_type.generic_type_index(value); |
27 | 27 | const auto indexZ = generic_symbol_type.generic_type_index(paramZ);
|
28 | 28 |
|
29 | 29 | THEN("X has index 0, Y index 1 and Z is not found")
|
30 | 30 | {
|
31 | 31 | REQUIRE(indexX.has_value());
|
32 | 32 | REQUIRE(indexX.value() == 0);
|
33 |
| - REQUIRE(indexY.has_value()); |
34 |
| - REQUIRE(indexY.value() == 1); |
| 33 | + REQUIRE(index_value.has_value()); |
| 34 | + REQUIRE(index_value.value() == 1); |
35 | 35 | REQUIRE_FALSE(indexZ.has_value());
|
36 | 36 | }
|
37 | 37 | }
|
38 | 38 | }
|
39 | 39 |
|
40 |
| - GIVEN("Generic type LGenericClass<Tkey;Tvalue;>; and" |
41 |
| - " parameters key, value, x") |
42 |
| - { |
43 |
| - const auto symbol_type = symbol_typet("java::GenericClass"); |
44 |
| - const auto generic_symbol_type = java_generic_symbol_typet( |
45 |
| - symbol_type, "LGenericClass<Tkey;Tvalue;>;", "PrefixClassName"); |
46 |
| - java_generic_parametert param0("PrefixClassName::key", symbol_typet()); |
47 |
| - java_generic_parametert param1("PrefixClassName::value", symbol_typet()); |
48 |
| - java_generic_parametert param2("PrefixClassName::x", symbol_typet()); |
49 |
| - |
50 |
| - WHEN("Looking for parameter indexes") |
51 |
| - { |
52 |
| - const auto index_param0 = generic_symbol_type.generic_type_index(param0); |
53 |
| - const auto index_param1 = generic_symbol_type.generic_type_index(param1); |
54 |
| - const auto index_param2 = generic_symbol_type.generic_type_index(param2); |
55 |
| - |
56 |
| - THEN("key has index 0, value index 1 and x is not found") |
57 |
| - { |
58 |
| - REQUIRE(index_param0.has_value()); |
59 |
| - REQUIRE(index_param0.value() == 0); |
60 |
| - REQUIRE(index_param1.has_value()); |
61 |
| - REQUIRE(index_param1.value() == 1); |
62 |
| - REQUIRE_FALSE(index_param2.has_value()); |
63 |
| - } |
64 |
| - } |
65 |
| - } |
66 |
| - |
67 | 40 | GIVEN("Generic type Ljava/util/HashMap<TK;TV;>; and parameters K, V, T")
|
68 | 41 | {
|
69 | 42 | const auto symbol_type = symbol_typet("java::java.util.HashMap");
|
|
0 commit comments