use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class CTextEvaluatorTest method testComplete.
@Test
public void testComplete() {
final NaviNode node = CNaviNodeFactory.get();
assertFalse(CTextEvaluator.evaluate(node, "britzel", false, true));
assertTrue(CTextEvaluator.evaluate(node, "Foo", false, true));
assertFalse(CTextEvaluator.evaluate(node, "foo", false, true));
assertTrue(CTextEvaluator.evaluate(node, "foo", false, false));
assertTrue(CTextEvaluator.evaluate(node, "F*", true, true));
assertFalse(CTextEvaluator.evaluate(node, "f*", true, true));
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class COutDegreeEvaluatorTest method testComplete.
@Test
public void testComplete() {
final NaviNode node = CNaviNodeFactory.get();
assertTrue(COutdegreeEvaluator.matches(node, "=", 0));
assertFalse(COutdegreeEvaluator.matches(node, "<", 0));
assertFalse(COutdegreeEvaluator.matches(node, ">", 0));
assertFalse(COutdegreeEvaluator.matches(node, "=", 1));
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class COutDegreeEvaluatorTest method testInvalidOperator.
@Test
public void testInvalidOperator() {
final NaviNode node = CNaviNodeFactory.get();
try {
COutdegreeEvaluator.matches(node, "!=", 1);
fail();
} catch (final IllegalStateException e) {
}
try {
COutdegreeEvaluator.matches(node, "==", 1);
fail();
} catch (final IllegalStateException e) {
}
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class GraphSearcherTest method testSimpleNoResult.
@Test
public void testSimpleNoResult() {
final ZyNodeRealizer<NaviNode> r = new ZyNormalNodeRealizer<NaviNode>(m_content);
final NaviNode m_node1 = new NaviNode(m_ynode, r, m_codeNode1);
final GraphSearcher searcher = new GraphSearcher();
m_content.addLineContent(new ZyLineContent("Hello my Test", null));
searcher.search(Lists.newArrayList(m_node1), new ArrayList<NaviEdge>(), "mx");
searcher.getCursor().next();
assertNull(searcher.getCursor().current());
}
use of com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviNode in project binnavi by google.
the class GraphSearcherTest method testAfterLast.
@Test
public void testAfterLast() {
final ZyNodeRealizer<NaviNode> r = new ZyNormalNodeRealizer<NaviNode>(m_content);
final NaviNode m_node1 = new NaviNode(m_ynode, r, m_codeNode1);
final GraphSearcher searcher = new GraphSearcher();
searcher.search(Lists.newArrayList(m_node1), new ArrayList<NaviEdge>(), "");
assertNull(searcher.getCursor().current());
m_content.addLineContent(new ZyLineContent("Hello my Test", null));
searcher.search(Lists.newArrayList(m_node1), new ArrayList<NaviEdge>(), "my");
assertFalse(searcher.getCursor().isAfterLast());
searcher.getCursor().next();
assertTrue(searcher.getCursor().isAfterLast());
searcher.getCursor().next();
assertTrue(searcher.getCursor().isAfterLast());
}
Aggregations