use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode in project binnavi by google.
the class CCriteriumExecuterTest method testInvalidAndCriterion2.
@Test(expected = IllegalStateException.class)
public void testInvalidAndCriterion2() {
final CCachedAndCriterium criterium = new CCachedAndCriterium();
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
final CCachedColorCriterium criterium3 = new CCachedColorCriterium(Color.RED);
final CCachedExpressionTreeNode node3 = new CCachedExpressionTreeNode(criterium3);
CCachedExpressionTreeNode.append(node, node3);
CCriteriumExecuter.execute(m_tree, m_graph);
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode in project binnavi by google.
the class CCriteriumExecuterTest method testSingleColorCriterion.
@Test
public void testSingleColorCriterion() {
final CCachedColorCriterium criterium = new CCachedColorCriterium(Color.RED);
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
assertEquals(0, m_graph.getSelectedNodes().size());
CCriteriumExecuter.execute(m_tree, m_graph);
assertEquals(1, m_graph.getSelectedNodes().size());
assertTrue(m_graph.getRawView().getGraph().getNodes().get(1).isSelected());
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode in project binnavi by google.
the class CCriteriumExecuterTest method testSingleTagCriterion.
@Test
public void testSingleTagCriterion() {
final Set<CTag> tags = new HashSet<CTag>();
for (final NaviNode node : m_graph.getNodes()) {
if (node.getRawNode().isTagged()) {
tags.addAll(node.getRawNode().getTags());
}
}
assertEquals(1, tags.size());
final CCachedTagCriterium criterium = new CCachedTagCriterium(false, Iterables.getOnlyElement(tags));
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
assertEquals(0, m_graph.getSelectedNodes().size());
CCriteriumExecuter.execute(m_tree, m_graph);
assertEquals(1, m_graph.getSelectedNodes().size());
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode in project binnavi by google.
the class CCriteriumExecuterTest method testSingleVisibilityCriterionVisible.
@Test
public void testSingleVisibilityCriterionVisible() {
final CCachedVisibilityCriterium criterium = new CCachedVisibilityCriterium(VisibilityState.VISIBLE);
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
assertEquals(0, m_graph.getSelectedNodes().size());
CCriteriumExecuter.execute(m_tree, m_graph);
assertEquals(m_graph.getNodes().size() - 1, m_graph.getSelectedNodes().size());
}
use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCachedExpressionTreeNode in project binnavi by google.
the class CCriteriumExecuterTest method testSingleTextCriterion.
@Test
public void testSingleTextCriterion() {
final CCachedTextCriterium criterium = new CCachedTextCriterium("mov", false, false);
final CCachedExpressionTreeNode node = new CCachedExpressionTreeNode(criterium);
CCachedExpressionTreeNode.append(m_tree.getRoot(), node);
assertEquals(0, m_graph.getSelectedNodes().size());
CCriteriumExecuter.execute(m_tree, m_graph);
assertEquals(1, m_graph.getSelectedNodes().size());
}
Aggregations