• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/aMule-2.3.1/unittests/tests/

Lines Matching defs:tag

125 void CheckTagName(const wxString& tagName, CTag* tag)
128 ASSERT_EQUALS(tagName, tag->GetName());
131 void CheckTagName(uint8 tagName, CTag* tag)
134 ASSERT_EQUALS(tagName, tag->GetNameID());
146 static bool IsRightType(CTag* tag)
148 return tag->IsStr();
151 static const wxString & GetValue(CTag* tag)
153 return tag->GetStr();
160 static bool IsRightType(CTag* tag)
162 return tag->IsHash();
165 static const CMD4Hash & GetValue(CTag* tag)
167 return tag->GetHash();
174 static bool IsRightType(CTag* tag)
176 return tag->IsFloat();
179 static float GetValue(CTag* tag)
181 return tag->GetFloat();
188 static bool IsRightType(CTag* tag)
190 return tag->IsInt();
193 static uint64 GetValue(CTag* tag)
195 return tag->GetInt();
202 static bool IsRightType(CTag* tag)
204 return tag->IsBlob();
207 static BLOBValue GetValue(CTag* tag)
209 return BLOBValue(tag->GetBlobSize(), tag->GetBlob());
216 static bool IsRightType(CTag* tag)
218 return tag->IsBsob();
221 static BSOBValue GetValue(CTag* tag) {
222 return BSOBValue(tag->GetBsobSize(), tag->GetBsob());
227 void CheckTagValue(V tagValue, CTag* tag)
229 CONTEXT(wxT("Check tag value"));
231 AssertEquals(tagValue, CTagAccess< V >::GetValue(tag));
235 void CheckTagType(V, CTag* tag)
237 CONTEXT(wxT("Check tag type"));
238 ASSERT_EQUALS(true, CTagAccess<V>::IsRightType(tag));
242 void CheckTagData(CTag* tag, TName tagName, const V& tagValue)
244 CONTEXT(wxT("Expected tag value:") + toString(tagValue));
245 CONTEXT(wxT("Parsed tag info:") + tag->GetFullInfo());
247 CheckTagType(tagValue, tag);
248 CheckTagName(tagName, tag);
249 CheckTagValue(valid_tag_value(tagValue), tag);
408 CTag* tag = buf.ReadTag(true);
410 CheckTagData(tag, tagName, valid_tag_value(tagValue));
418 newbuf.WriteTag(*tag);
431 delete tag;
520 TEST_M(CTag, KadTagNames, wxT("Kad: Test Kad tags (name=string) - write/read every valid tag name"))
572 // For each tagNames entry write an 8bit int tag (type:0x9)
574 buf.WriteUInt8(0x09); // 8 bit int tag type
580 buf.WriteUInt8(counter++); // write tag value
595 CONTEXT(wxT("Testing tag name: ") + it_name->second);
606 TEST_M(CTag, ED2kTagNames, wxT("Ed2k: Test ed2k tags (name=id) - write/read every valid tag name"))
667 CONTEXT(wxString::Format(wxT("Reading tag#%d"), counter));
690 CTag tag(buf, true);
691 CheckTagName(0xFF, &tag);
692 CheckTagValue( valid_tag_value( blob ), &tag);
710 CTag tag(buf, true);
711 CheckTagName(wxT("AA"), &tag);
712 CheckTagValue( valid_tag_value( blob ), &tag);