Changeset 67fbf60 in subsurface


Ignore:
Timestamp:
May 6, 2017, 10:31:09 AM (3 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
38af1f2
Parents:
4627973
git-author:
Stefan Fuchs <sfuchs@…> (05/06/17 06:36:29)
git-committer:
Dirk Hohndel <dirk@…> (05/06/17 10:31:09)
Message:

Test for adding a picture with data after JFIF EOI to a dive

Add one more picture to the already existing test.
This new picture is a JPEG and has data after JFIF EOI tag.

Suggested-by: Miika Turkia <miika.turkia@…>
Signed-off-by: Stefan Fuchs <sfuchs@…>

Signed-off-by: Stefan Fuchs <sfuchs@…>

Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • tests/CMakeLists.txt

    r1ff0aee r67fbf60  
    2828        set(WINDOWS_STAGING_TESTS ${CMAKE_BINARY_DIR}/staging_tests)
    2929        install(DIRECTORY ${SUBSURFACE_SOURCE}/dives DESTINATION ${WINDOWS_STAGING_TESTS})
    30         install(FILES ${SUBSURFACE_SOURCE}/wreck.jpg DESTINATION ${WINDOWS_STAGING_TESTS})
    3130
    3231        # Check if we can run tests locally using wine
  • tests/testpicture.cpp

    ree1bf18 r67fbf60  
    1616{
    1717        struct dive *dive;
    18         struct picture *pic;
     18        struct picture *pic1, *pic2;
    1919        verbose = 1;
    2020
     
    2222        dive = get_dive(0);
    2323        QVERIFY(dive != NULL);
    24         pic = dive->picture_list;
     24        pic1 = dive->picture_list;
    2525        // So far no picture in dive
    26         QVERIFY(pic == NULL);
     26        QVERIFY(pic1 == NULL);
    2727
    28         dive_create_picture(dive, SUBSURFACE_TEST_DATA "/wreck.jpg", 0, false);
    29         pic = dive->picture_list;
    30         // Now there is a picture
    31         QVERIFY(pic != NULL);
    32         // Appearing at time 21:01
    33         QVERIFY(pic->offset.seconds == 1261);
    34         QVERIFY(pic->latitude.udeg == 47934500);
    35         QVERIFY(pic->longitude.udeg == 11334500);
     28        dive_create_picture(dive, SUBSURFACE_TEST_DATA "/dives/images/wreck.jpg", 0, false);
     29        dive_create_picture(dive, SUBSURFACE_TEST_DATA "/dives/images/data_after_EOI.jpg", 0, false);
     30        pic1 = dive->picture_list;
     31        pic2 = pic1->next;
     32        // Now there are two picture2
     33        QVERIFY(pic1 != NULL);
     34        QVERIFY(pic2 != NULL);
     35        // 1st appearing at time 21:01
     36        // 2nd appearing at time 22:01
     37        QVERIFY(pic1->offset.seconds == 1261);
     38        QVERIFY(pic1->latitude.udeg == 47934500);
     39        QVERIFY(pic1->longitude.udeg == 11334500);
     40        QVERIFY(pic2->offset.seconds == 1321);
    3641
    37         QVERIFY(pic->hash == NULL);
    38         learnHash(pic, hashFile(localFilePath(pic->filename)));
    39         QCOMPARE(pic->hash, "929ad9499b7ae7a9e39ef63eb6c239604ac2adfa");
     42        QVERIFY(pic1->hash == NULL);
     43        QVERIFY(pic2->hash == NULL);
     44        learnHash(pic1, hashFile(localFilePath(pic1->filename)));
     45        learnHash(pic2, hashFile(localFilePath(pic2->filename)));
     46        QCOMPARE(pic1->hash, "929ad9499b7ae7a9e39ef63eb6c239604ac2adfa");
     47        QCOMPARE(pic2->hash, "fa8bd48f8f24017a81e1204f52300bd98b43d4a7");
    4048
    4149}
Note: See TracChangeset for help on using the changeset viewer.