예제 #1
0
    void equality_data() {
        QTest::addColumn<QLandmarkCategory>("lop");
        QTest::addColumn<QLandmarkCategory>("rop");
        QTest::addColumn<bool>("isEqual");

        QLandmarkCategory cat0;
        cat0.setName("equalName");
        cat0.setIconUrl(QUrl("equalIcon"));

        QLandmarkCategory cat1;
        cat1.setName("unequalName");
        cat1.setIconUrl(QUrl("unequalIcon"));
        QTest::newRow("allUnequal") << cat0 << cat1 << false;

        QLandmarkCategory cat2(cat0);
        cat2.setName("unequalName");
        QTest::newRow("nameUnequal") << cat0 << cat2 << false;

        QLandmarkCategory cat3(cat0);
        cat3.setIconUrl(QUrl("unequalIcon"));
        QTest::newRow("iconUnequal") << cat0 << cat3 << false;

        QLandmarkCategory cat5(cat0);
        QTest::newRow("allEqual") << cat0 << cat5 << true;
    }
예제 #2
0
파일: genenum.c 프로젝트: spchamp/ilu
PUBLIC char * enumerationInt(Type t, ConstantValue v) {
    TypeKind vtk = v->type; /* bad name for a TypeKind */
    TypeKind ctk = type_ur_kind(t); 
    char* baseTypeName = enmJName(t);
    enm_assert(t);
    switch (ctk) {
        case enumeration_Type:
            if (vtk != shortcharacter_Type) fatal("bad enumeration const");
            return cat3(baseTypeName, "._", javaizeIdent(v->val.s));
        default: fatal("bad enumeration const");
    }
    return 0; /* keep the compiler happy */
}
예제 #3
0
Box MakeBoxOfCats()
{
	Box catbox;

	Cat cat1(L"Furry");
	catbox.MoveCatToBox(std::move(cat1));
	// WARNING! At this point, cat1 has been moved to catbox, so it is no longer valid!

	Cat cat2(L"Purry");
	catbox.AddCatToBox(cat2);

	Cat cat3(L"Curry");
	catbox.AddCatToBox(cat3);

	Cat cat4(L"Allergy");
	catbox.AddCatToBox(cat4);

	return catbox;
}
예제 #4
0
파일: genenum.c 프로젝트: spchamp/ilu
PUBLIC char * enm_ioOutPiece(Type t, const char *arg) {
    t = enm_assert(t);
    return cat3("_call.outEnum((", arg, ").value())");
}
예제 #5
0
  void operator()(std::ostream& out, const Edge& e) const
  {
    const Common::PropertyCode::PropertyManager& microManager = m_propertyCodeManager->getPropertyManager("MICRO");


    bool hasNonValidTrigram=false;
    bool hasNonValidBigram=false;

    std::vector<std::vector<uint64_t> > gramNotFound;
    std::vector<uint64_t> gram;

    uint64_t cat1(0),cat2(0),cat3(0);
    LinguisticAnalysisStructure::MorphoSyntacticData* d3=get(vertex_data,*m_graph,target(e,*m_graph));
    if (d3!=0 && !d3->empty()) {
      cat3=microManager.getPropertyAccessor().readValue(d3->begin()->properties);
    }
    LinguisticAnalysisStructure::MorphoSyntacticData* d2=get(vertex_data,*m_graph,source(e,*m_graph));
    if (d2!=0 && !d2->empty()) {
      cat2=microManager.getPropertyAccessor().readValue(d2->begin()->properties);
    }
    gram.push_back(cat2);
    gram.push_back(cat3);

    LinguisticGraphInEdgeIt inItr,inItrEnd;
    for(boost::tie(inItr,inItrEnd)=in_edges(source(e,*m_graph),*m_graph);
        inItr!=inItrEnd;
        inItr++)
        {
      LinguisticAnalysisStructure::MorphoSyntacticData* d1=get(vertex_data,*m_graph,source(*inItr,*m_graph));
      if (d1!=0 && !d1->empty()) {
        cat1=microManager.getPropertyAccessor().readValue(d1->begin()->properties);
      }
      if (!m_trigramMatrix->exists(cat1,cat2,cat3))
      {
          hasNonValidTrigram=true;
          gramNotFound.push_back(gram);
          gramNotFound.back().insert(gramNotFound.back().begin(),cat1);
      }

        }
    if (hasNonValidTrigram) {
        // check if bigram is valid
        if (!m_bigramMatrix->exists(cat2,cat3))
        {
      gramNotFound.push_back(gram);
      hasNonValidBigram=true;
        }
    }

    out << "[label=\"";
    for (std::vector<std::vector<uint64_t> >::iterator it=gramNotFound.begin();
        it!=gramNotFound.end();
        it++)
    {
      copy(it->begin(),it->end(),std::ostream_iterator<uint64_t>(out,","));
      out << "\\l";
    }
    out << "\",style=";
    if (hasNonValidBigram)
    {
      out << "dotted";
    } else if (hasNonValidTrigram)
    {
      out << "dashed";
    }
    else
    {
      out << "solid";
    }
    out << ",fontname=\"Monospace\",fontsize=\"9\"]";
  }