Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Data Driven Test row name

Qt Data Driven Test row name

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtestlibqt5.6datatest
6 Posts 3 Posters 3.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    diredko
    wrote on 29 Mar 2016, 19:24 last edited by diredko
    #1

    Hi everyone,
    I'm trying to implement several data driven tests for my Qt Application and I need to get data row name (the string passed as an argument to newRow function) but it seems to be trickier than just doing QFETCH(QString, name).
    I have looked through Qt documentation but couldn't have found anything that could help.
    Would someone please help me understand how name of data row can be fetched in test function?

    Many thanks,
    Dmytro

    p.s. I'm using Qt 5.6

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 29 Mar 2016, 20:46 last edited by
      #2

      Hi,

      Out of curiosity, why do you need that information ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 29 Mar 2016, 20:48
      0
      • S SGaist
        29 Mar 2016, 20:46

        Hi,

        Out of curiosity, why do you need that information ?

        D Offline
        D Offline
        diredko
        wrote on 29 Mar 2016, 20:48 last edited by
        #3

        @SGaist I need to implement output messages on test failure with specific format

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 29 Mar 2016, 21:05 last edited by
          #4

          Did you saw that you can already get the output of QTest base unit test in different formats ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Paul Colby
            wrote on 31 Mar 2016, 20:42 last edited by
            #5

            Hi @diredko,

            The string passed to QTest::newRow is called the dataTag, and can be accessed via QTest::currentDataTag.

            I hope that helps :)

            pc.

            1 Reply Last reply
            1
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 31 Mar 2016, 20:47 last edited by
              #6

              Nice one ! I've missed that function. Thanks !

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              1/6

              29 Mar 2016, 19:24

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved