//===- llvm/unittest/ADT/DirectedGraphTest.cpp ------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines concrete derivations of the directed-graph base classes // for testing purposes. // //===----------------------------------------------------------------------===// #include "llvm/ADT/DirectedGraph.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/SmallPtrSet.h" #include "gtest/gtest.h" namespace llvm { //===--------------------------------------------------------------------===// // Derived nodes, edges and graph types based on DirectedGraph. //===--------------------------------------------------------------------===// class DGTestNode; class DGTestEdge; DGTestNodeBase; DGTestEdgeBase; DGTestBase; class DGTestNode : public DGTestNodeBase { … }; class DGTestEdge : public DGTestEdgeBase { … }; class DGTestGraph : public DGTestBase { … }; EdgeListTy; //===--------------------------------------------------------------------===// // GraphTraits specializations for the DGTest //===--------------------------------------------------------------------===// template <> struct GraphTraits<DGTestNode *> { … }; template <> struct GraphTraits<DGTestGraph *> : public GraphTraits<DGTestNode *> { … }; //===--------------------------------------------------------------------===// // Test various modification and query functions. //===--------------------------------------------------------------------===// TEST(DirectedGraphTest, AddAndConnectNodes) { … } TEST(DirectedGraphTest, AddRemoveEdge) { … } TEST(DirectedGraphTest, hasEdgeTo) { … } TEST(DirectedGraphTest, AddRemoveNode) { … } TEST(DirectedGraphTest, SCC) { … } } // namespace llvm