diff options
-rw-r--r-- | lib/Kratos/DFADriver.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm index e06d577..f238ba4 100644 --- a/lib/Kratos/DFADriver.pm +++ b/lib/Kratos/DFADriver.pm @@ -877,7 +877,7 @@ EOF sub to_test_ah { my ($self) = @_; - my $buf = <<'EOF'; + my $buf = <<"EOF"; /* * Autogenerated code -- Manual changes are not preserved @@ -906,6 +906,7 @@ EOF sub to_test_cc { my ($self) = @_; + my $class_name = $self->{class_name}; my @runs = $self->dfa->traces; my @state_enum = $self->model->get_state_enum; my $dfa = $self->dfa->dfa; @@ -924,12 +925,12 @@ sub to_test_cc { #include "DriverEval.h" #include "syscall/guarded_buzzer.h" -DeclareThread(DriverEvalThread, driverEvalThread, 256); +DeclareThread(DriverEvalThread_${class_name}, driverEvalThread, 256); EOF $buf .= <<"EOF"; -void DriverEvalThread::action() +void DriverEvalThread_${class_name}::action() { Guarded_Buzzer buzzer; @@ -984,9 +985,10 @@ EOF sub to_test_h { my ($self) = @_; + my $class_name = $self->{class_name}; my $class_prefix - = $self->repo->get_class_path_prefix( $self->{class_name} ); + = $self->repo->get_class_path_prefix( $class_name ); my $buf = <<"EOF"; @@ -1001,13 +1003,13 @@ sub to_test_h { #include "${class_prefix}.h" #include "syscall/thread.h" -class DriverEvalThread : public Thread { +class DriverEvalThread_${class_name} : public Thread { public: - DriverEvalThread(void* tos) : Thread(tos) { } + DriverEvalThread_${class_name}(void* tos) : Thread(tos) { } void action(); }; -extern DriverEvalThread driverEvalThread; +extern DriverEvalThread_${class_name} driverEvalThread; #endif |