stuff-from-scratch/plugins/quantum_computing/test/TestQuantumCircuitParsing.cpp

31 lines
779 B
C++
Raw Normal View History

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