Skip to content
Snippets Groups Projects
Commit a9f6803c authored by Arpad Lovassy's avatar Arpad Lovassy Committed by Gerrit Code Review
Browse files

Merge "BER* moved into EncodeDecode/BER"

parents cdc0bfa5 cd0ae33a
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 2473 deletions
Regr
Regr.cc
Regr_se[qt].cc
Regr_se[qt]of.cc
Regr_union.cc
Regr.hh
Regr.log
Regr1.cc
Regr1_se[qt].cc
Regr1_se[qt]of.cc
Regr1_union.cc
Regr1.hh
Regr2.cc
Regr2_se[qt].cc
Regr2_se[qt]of.cc
Regr2_union.cc
Regr2.hh
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
* Raduly, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.2.pl2
// for Matyas Forstner (tmpmfr@saussure) on Thu Oct 17 16:56:18 2002
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include "MyPort1.hh"
#ifndef OLD_NAMES
namespace Regr {
#endif
MyPort1::MyPort1(const char *par_port_name)
: MyPort1_BASE(par_port_name)
{
}
MyPort1::~MyPort1()
{
}
void MyPort1::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void MyPort1::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
}
void MyPort1::user_map(const char *system_port)
{
}
void MyPort1::user_unmap(const char *system_port)
{
}
void MyPort1::user_start()
{
}
void MyPort1::user_stop()
{
}
#ifndef OLD_NAMES
#define SEND_MACRO(module, type) \
void MyPort1::outgoing_send(const module::type& send_par) \
{ \
TTCN_Buffer buf; \
send_par.encode(module::type##_descr_, buf, \
TTCN_EncDec::CT_BER, BER_ENCODE_DER); \
OCTETSTRING os; \
buf.get_string(os); \
incoming_message(os); \
}
#else
#define SEND_MACRO(module, type) \
void MyPort1::outgoing_send(const type& send_par) \
{ \
TTCN_Buffer buf; \
send_par.encode(type##_descr_, buf, \
TTCN_EncDec::CT_BER, BER_ENCODE_DER); \
OCTETSTRING os; \
buf.get_string(os); \
incoming_message(os); \
}
#endif
SEND_MACRO(Regr1, T0)
SEND_MACRO(Regr1, T2)
SEND_MACRO(Regr1, T3)
SEND_MACRO(Regr1, T4)
SEND_MACRO(Regr1, T5)
SEND_MACRO(Regr1, T6)
SEND_MACRO(Regr1, T7)
SEND_MACRO(Regr1, T8)
SEND_MACRO(Regr2, T10)
SEND_MACRO(Regr2, T11)
#ifndef OLD_NAMES
} /* end of namespace */
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
* Raduly, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.2.pl2
// for Matyas Forstner (tmpmfr@saussure) on Thu Oct 17 16:56:18 2002
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef MyPort1_HH
#define MyPort1_HH
#include "Regr.hh"
#ifndef OLD_NAMES
namespace Regr {
#define REGR1_NS Regr1::
#define REGR2_NS Regr2::
#else
#define REGR1_NS
#define REGR2_NS
#endif
class MyPort1 : public MyPort1_BASE {
public:
MyPort1(const char *par_port_name);
~MyPort1();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const REGR1_NS T0& send_par);
void outgoing_send(const REGR1_NS T1& send_par);
void outgoing_send(const REGR1_NS T3& send_par);
void outgoing_send(const REGR1_NS T4& send_par);
void outgoing_send(const REGR1_NS T5& send_par);
void outgoing_send(const REGR1_NS T6& send_par);
void outgoing_send(const REGR1_NS T7& send_par);
void outgoing_send(const REGR1_NS T8& send_par);
void outgoing_send(const REGR2_NS T10& send_par);
void outgoing_send(const REGR2_NS T11& send_par);
};
#ifndef OLD_NAMES
} /* end of namespace */
#endif
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
* Raduly, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.2.pl2
// for Matyas Forstner (tmpmfr@saussure) on Thu Oct 17 16:56:18 2002
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include "MyPort2.hh"
#ifndef OLD_NAMES
namespace Regr {
#endif
MyPort2::MyPort2(const char *par_port_name)
: MyPort2_BASE(par_port_name)
{
}
MyPort2::~MyPort2()
{
}
void MyPort2::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void MyPort2::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
}
void MyPort2::user_map(const char *system_port)
{
}
void MyPort2::user_unmap(const char *system_port)
{
}
void MyPort2::user_start()
{
}
void MyPort2::user_stop()
{
}
#ifndef OLD_NAMES
#define DECODER_MACRO(module, type) \
{ \
module::type pdu; \
TTCN_EncDec::clear_error(); \
buf.rewind(); \
pdu.decode(module::type##_descr_, buf, TTCN_EncDec::CT_BER, BER_ACCEPT_ALL); \
if(TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) { \
incoming_message(pdu); \
return; \
} \
}
#else
#define DECODER_MACRO(module, type) \
{ \
type pdu; \
TTCN_EncDec::clear_error(); \
buf.rewind(); \
pdu.decode(type##_descr_, buf, TTCN_EncDec::CT_BER, BER_ACCEPT_ALL); \
if(TTCN_EncDec::get_last_error_type() == TTCN_EncDec::ET_NONE) { \
incoming_message(pdu); \
return; \
} \
}
#endif
void MyPort2::outgoing_send(const OCTETSTRING& send_par)
{
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL,
TTCN_EncDec::EB_WARNING);
TTCN_Buffer buf(send_par);
DECODER_MACRO(Regr1, T0)
DECODER_MACRO(Regr1, T2)
DECODER_MACRO(Regr1, T3)
DECODER_MACRO(Regr1, T4)
DECODER_MACRO(Regr1, T5)
DECODER_MACRO(Regr1, T6)
DECODER_MACRO(Regr1, T7)
DECODER_MACRO(Regr1, T8)
DECODER_MACRO(Regr2, T10)
DECODER_MACRO(Regr2, T11)
}
#ifndef OLD_NAMES
} /* end of namespace */
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
* Raduly, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.2.pl2
// for Matyas Forstner (tmpmfr@saussure) on Thu Oct 17 16:56:18 2002
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef MyPort2_HH
#define MyPort2_HH
#include "Regr.hh"
#ifndef OLD_NAMES
namespace Regr {
#endif
class MyPort2 : public MyPort2_BASE {
public:
MyPort2(const char *par_port_name);
~MyPort2();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const OCTETSTRING& send_par);
};
#ifndef OLD_NAMES
} /* end of namespace */
#endif
#endif
This diff is collapsed.
X
X.cc
X_se[qt].cc
X_se[qt]of.cc
X_union.cc
X.hh
X.log
X682.cc
X682_se[qt].cc
X682_se[qt]of.cc
X682_union.cc
X682.hh
compile
##############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Delic, Adam
# Koppany, Csaba
# Kovacs, Ferenc
# Raduly, Csaba
# Szabados, Kristof
# Szabo, Bence Janos
# Szabo, Janos Zoltan – initial implementation
#
##############################################################################
TOPDIR := ..
include $(TOPDIR)/Makefile.regression
.PHONY: all clean dep run
TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
TTCN3_MODULES = X.ttcn
ASN1_MODULES = X682.asn
GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
GENERATED_HEADERS = $(TTCN3_MODULES:.ttcn=.hh) $(ASN1_MODULES:.asn=.hh)
ifdef CODE_SPLIT
GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
else ifdef SPLIT_TO_SLICES
POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
GENERATED_SOURCES += $(GENERATED_SOURCES2)
endif
USER_SOURCES = MyPort1.cc MyPort2.cc
USER_HEADERS = MyPort1.hh MyPort2.hh
OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
TARGET = X$(EXESUFFIX)
all: $(TARGET)
$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
-L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
compile: $(TTCN3_MODULES) $(ASN1_MODULES)
$(TTCN3_COMPILER) $^
touch compile
clean distclean:
-rm -f $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
$(GENERATED_SOURCES) compile *.log
dep: $(GENERATED_SOURCES)
makedepend $(CPPFLAGS) $(USER_SOURCES) $(GENERATED_SOURCES)
run: $(TARGET) X.cfg
./$^
MyPort1.o: MyPort1.hh X.hh X682.hh MyPort2.hh
MyPort2.o: MyPort2.hh X.hh X682.hh MyPort1.hh
X.o: X.hh X682.hh MyPort1.hh MyPort2.hh
X682.o: X682.hh
ifdef SRCDIR
$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Delic, Adam
* Forstner, Matyas
* Koppany, Csaba
* Lovassy, Arpad
* Raduly, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include "MyPort1.hh"
#ifndef OLD_NAMES
using namespace X682;
namespace X {
#endif
MyPort1::MyPort1(const char *par_port_name)
: MyPort1_BASE(par_port_name)
{
}
MyPort1::~MyPort1()
{
}
void MyPort1::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void MyPort1::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
}
void MyPort1::user_map(const char *system_port)
{
}
void MyPort1::user_unmap(const char *system_port)
{
}
void MyPort1::user_start()
{
}
void MyPort1::user_stop()
{
}
void MyPort1::outgoing_send(const ErrorReturn& send_par)
{
TTCN_Buffer buf;
send_par.encode(ErrorReturn_descr_, buf,
TTCN_EncDec::CT_BER, BER_ENCODE_DER);
OCTETSTRING os;
buf.get_string(os);
incoming_message(os);
}
#ifndef OLD_NAMES
}
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Delic, Adam
* Koppany, Csaba
* Lovassy, Arpad
* Raduly, Csaba
*
******************************************************************************/
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef MyPort1_HH
#define MyPort1_HH
#include "X.hh"
#ifndef OLD_NAMES
#define X682NS X682::
namespace X {
#else
#define X682NS
#endif
class MyPort1 : public MyPort1_BASE {
public:
MyPort1(const char *par_port_name);
~MyPort1();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const X682NS ErrorReturn& send_par);
};
#ifndef OLD_NAMES
}
#endif
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Delic, Adam
* Forstner, Matyas
* Koppany, Csaba
* Lovassy, Arpad
* Raduly, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include "MyPort2.hh"
#ifndef OLD_NAMES
using namespace X682;
namespace X {
#endif
MyPort2::MyPort2(const char *par_port_name)
: MyPort2_BASE(par_port_name)
{
}
MyPort2::~MyPort2()
{
}
void MyPort2::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void MyPort2::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
}
void MyPort2::user_map(const char *system_port)
{
}
void MyPort2::user_unmap(const char *system_port)
{
}
void MyPort2::user_start()
{
}
void MyPort2::user_stop()
{
}
void MyPort2::outgoing_send(const OCTETSTRING& send_par)
{
/*
TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL,
TTCN_EncDec::EB_ERROR);
*/
TTCN_Buffer buf(send_par);
ErrorReturn pdu;
pdu.decode(ErrorReturn_descr_, buf, TTCN_EncDec::CT_BER, BER_ACCEPT_ALL);
incoming_message(pdu);
}
#ifndef OLD_NAMES
}
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Delic, Adam
* Koppany, Csaba
* Lovassy, Arpad
* Raduly, Csaba
* Szabados, Kristof
*
******************************************************************************/
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef MyPort2_HH
#define MyPort2_HH
#include "X.hh"
#ifndef OLD_NAMES
namespace X {
#endif
class MyPort2 : public MyPort2_BASE {
public:
MyPort2(const char *par_port_name);
~MyPort2();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const OCTETSTRING& send_par);
};
#ifndef OLD_NAMES
}
#endif
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Koppany, Csaba
* Szabo, Janos Zoltan – initial implementation
*
******************************************************************************/
module X
{
import from X682 language "ASN.1:1997" all
type port MyPort1 message
{
out ErrorReturn;
in octetstring;
}
type port MyPort2 message
{
out octetstring;
in ErrorReturn;
}
type component MyComponent
{
timer T := 1.0;
port MyPort1 P1;
port MyPort2 P2;
}
type component MySystemType
{
port MyPort2 S1;
port MyPort1 S2;
}
altstep MyAltstep() runs on MyComponent
{
[] P1.receive { setverdict(fail); }
[] P2.receive { setverdict(fail); }
[] T.timeout { setverdict(inconc); T.start; }
}
testcase TC0a() runs on MyComponent system MySystemType
{
var default d := activate(MyAltstep());
map(mtc:P1, system:S2);
map(mtc:P2, system:S1);
P1.send(errorReturn1);
T.start;
P1.receive(ber_errorReturn1);
setverdict(pass);
T.stop;
deactivate(d);
unmap(mtc:P1, system:S2);
unmap(mtc:P2, system:S1);
}
testcase TC0b() runs on MyComponent system MySystemType
{
var default d := activate(MyAltstep());
map(mtc:P1, system:S2);
map(mtc:P2, system:S1);
P2.send(ber_errorReturn1);
T.start;
P2.receive(errorReturn1);
setverdict(pass);
T.stop;
deactivate(d);
unmap(mtc:P1, system:S2);
unmap(mtc:P2, system:S1);
}
control
{
execute(TC0a());
execute(TC0b());
}
}
##############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Delic, Adam
# Forstner, Matyas
# Kovacs, Ferenc
# Raduly, Csaba
# Szabados, Kristof
# Szabo, Bence Janos
# Szabo, Janos Zoltan – initial implementation
#
##############################################################################
TOPDIR := ..
include ../Makefile.regression
.SUFFIXES: .ttcn .asn .hh
.PHONY: all clean dep run
TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
TTCN3_MODULES = X.ttcn
ASN1_MODULES = x682.asn
GENERATED_SOURCES = $(ASN1_MODULES:.asn=.cc) $(TTCN3_MODULES:.ttcn=.cc)
GENERATED_HEADERS = $(ASN1_MODULES:.asn=.hh) $(TTCN3_MODULES:.ttcn=.hh)
ifdef CODE_SPLIT
GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
else ifdef SPLIT_TO_SLICES
POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
GENERATED_SOURCES += $(GENERATED_SOURCES2)
endif
USER_SOURCES = MyPort1.cc MyPort2.cc
USER_HEADERS = MyPort1.hh MyPort2.hh
OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
TARGET = X
all: $(TARGET)
$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
-L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
.ttcn.cc .ttcn.hh:
$(TTCN3_COMPILER) $<
.asn.cc .asn.hh:
$(TTCN3_COMPILER) $<
clean distclean:
-rm -f $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
$(GENERATED_SOURCES) *.log Makefile.bak
dep: $(GENERATED_SOURCES)
makedepend $(CPPFLAGS) $(USER_SOURCES) $(GENERATED_SOURCES)
run: $(TARGET)
./$(TARGET) X.cfg
.NOTPARALLEL:
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
*
******************************************************************************/
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include "MyPort1.hh"
MyPort1::MyPort1(const char *par_port_name)
: MyPort1_BASE(par_port_name)
{
}
MyPort1::~MyPort1()
{
}
void MyPort1::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void MyPort1::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
}
void MyPort1::user_map(const char *system_port)
{
}
void MyPort1::user_unmap(const char *system_port)
{
}
void MyPort1::user_start()
{
}
void MyPort1::user_stop()
{
}
void MyPort1::outgoing_send(const ErrorReturn& send_par)
{
BER_Buf BER_buf;
send_par.encode_BER(BER_ENCODE_DER, ErrorReturn_tag, BER_buf);
incoming_message(OCTETSTRING(BER_buf.get_len(), BER_buf.get_data()));
}
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
*
******************************************************************************/
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef MyPort1_HH
#define MyPort1_HH
#include "X.hh"
class MyPort1 : public MyPort1_BASE {
public:
MyPort1(const char *par_port_name);
~MyPort1();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const ErrorReturn& send_par);
};
#endif
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
*
******************************************************************************/
// This Test Port skeleton source file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
//
// You may modify this file. Complete the body of empty functions and
// add your member functions here.
#include "MyPort2.hh"
MyPort2::MyPort2(const char *par_port_name)
: MyPort2_BASE(par_port_name)
{
}
MyPort2::~MyPort2()
{
}
void MyPort2::set_parameter(const char *parameter_name,
const char *parameter_value)
{
}
void MyPort2::Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call)
{
}
void MyPort2::user_map(const char *system_port)
{
}
void MyPort2::user_unmap(const char *system_port)
{
}
void MyPort2::user_start()
{
}
void MyPort2::user_stop()
{
}
void MyPort2::outgoing_send(const OCTETSTRING& send_par)
{
BER_Buf BER_buf;
BER_buf.put_s(send_par.lengthof(), send_par);
ErrorReturn pdu;
pdu.decode_BER(BER_buf, ErrorReturn_tag, BER_ACCEPT_ALL);
incoming_message(pdu);
}
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
* Lovassy, Arpad
*
******************************************************************************/
// This Test Port skeleton header file was generated by the
// TTCN-3 Compiler of the TTCN-3 Test Executor version 1.3.pl0
// for Matyas Forstner (tmpmfr@saussure) on Thu Apr 10 16:06:07 2003
//
// You may modify this file. Add your attributes and prototypes of your
// member functions here.
#ifndef MyPort2_HH
#define MyPort2_HH
#include "X.hh"
class MyPort2 : public MyPort2_BASE {
public:
MyPort2(const char *par_port_name);
~MyPort2();
void set_parameter(const char *parameter_name,
const char *parameter_value);
void Event_Handler(const fd_set *read_fds,
const fd_set *write_fds, const fd_set *error_fds,
double time_since_last_call);
protected:
void user_map(const char *system_port);
void user_unmap(const char *system_port);
void user_start();
void user_stop();
void outgoing_send(const OCTETSTRING& send_par);
};
#endif
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Forstner, Matyas
#
###############################################################################
[MODULE_PARAMETERS]
[LOGGING]
LogFile := "X.log"
FileMask := LOG_ALL
ConsoleMask := TTCN_TESTCASE | TTCN_STATISTICS
[EXECUTE]
X.control
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Forstner, Matyas
*
******************************************************************************/
module X
{
import from x682 language "ASN.1:1997" all
type port MyPort1 message
{
out ErrorReturn;
in octetstring;
}
type port MyPort2 message
{
out octetstring;
in ErrorReturn;
}
type component MyComponent
{
timer T := 1.0;
port MyPort1 P1;
port MyPort2 P2;
}
type component MySystemType
{
port MyPort1 S1;
port MyPort2 S2;
}
altstep MyAltstep() runs on MyComponent
{
[] P1.receive { setverdict(fail); }
[] P2.receive { setverdict(fail); }
[] T.timeout { setverdict(inconc); T.start; }
}
testcase TC0a() runs on MyComponent system MySystemType
{
var default d := activate(MyAltstep());
map(mtc:P1, system:S2);
map(mtc:P2, system:S1);
P1.send(errorReturn1);
T.start;
P1.receive(ber_errorReturn1);
setverdict(pass);
T.stop;
deactivate(d);
unmap(mtc:P1, system:S2);
unmap(mtc:P2, system:S1);
}
testcase TC0b() runs on MyComponent system MySystemType
{
var default d := activate(MyAltstep());
map(mtc:P1, system:S2);
map(mtc:P2, system:S1);
P2.send(ber_errorReturn1);
T.start;
P2.receive(errorReturn1);
setverdict(pass);
T.stop;
deactivate(d);
unmap(mtc:P1, system:S2);
unmap(mtc:P2, system:S1);
}
control
{
execute(TC0a());
execute(TC0b());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment