inventorymisc_test.cpp
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:20k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. /** 
  2.  * @file inventory.cpp
  3.  * @author Phoenix
  4.  * @date 2005-11-15
  5.  * @brief Functions for inventory test framework
  6.  *
  7.  * $LicenseInfo:firstyear=2005&license=viewergpl$
  8.  * 
  9.  * Copyright (c) 2005-2010, Linden Research, Inc.
  10.  * 
  11.  * Second Life Viewer Source Code
  12.  * The source code in this file ("Source Code") is provided by Linden Lab
  13.  * to you under the terms of the GNU General Public License, version 2.0
  14.  * ("GPL"), unless you have obtained a separate licensing agreement
  15.  * ("Other License"), formally executed by you and Linden Lab.  Terms of
  16.  * the GPL can be found in doc/GPL-license.txt in this distribution, or
  17.  * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  18.  * 
  19.  * There are special exceptions to the terms and conditions of the GPL as
  20.  * it is applied to this Source Code. View the full text of the exception
  21.  * in the file doc/FLOSS-exception.txt in this software distribution, or
  22.  * online at
  23.  * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  24.  * 
  25.  * By copying, modifying or distributing this software, you acknowledge
  26.  * that you have read and understood your obligations described above,
  27.  * and agree to abide by those obligations.
  28.  * 
  29.  * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  30.  * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  31.  * COMPLETENESS OR PERFORMANCE.
  32.  * $/LicenseInfo$
  33.  */
  34. #include "linden_common.h"
  35. #include "llsd.h"
  36. #include "../llinventory.h"
  37. #include "../test/lltut.h"
  38. #if LL_WINDOWS
  39. // disable unreachable code warnings
  40. #pragma warning(disable: 4702)
  41. #endif
  42. LLPointer<LLInventoryItem> create_random_inventory_item()
  43. {
  44. LLUUID item_id;
  45. item_id.generate();
  46. LLUUID parent_id;
  47. parent_id.generate();
  48. LLPermissions perm;
  49. LLUUID creator_id;
  50. creator_id.generate();
  51. LLUUID owner_id;
  52. owner_id.generate();
  53. LLUUID last_owner_id;
  54. last_owner_id.generate();
  55. LLUUID group_id;
  56. group_id.generate();
  57. perm.init(creator_id, owner_id, last_owner_id, group_id);
  58. perm.initMasks(PERM_ALL, PERM_ALL, PERM_COPY, PERM_COPY, PERM_MODIFY | PERM_COPY);
  59. LLUUID asset_id;
  60. asset_id.generate();
  61. S32 price = rand();
  62. LLSaleInfo sale_info(LLSaleInfo::FS_COPY, price);
  63. U32 flags = rand();
  64. S32 creation = time(NULL);
  65. LLPointer<LLInventoryItem> item = new LLInventoryItem(
  66. item_id,
  67. parent_id,
  68. perm,
  69. asset_id,
  70. LLAssetType::AT_OBJECT,
  71. LLInventoryType::IT_ATTACHMENT,
  72. std::string("Sample Object"),
  73. std::string("Used for Testing"),
  74. sale_info,
  75. flags,
  76. creation);
  77. return item;
  78. }
  79. LLPointer<LLInventoryCategory> create_random_inventory_cat()
  80. {
  81. LLUUID item_id;
  82. item_id.generate();
  83. LLUUID parent_id;
  84. parent_id.generate();
  85. LLPointer<LLInventoryCategory> cat = new LLInventoryCategory(
  86. item_id,
  87. parent_id,
  88. LLFolderType::FT_NONE,
  89. std::string("Sample category"));
  90. return cat;
  91. }
  92. namespace tut
  93. {
  94. struct inventory_data
  95. {
  96. };
  97. typedef test_group<inventory_data> inventory_test;
  98. typedef inventory_test::object inventory_object;
  99. tut::inventory_test inv("llinventory");
  100. //***class LLInventoryType***//
  101. template<> template<>
  102. void inventory_object::test<1>()
  103. {
  104. LLInventoryType::EType retType =  LLInventoryType::lookup(std::string("sound"));
  105. ensure("1.LLInventoryType::lookup(char*) failed", retType == LLInventoryType::IT_SOUND);
  106. retType = LLInventoryType::lookup(std::string("snapshot"));
  107. ensure("2.LLInventoryType::lookup(char*) failed", retType == LLInventoryType::IT_SNAPSHOT);
  108. }
  109. template<> template<>
  110. void inventory_object::test<2>()
  111. {
  112. static std::string retType =  LLInventoryType::lookup(LLInventoryType::IT_CALLINGCARD);
  113. ensure("1.LLInventoryType::lookup(EType) failed", (retType == "callcard")); 
  114. retType = LLInventoryType::lookup(LLInventoryType::IT_LANDMARK);
  115. ensure("2.LLInventoryType::lookup(EType) failed", (retType == "landmark"));
  116. }
  117. template<> template<>
  118. void inventory_object::test<3>()
  119. {
  120. static std::string retType =  LLInventoryType::lookupHumanReadable(LLInventoryType::IT_CALLINGCARD);
  121. ensure("1.LLInventoryType::lookupHumanReadable(EType) failed", (retType == "calling card")); 
  122. retType =  LLInventoryType::lookupHumanReadable(LLInventoryType::IT_LANDMARK);
  123. ensure("2.LLInventoryType::lookupHumanReadable(EType) failed", (retType == "landmark")); 
  124. }
  125. template<> template<>
  126. void inventory_object::test<4>()
  127. {
  128. static LLInventoryType::EType retType =  LLInventoryType::defaultForAssetType(LLAssetType::AT_TEXTURE);
  129. ensure("1.LLInventoryType::defaultForAssetType(LLAssetType EType) failed", retType == LLInventoryType::IT_TEXTURE);
  130. retType =  LLInventoryType::defaultForAssetType(LLAssetType::AT_LANDMARK);
  131. ensure("2.LLInventoryType::defaultForAssetType(LLAssetType EType) failed", retType == LLInventoryType::IT_LANDMARK);
  132. }
  133. //*****class LLInventoryItem*****//
  134. template<> template<>
  135. void inventory_object::test<5>()
  136. {
  137. LLPointer<LLInventoryItem> src = create_random_inventory_item();
  138. LLSD sd = ll_create_sd_from_inventory_item(src);
  139. //llinfos << "sd: " << *sd << llendl;
  140. LLPointer<LLInventoryItem> dst = new LLInventoryItem;
  141. bool successful_parse = dst->fromLLSD(sd);
  142. ensure_equals("0.LLInventoryItem::fromLLSD()", successful_parse, true);
  143. ensure_equals("1.item id::getUUID() failed", dst->getUUID(), src->getUUID());
  144. ensure_equals("2.parent::getParentUUID() failed", dst->getParentUUID(), src->getParentUUID());
  145. ensure_equals("3.name::getName() failed", dst->getName(), src->getName());
  146. ensure_equals("4.type::getType() failed", dst->getType(), src->getType());
  147. ensure_equals("5.permissions::getPermissions() failed", dst->getPermissions(), src->getPermissions());
  148. ensure_equals("6.description::getDescription() failed", dst->getDescription(), src->getDescription());
  149. ensure_equals("7.sale type::getSaleType() failed", dst->getSaleInfo().getSaleType(), src->getSaleInfo().getSaleType());
  150. ensure_equals("8.sale price::getSalePrice() failed", dst->getSaleInfo().getSalePrice(), src->getSaleInfo().getSalePrice());
  151. ensure_equals("9.asset id::getAssetUUID() failed", dst->getAssetUUID(), src->getAssetUUID());
  152. ensure_equals("10.inventory type::getInventoryType() failed", dst->getInventoryType(), src->getInventoryType());
  153. ensure_equals("11.flags::getFlags() failed", dst->getFlags(), src->getFlags());
  154. ensure_equals("12.creation::getCreationDate() failed", dst->getCreationDate(), src->getCreationDate());
  155. LLUUID new_item_id, new_parent_id;
  156. new_item_id.generate();
  157. src->setUUID(new_item_id);
  158. new_parent_id.generate();
  159. src->setParent(new_parent_id);
  160. std::string new_name = "LindenLab";
  161. src->rename(new_name);
  162. src->setType(LLAssetType::AT_SOUND);
  163. LLUUID new_asset_id;
  164. new_asset_id.generate();
  165. src->setAssetUUID(new_asset_id);
  166. std::string new_desc = "SecondLife Testing";
  167. src->setDescription(new_desc);
  168. S32 new_price = rand();
  169. LLSaleInfo new_sale_info(LLSaleInfo::FS_COPY, new_price);
  170. src->setSaleInfo(new_sale_info);
  171. U32 new_flags = rand();
  172. S32 new_creation = time(NULL);
  173. LLPermissions new_perm;
  174. LLUUID new_creator_id;
  175. new_creator_id.generate();
  176. LLUUID new_owner_id;
  177. new_owner_id.generate();
  178. LLUUID last_owner_id;
  179. last_owner_id.generate();
  180. LLUUID new_group_id;
  181. new_group_id.generate();
  182. new_perm.init(new_creator_id, new_owner_id, last_owner_id, new_group_id);
  183. new_perm.initMasks(PERM_ALL, PERM_ALL, PERM_COPY, PERM_COPY, PERM_MODIFY | PERM_COPY);
  184. src->setPermissions(new_perm);
  185. src->setInventoryType(LLInventoryType::IT_SOUND);
  186. src->setFlags(new_flags);
  187. src->setCreationDate(new_creation);
  188. sd = ll_create_sd_from_inventory_item(src);
  189. //llinfos << "sd: " << *sd << llendl;
  190. successful_parse = dst->fromLLSD(sd);
  191. ensure_equals("13.item id::getUUID() failed", dst->getUUID(), src->getUUID());
  192. ensure_equals("14.parent::getParentUUID() failed", dst->getParentUUID(), src->getParentUUID());
  193. ensure_equals("15.name::getName() failed", dst->getName(), src->getName());
  194. ensure_equals("16.type::getType() failed", dst->getType(), src->getType());
  195. ensure_equals("17.permissions::getPermissions() failed", dst->getPermissions(), src->getPermissions());
  196. ensure_equals("18.description::getDescription() failed", dst->getDescription(), src->getDescription());
  197. ensure_equals("19.sale type::getSaleType() failed type", dst->getSaleInfo().getSaleType(), src->getSaleInfo().getSaleType());
  198. ensure_equals("20.sale price::getSalePrice() failed price", dst->getSaleInfo().getSalePrice(), src->getSaleInfo().getSalePrice());
  199. ensure_equals("21.asset id::getAssetUUID() failed id", dst->getAssetUUID(), src->getAssetUUID());
  200. ensure_equals("22.inventory type::getInventoryType() failed type", dst->getInventoryType(), src->getInventoryType());
  201. ensure_equals("23.flags::getFlags() failed", dst->getFlags(), src->getFlags());
  202. ensure_equals("24.creation::getCreationDate() failed", dst->getCreationDate(), src->getCreationDate());
  203. }
  204. template<> template<>
  205. void inventory_object::test<6>()
  206. {
  207. LLPointer<LLInventoryItem> src = create_random_inventory_item();
  208. LLUUID new_item_id, new_parent_id;
  209. new_item_id.generate();
  210. src->setUUID(new_item_id);
  211. new_parent_id.generate();
  212. src->setParent(new_parent_id);
  213. std::string new_name = "LindenLab";
  214. src->rename(new_name);
  215. src->setType(LLAssetType::AT_SOUND);
  216. LLUUID new_asset_id;
  217. new_asset_id.generate();
  218. src->setAssetUUID(new_asset_id);
  219. std::string new_desc = "SecondLife Testing";
  220. src->setDescription(new_desc);
  221. S32 new_price = rand();
  222. LLSaleInfo new_sale_info(LLSaleInfo::FS_COPY, new_price);
  223. src->setSaleInfo(new_sale_info);
  224. U32 new_flags = rand();
  225. S32 new_creation = time(NULL);
  226. LLPermissions new_perm;
  227. LLUUID new_creator_id;
  228. new_creator_id.generate();
  229. LLUUID new_owner_id;
  230. new_owner_id.generate();
  231. LLUUID last_owner_id;
  232. last_owner_id.generate();
  233. LLUUID new_group_id;
  234. new_group_id.generate();
  235. new_perm.init(new_creator_id, new_owner_id, last_owner_id, new_group_id);
  236. new_perm.initMasks(PERM_ALL, PERM_ALL, PERM_COPY, PERM_COPY, PERM_MODIFY | PERM_COPY);
  237. src->setPermissions(new_perm);
  238. src->setInventoryType(LLInventoryType::IT_SOUND);
  239. src->setFlags(new_flags);
  240. src->setCreationDate(new_creation);
  241. // test a save/load cycle to LLSD and back again
  242. LLSD sd = ll_create_sd_from_inventory_item(src);
  243. LLPointer<LLInventoryItem> dst = new LLInventoryItem;
  244. bool successful_parse = dst->fromLLSD(sd);
  245. ensure_equals("0.LLInventoryItem::fromLLSD()", successful_parse, true);
  246. LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
  247. src1->copyItem(src);
  248. ensure_equals("1.item id::getUUID() failed", dst->getUUID(), src1->getUUID());
  249. ensure_equals("2.parent::getParentUUID() failed", dst->getParentUUID(), src1->getParentUUID());
  250. ensure_equals("3.name::getName() failed", dst->getName(), src1->getName());
  251. ensure_equals("4.type::getType() failed", dst->getType(), src1->getType());
  252. ensure_equals("5.permissions::getPermissions() failed", dst->getPermissions(), src1->getPermissions());
  253. ensure_equals("6.description::getDescription() failed", dst->getDescription(), src1->getDescription());
  254. ensure_equals("7.sale type::getSaleType() failed type", dst->getSaleInfo().getSaleType(), src1->getSaleInfo().getSaleType());
  255. ensure_equals("8.sale price::getSalePrice() failed price", dst->getSaleInfo().getSalePrice(), src1->getSaleInfo().getSalePrice());
  256. ensure_equals("9.asset id::getAssetUUID() failed id", dst->getAssetUUID(), src1->getAssetUUID());
  257. ensure_equals("10.inventory type::getInventoryType() failed type", dst->getInventoryType(), src1->getInventoryType());
  258. ensure_equals("11.flags::getFlags() failed", dst->getFlags(), src1->getFlags());
  259. ensure_equals("12.creation::getCreationDate() failed", dst->getCreationDate(), src1->getCreationDate());
  260. // quick test to make sure generateUUID() really works
  261. src1->generateUUID();
  262. ensure_not_equals("13.item id::generateUUID() failed", src->getUUID(), src1->getUUID());
  263. }
  264. template<> template<>
  265. void inventory_object::test<7>()
  266. {
  267. LLFILE* fp = LLFile::fopen("linden_file.dat","w+");
  268. if(!fp)
  269. {
  270. llerrs << "file could not be openedn" << llendl;
  271. return;
  272. }
  273. LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
  274. src1->exportFile(fp, TRUE);
  275. fclose(fp);
  276. LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
  277. fp = LLFile::fopen("linden_file.dat","r+");
  278. if(!fp)
  279. {
  280. llerrs << "file could not be openedn" << llendl;
  281. return;
  282. }
  283. src2->importFile(fp);
  284. fclose(fp);
  285. ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
  286. ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());
  287. ensure_equals("3.permissions::getPermissions() failed", src1->getPermissions(), src2->getPermissions());
  288. ensure_equals("4.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice());
  289. ensure_equals("5.asset id::getAssetUUID() failed id", src1->getAssetUUID(), src2->getAssetUUID());
  290. ensure_equals("6.type::getType() failed", src1->getType(), src2->getType());
  291. ensure_equals("7.inventory type::getInventoryType() failed type", src1->getInventoryType(), src2->getInventoryType());
  292. ensure_equals("8.name::getName() failed", src1->getName(), src2->getName());
  293. ensure_equals("9.description::getDescription() failed", src1->getDescription(), src2->getDescription());
  294. ensure_equals("10.creation::getCreationDate() failed", src1->getCreationDate(), src2->getCreationDate());
  295. }
  296. template<> template<>
  297. void inventory_object::test<8>()
  298. {
  299. LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
  300. std::ostringstream ostream;
  301. src1->exportLegacyStream(ostream, TRUE);
  302. std::istringstream istream(ostream.str());
  303. LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
  304. src2->importLegacyStream(istream);
  305. ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
  306. ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());
  307. ensure_equals("3.permissions::getPermissions() failed", src1->getPermissions(), src2->getPermissions());
  308. ensure_equals("4.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice());
  309. ensure_equals("5.asset id::getAssetUUID() failed id", src1->getAssetUUID(), src2->getAssetUUID());
  310. ensure_equals("6.type::getType() failed", src1->getType(), src2->getType());
  311. ensure_equals("7.inventory type::getInventoryType() failed type", src1->getInventoryType(), src2->getInventoryType());
  312. ensure_equals("8.name::getName() failed", src1->getName(), src2->getName());
  313. ensure_equals("9.description::getDescription() failed", src1->getDescription(), src2->getDescription());
  314. ensure_equals("10.creation::getCreationDate() failed", src1->getCreationDate(), src2->getCreationDate());
  315. }
  316. template<> template<>
  317. void inventory_object::test<9>()
  318. {
  319. // Deleted LLInventoryItem::exportFileXML() and LLInventoryItem::importXML()
  320. // because I can't find any non-test code references to it. 2009-05-04 JC
  321. }
  322. template<> template<>
  323. void inventory_object::test<10>()
  324. {
  325. LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
  326. U8* bin_bucket = new U8[300];
  327. S32 bin_bucket_size = src1->packBinaryBucket(bin_bucket, NULL);
  328. LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
  329. src2->unpackBinaryBucket(bin_bucket, bin_bucket_size);
  330. ensure_equals("1.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice());
  331. ensure_equals("2.sale type::getSaleType() failed type", src1->getSaleInfo().getSaleType(), src2->getSaleInfo().getSaleType());
  332. ensure_equals("3.type::getType() failed", src1->getType(), src2->getType());
  333. ensure_equals("4.inventory type::getInventoryType() failed type", src1->getInventoryType(), src2->getInventoryType());
  334. ensure_equals("5.name::getName() failed", src1->getName(), src2->getName());
  335. ensure_equals("6.description::getDescription() failed", src1->getDescription(), src2->getDescription());
  336. ensure_equals("7.flags::getFlags() failed", src1->getFlags(), src2->getFlags());
  337. }
  338. template<> template<>
  339. void inventory_object::test<11>()
  340. {
  341. LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
  342. LLSD retSd = src1->asLLSD();
  343. LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
  344. src2->fromLLSD(retSd);
  345. ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
  346. ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());
  347. ensure_equals("3.permissions::getPermissions() failed", src1->getPermissions(), src2->getPermissions());
  348. ensure_equals("4.asset id::getAssetUUID() failed id", src1->getAssetUUID(), src2->getAssetUUID());
  349. ensure_equals("5.type::getType() failed", src1->getType(), src2->getType());
  350. ensure_equals("6.inventory type::getInventoryType() failed type", src1->getInventoryType(), src2->getInventoryType());
  351. ensure_equals("7.flags::getFlags() failed", src1->getFlags(), src2->getFlags());
  352. ensure_equals("8.sale type::getSaleType() failed type", src1->getSaleInfo().getSaleType(), src2->getSaleInfo().getSaleType());
  353. ensure_equals("9.sale price::getSalePrice() failed price", src1->getSaleInfo().getSalePrice(), src2->getSaleInfo().getSalePrice());
  354. ensure_equals("10.name::getName() failed", src1->getName(), src2->getName());
  355. ensure_equals("11.description::getDescription() failed", src1->getDescription(), src2->getDescription());
  356. ensure_equals("12.creation::getCreationDate() failed", src1->getCreationDate(), src2->getCreationDate());
  357. }
  358. //******class LLInventoryCategory*******//
  359. template<> template<>
  360. void inventory_object::test<12>()
  361. {
  362. LLPointer<LLInventoryCategory> src = create_random_inventory_cat();
  363. LLSD sd = ll_create_sd_from_inventory_category(src);
  364. LLPointer<LLInventoryCategory> dst = ll_create_category_from_sd(sd);
  365. ensure_equals("1.item id::getUUID() failed", dst->getUUID(), src->getUUID());
  366. ensure_equals("2.parent::getParentUUID() failed", dst->getParentUUID(), src->getParentUUID());
  367. ensure_equals("3.name::getName() failed", dst->getName(), src->getName());
  368. ensure_equals("4.type::getType() failed", dst->getType(), src->getType());
  369. ensure_equals("5.preferred type::getPreferredType() failed", dst->getPreferredType(), src->getPreferredType());
  370. src->setPreferredType( LLFolderType::FT_TEXTURE);
  371. sd = ll_create_sd_from_inventory_category(src);
  372. dst = ll_create_category_from_sd(sd);
  373. ensure_equals("6.preferred type::getPreferredType() failed", dst->getPreferredType(), src->getPreferredType());
  374. }
  375. template<> template<>
  376. void inventory_object::test<13>()
  377. {
  378. LLFILE* fp = LLFile::fopen("linden_file.dat","w");
  379. if(!fp)
  380. {
  381. llerrs << "file coudnt be openedn" << llendl;
  382. return;
  383. }
  384. LLPointer<LLInventoryCategory> src1 = create_random_inventory_cat();
  385. src1->exportFile(fp, TRUE);
  386. fclose(fp);
  387. LLPointer<LLInventoryCategory> src2 = new LLInventoryCategory();
  388. fp = LLFile::fopen("linden_file.dat","r");
  389. if(!fp)
  390. {
  391. llerrs << "file coudnt be openedn" << llendl;
  392. return;
  393. }
  394. src2->importFile(fp);
  395. fclose(fp);
  396. ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
  397. ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());
  398.   ensure_equals("3.type::getType() failed", src1->getType(), src2->getType());
  399. ensure_equals("4.preferred type::getPreferredType() failed", src1->getPreferredType(), src2->getPreferredType());
  400. ensure_equals("5.name::getName() failed", src1->getName(), src2->getName());
  401. }
  402. template<> template<>
  403. void inventory_object::test<14>()
  404. {
  405. LLPointer<LLInventoryCategory> src1 = create_random_inventory_cat();
  406. std::ostringstream ostream;
  407. src1->exportLegacyStream(ostream, TRUE);
  408. std::istringstream istream(ostream.str());
  409. LLPointer<LLInventoryCategory> src2 = new LLInventoryCategory();
  410. src2->importLegacyStream(istream);
  411. ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
  412. ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());
  413. ensure_equals("3.type::getType() failed", src1->getType(), src2->getType());
  414. ensure_equals("4.preferred type::getPreferredType() failed", src1->getPreferredType(), src2->getPreferredType());
  415. ensure_equals("5.name::getName() failed", src1->getName(), src2->getName());
  416. }
  417. }