llinventoryparcel_tut.cpp

Go to the documentation of this file.
00001 
00033 #include "linden_common.h"
00034 #include "lltut.h"
00035 
00036 #include "llparcel.h"
00037 
00038 #include <string>
00039 
00040 namespace tut
00041 {
00042         struct llinventoryparcel_data
00043         {
00044         };
00045         typedef test_group<llinventoryparcel_data> llinventoryparcel_test;
00046         typedef llinventoryparcel_test::object llinventoryparcel_object;
00047         tut::llinventoryparcel_test llinventoryparcel("llinventoryparcel");
00048 
00049         template<> template<>
00050         void llinventoryparcel_object::test<1>()
00051         {
00052                 for (S32 i=0; i<LLParcel::C_COUNT; ++i)
00053                 {
00054                         const char *catstring =  LLParcel::getCategoryString(LLParcel::ECategory(i));
00055                         ensure("LLParcel::getCategoryString(i)",
00056                                NULL != catstring);
00057 
00058                         const char *catuistring =  LLParcel::getCategoryUIString(LLParcel::ECategory(i));
00059                         ensure("LLParcel::getCategoryUIString(i)",
00060                                NULL != catuistring);
00061 
00062                         ensure_equals("LLParcel::ECategory mapping of string back to enum", LLParcel::getCategoryFromString(catstring), i);
00063                         ensure_equals("LLParcel::ECategory mapping of uistring back to enum", LLParcel::getCategoryFromUIString(catuistring), i);
00064                 }
00065 
00066                 // test the C_ANY case, which has to work for UI strings
00067                 const char *catuistring =  LLParcel::getCategoryUIString(LLParcel::C_ANY);
00068                 ensure("LLParcel::getCategoryUIString(C_ANY)",
00069                        NULL != catuistring);
00070 
00071                 ensure_equals("LLParcel::ECategory mapping of uistring back to enum", LLParcel::getCategoryFromUIString(catuistring), LLParcel::C_ANY);
00072         }
00073 }

Generated on Fri May 16 08:34:29 2008 for SecondLife by  doxygen 1.5.5