21 #ifndef LIB_LIGHTMETRICA_TEST_STUB_ASSET_H
22 #define LIB_LIGHTMETRICA_TEST_STUB_ASSET_H
25 #include <lightmetrica/asset.h>
26 #include <lightmetrica/assets.h>
27 #include <lightmetrica/confignode.h>
30 LM_TEST_NAMESPACE_BEGIN
36 LM_ASSET_INTERFACE_DEF(
"stub_asset",
"stub_assets");
37 LM_ASSET_NO_DEPENDENCIES();
45 LM_COMPONENT_IMPL_DEF(
"success");
54 LM_COMPONENT_IMPL_DEF(
"fail_on_create");
65 LM_ASSET_INTERFACE_DEF(
"stub_asset_a",
"stub_assets_a");
66 LM_ASSET_NO_DEPENDENCIES();
74 LM_COMPONENT_IMPL_DEF(
"a");
86 LM_ASSET_INTERFACE_DEF(
"stub_asset_b",
"stub_assets_b");
87 LM_ASSET_DEPENDENCIES(
"stub_asset_a");
95 LM_COMPONENT_IMPL_DEF(
"b");
102 child = node.
Child(
"stub_asset_a");
103 EXPECT_FALSE(child.
Empty());
105 EXPECT_NE(
nullptr, p);
116 LM_ASSET_INTERFACE_DEF(
"stub_asset_c",
"stub_assets_c");
117 LM_ASSET_DEPENDENCIES(
"stub_asset_a",
"stub_asset_b");
125 LM_COMPONENT_IMPL_DEF(
"c");
131 child = node.
Child(
"stub_asset_a");
132 EXPECT_FALSE(child.
Empty());
134 EXPECT_NE(
nullptr, p);
136 child = node.
Child(
"stub_asset_b");
137 EXPECT_FALSE(child.
Empty());
139 EXPECT_NE(
nullptr, p);
150 LM_ASSET_INTERFACE_DEF(
"stub_asset_d",
"stub_assets_d");
151 LM_ASSET_DEPENDENCIES(
"stub_asset_a",
"stub_asset_b",
"stub_asset_c");
159 LM_COMPONENT_IMPL_DEF(
"d");
165 child = node.
Child(
"stub_asset_a");
166 EXPECT_FALSE(child.
Empty());
168 EXPECT_NE(
nullptr, p);
170 child = node.
Child(
"stub_asset_b");
171 EXPECT_FALSE(child.
Empty());
173 EXPECT_NE(
nullptr, p);
175 child = node.
Child(
"stub_asset_c");
176 EXPECT_FALSE(child.
Empty());
178 EXPECT_NE(
nullptr, p);
191 LM_ASSET_INTERFACE_DEF(
"stub_asset_e",
"stub_assets_e");
192 LM_ASSET_DEPENDENCIES(
"stub_asset_f");
200 LM_COMPONENT_IMPL_DEF(
"e");
209 LM_ASSET_INTERFACE_DEF(
"stub_asset_f",
"stub_assets_f");
210 LM_ASSET_DEPENDENCIES(
"stub_asset_e");
218 LM_COMPONENT_IMPL_DEF(
"e");
223 LM_TEST_NAMESPACE_END
226 #endif // LIB_LIGHTMETRICA_TEST_STUB_ASSET_H
bool Empty() const
Definition: confignode.cpp:90
Definition: stub.asset.h:91
Definition: stub.asset.h:205
Definition: stub.asset.h:61
Definition: stub.asset.h:41
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:160
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:46
Definition: stub.asset.h:187
Definition: stub.asset.h:32
LM_PUBLIC_API Asset * ResolveReferenceToAsset(const ConfigNode &node, const std::string &type) const
Definition: assets.cpp:279
Definition: stub.asset.h:196
Definition: stub.asset.h:146
Definition: stub.asset.h:50
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:96
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:219
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:126
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:55
Definition: stub.asset.h:112
Definition: confignode.h:37
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:75
Definition: stub.asset.h:121
Definition: stub.asset.h:214
ConfigNode Child(const std::string &name) const
Definition: confignode.cpp:95
Definition: stub.asset.h:70
Definition: stub.asset.h:82
virtual bool Load(const ConfigNode &node, const Assets &assets)
Definition: stub.asset.h:201
Definition: stub.asset.h:155