From 6dbfbb129145ae097afd994b955e63c2b4ea1bf9 Mon Sep 17 00:00:00 2001 From: Alexey Fedoseev Date: Mon, 22 Apr 2024 20:51:29 +0300 Subject: [PATCH] two empty SMs test --- tests/06-output.txt | 1 + tests/06-two-statemachines.cpp | 40 ++++++++++++++++++ .../06-two-statemachines.test-output.graphml | 41 +++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 tests/06-output.txt create mode 100644 tests/06-two-statemachines.cpp create mode 100644 tests/06-two-statemachines.test-output.graphml diff --git a/tests/06-output.txt b/tests/06-output.txt new file mode 100644 index 0000000..de64cd9 --- /dev/null +++ b/tests/06-output.txt @@ -0,0 +1 @@ +Document [Cyberiada-GraphML-1.0] {Element type: doc, id: '', name: '', meta: {standard version: '1.0', transition order: transition first, event propagation: block events}, elements: {State Machine {Element type: stm, id: 'G0', name: 'SM1'}, State Machine {Element type: stm, id: 'G1', name: 'SM2'}} diff --git a/tests/06-two-statemachines.cpp b/tests/06-two-statemachines.cpp new file mode 100644 index 0000000..715a77a --- /dev/null +++ b/tests/06-two-statemachines.cpp @@ -0,0 +1,40 @@ +/* ----------------------------------------------------------------------------- + * The Cyberiada GraphML C++ library implemention + * + * The test + * + * Copyright (C) 2024 Alexey Fedoseev + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see https://www.gnu.org/licenses/ + * ----------------------------------------------------------------------------- */ + +#include +#include "cyberiadamlpp.h" + +using namespace Cyberiada; +using namespace std; + +int main(int argc, char** argv) +{ + Document d; + d.new_state_machine("SM1"); + d.new_state_machine("SM2"); + try { + cout << d << endl; + d.save(string(argv[0]) + ".graphml", formatCyberiada10); + } catch (const Cyberiada::Exception&) { + return 1; + } + return 0; +} diff --git a/tests/06-two-statemachines.test-output.graphml b/tests/06-two-statemachines.test-output.graphml new file mode 100644 index 0000000..344fb58 --- /dev/null +++ b/tests/06-two-statemachines.test-output.graphml @@ -0,0 +1,41 @@ + + + Cyberiada-GraphML-1.0 + + + + + + + + + + + + + + + + + + + + + + SM1 + + formal + CGML_META + standardVersion/ 1.0 + +transitionOrder/ transitionFirst + +eventPropagation/ block + + + + + + SM2 + +