void llsaleinfo_test_t::test<7>()
	{
		S32 sale_price = 20;
		LLSaleInfo saleinfo(LLSaleInfo::FS_COPY, sale_price);
		LLSaleInfo saleinfo1(LLSaleInfo::FS_COPY, sale_price);
		saleinfo1.accumulate(saleinfo);
		ensure_equals("LLSaleInfo::accumulate(const LLSaleInfo& sale_info) fn failed", saleinfo1.getSalePrice(), 40);
				
	}
	void llsaleinfo_test_t::test<8>()
	{
		S32 sale_price = 55000;
		LLSaleInfo saleinfo(LLSaleInfo::FS_ORIGINAL, sale_price);
		LLSaleInfo saleinfoequal(LLSaleInfo::FS_ORIGINAL, sale_price);
		LLSaleInfo saleinfonotequal(LLSaleInfo::FS_ORIGINAL, sale_price*2);
		
		ensure("operator == fn. failed", true == (saleinfo == saleinfoequal));
		ensure("operator != fn. failed", true == (saleinfo != saleinfonotequal));
	}			
	void llsaleinfo_test_t::test<6>()
	{
		S32 sale_price = 233223;
		LLSaleInfo::EForSale ret_type = LLSaleInfo::lookup("orig");
		
		ensure_equals("lookup(const char* name) fn failed", ret_type, LLSaleInfo::FS_ORIGINAL);

		LLSaleInfo saleinfo(LLSaleInfo::FS_COPY, sale_price);
		const char* result = LLSaleInfo::lookup(LLSaleInfo::FS_COPY);
		ensure("char* lookup(EForSale type) fn failed", 0 == strcmp("copy", result));
	}
	void llsaleinfo_test_t::test<5>()
	{	
		S32 sale_price = 99000;
		LLSaleInfo saleinfo(LLSaleInfo::FS_ORIGINAL, sale_price);
		
		LLSD sd_result = saleinfo.asLLSD();
		
		U32 perm_mask = 0 ;
		BOOL has_perm_mask = FALSE;

		LLSaleInfo saleinfo1;
		saleinfo1.fromLLSD( sd_result, has_perm_mask, perm_mask);	

		ensure_equals("asLLSD and fromLLSD failed", saleinfo.getSalePrice(), saleinfo1.getSalePrice());
		ensure_equals("asLLSD and fromLLSD failed", saleinfo.getSaleType(), saleinfo1.getSaleType());
	}
Esempio n. 5
0
	void llsaleinfo_test_t::test<4>()
	{
// LLXMLNode is teh suck.
#if 0		
		S32 sale_price = 23445;
		LLSaleInfo saleinfo(LLSaleInfo::FS_CONTENTS, sale_price);
		
		LLXMLNode* x_node = saleinfo.exportFileXML();

		LLSaleInfo saleinfo1(LLSaleInfo::FS_NOT, 0);
		
		saleinfo1.importXML(x_node);
		ensure_equals("1.importXML() fn failed", saleinfo.getSalePrice(), saleinfo1.getSalePrice());
		ensure_equals("2.importXML() fn failed", saleinfo.getSaleType(), saleinfo1.getSaleType());
#endif
	}