stuff-from-scratch/plugins/quantum_computing/test/TestQuantumCircuitParsing.cpp
2023-01-28 16:58:26 +00:00

30 lines
779 B
C++

#include "TestFramework.h"
#include "TestUtils.h"
#include "TestRenderUtils.h"
#include "QuantumCircuitReader.h"
#include "QuantumCircuitNode.h"
#include "QuantumCircuit.h"
#include "QuantumWireNode.h"
#include "QuantumGateNode.h"
#include "QuantumTerminalNode.h"
#include "EquationNode.h"
#include "LatexMathExpression.h"
TEST_CASE(TestQuantumCircuitParsing, "quantum_computing")
{
QuantumCircuitReader reader;
auto circuit = reader.read(TestUtils::getTestDataDir() / "quantum_circuit.dat");
TestRenderer renderer(100, 100);
auto node = std::make_unique<QuantumCircuitNode>(Point(20, 20));
node->setContent(circuit.get());
renderer.getScene()->addNode(node.get());
renderer.writeSvg(TestUtils::getTestOutputDir(__FILE__) / "circuit.svg");
}