Project

General

Profile

Actions

Support Request #14644

closed

Write a test with trigger_runner()

Added by hidden about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Customer:
CARIAD
Department:
Requester's Priority:
Normal
Support Level:
2nd Level
Resolution:
Solved Issue
Product Issue Numbers:
Affected Products:
Platform:
Windows 10 64bit
Topic:
ADTF::TestingSDK

Description

Supportanfrage

Gibt es ein Äquivalent zum cTestWriter aber für Time Triggering?

Oder was wäre eine zu empfehlende Vorgehensweise, um Time-getriggerte Filter zu probieren?

Lösung

Dafür kannst Du einfach trigger_runner() (https://support.digitalwerk.net/adtf/v3/adtf_html/namespaceadtf_1_1streaming_1_1testing_1_1hollow.html#a7ab7163c15d9d1f130fa4e5fcc3d0fa0)
in deinem Test verwenden. Oder du verbindest einen echten Timer Runner mit deinem Filter. Für komplexerer Verschaltungen bietet sich cSessionTestSystem an, mit dem du eine ADTF Session laden und starten kannst.

Einen trigger_runner() kannst du wie folgt umsetzen:

class cTestFilter: public cFilter
{
    public:
        cTestFilter()
        {
            CreateRunner("do_something");
        }

        tResult Process(tNanoSeconds /*tmTrigger*/, IRunner* /*pRunner*/) override
        {
            LOG_INFO("triggered");
            RETURN_NOERROR;
        }
};

void test_function()
{
    cTestFilter oFilter;
    trigger_runner(oFilter, "do_something");
}
Actions #1

Updated by hidden about 3 years ago

  • Project changed from Public Support to 30
  • Status changed from New to In Progress
  • Customer set to CARIAD
  • Topic set to ADTF::TestingSDK
Actions #2

Updated by hidden about 3 years ago

Hallo Gustavo,

dafür kannst Du einfach trigger_runner() (https://support.digitalwerk.net/adtf/v3/adtf_html/namespaceadtf_1_1streaming_1_1testing_1_1hollow.html#a7ab7163c15d9d1f130fa4e5fcc3d0fa0)
in deinem Test verwenden. Oder du verbindest einen echten Timer Runner mit deinem Filter. Für komplexerer Verschaltungen bietet sich cSessionTestSystem an, mit dem du eine ADTF Session laden und starten kannst.

Grüße,

Martin

Actions #3

Updated by hidden about 3 years ago

  • Status changed from In Progress to Customer Feedback Required
Actions #4

Updated by hidden about 3 years ago

Hallo Martin,

vielen Dank für deine Antwort.
Hättest du ein Beispiel von der Umsetzung vom trigger_runner() ?

Grüße,
Gustavo

Actions #5

Updated by hidden about 3 years ago

Hi Gustavo,

hilft Dir das?:

class cTestFilter: public cFilter
{
    public:
        cTestFilter()
        {
            CreateRunner("do_something");
        }

        tResult Process(tNanoSeconds /*tmTrigger*/, IRunner* /*pRunner*/) override
        {
            LOG_INFO("triggered");
            RETURN_NOERROR;
        }
};

void test_function()
{
    cTestFilter oFilter;
    trigger_runner(oFilter, "do_something");
}

Grüße,

Martin

Actions #6

Updated by hidden about 3 years ago

  • Description updated (diff)
Actions #7

Updated by hidden about 3 years ago

^Hallo Martin,

ja, es hat geholfen. Danke dir.
Das Ticket kann geschlossen werden.
Viele Grüße,
Gustavo

Actions #8

Updated by hidden about 3 years ago

  • Status changed from Customer Feedback Required to In Progress
  • Resolution set to Solved Issue
Actions #10

Updated by hidden about 3 years ago

  • FAQ Links set to https://support.digitalwerk.net/projects/download-center/wiki/FAQ's/edit#Q-How-can-I-generate-time-triggered-filter
  • Affected Products ADTF 3.12.5 added
  • Platform Windows 10 64bit added
Actions #11

Updated by hidden about 3 years ago

  • Status changed from In Progress to To Be Closed
Actions #12

Updated by hidden about 3 years ago

  • Project changed from 30 to Public Support
  • Subject changed from ADTF3 - Testing - cTestWriter but for time triggering to Write a test with trigger_runner()
  • Description updated (diff)
  • Private changed from Yes to No
Actions #13

Updated by hidden about 3 years ago

  • FAQ Links changed from https://support.digitalwerk.net/projects/download-center/wiki/FAQ's/edit#Q-How-can-I-generate-time-triggered-filter to https://support.digitalwerk.net/projects/download-center/wiki/FAQ's/#Q-How-to-generate-time-triggerd-filter
Actions #14

Updated by hidden about 3 years ago

  • FAQ Links changed from https://support.digitalwerk.net/projects/download-center/wiki/FAQ's/#Q-How-to-generate-time-triggerd-filter to https://support.digitalwerk.net/projects/download-center/wiki/FAQ's#Q-How-to-use-a-trigger-runner-in-a-test
Actions #15

Updated by hidden over 2 years ago

  • Status changed from To Be Closed to Closed
Actions

Also available in: Atom PDF