File: tests.h

package info (click to toggle)
ffms2 5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,000 kB
  • sloc: cpp: 6,513; ansic: 385; makefile: 164; perl: 85; sh: 22
file content (40 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef _FFMS2_TESTS_H
#define _FFMS2_TESTS_H

#include <ffms.h>
#include <gtest/gtest.h>

extern "C" {
#include <libavutil/mem.h>
#include <libavutil/pixdesc.h>
#include <libavutil/sha.h>
}

#include "data/data.h"

#define NULL_CHECK(arg) do { \
    EXPECT_NE(nullptr, arg); \
    if (arg == nullptr) \
        return false; \
    } while(0)

#define EQ_CHECK(arg1,arg2) do { \
    EXPECT_EQ(arg1, arg2); \
    if (arg1 != arg2) \
        return false; \
    } while (0)

#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)

#define TEST_ENTRY(file, data) { file, data, sizeof(data) / sizeof(*data) }

typedef struct TestDataMap {
    const char *Filename;
    const TestFrameData *TestData;
    const size_t TestDataLen;
} TestDataMap;

bool CheckFrame(const FFMS_Frame *Frame, const FFMS_FrameInfo *info, const TestFrameData *Data);

#endif