File: histogramtest.cpp

package info (click to toggle)
ffmpegthumbnailer 2.2.2%2Bgit20220218%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 864 kB
  • sloc: cpp: 11,403; ansic: 76; sh: 37; makefile: 13
file content (35 lines) | stat: -rw-r--r-- 568 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
#include <string>
#include <vector>
#include <iostream>

#include <catch.hpp>
#include "libffmpegthumbnailer/histogram.h"

namespace ffmpegthumbnailer
{

TEST_CASE("CreationInt")
{
    Histogram<int> hist;

    for (int i = 0; i < 255; ++i)
    {
        REQUIRE(0 == hist.r[i]);
        REQUIRE(0 == hist.g[i]);
        REQUIRE(0 == hist.b[i]);
    }
}

TEST_CASE("CreationFloat")
{
    Histogram<float> hist;

    for (int i = 0; i < 255; ++i)
    {
        REQUIRE(0.0 == hist.r[i]);
        REQUIRE(0.0 == hist.g[i]);
        REQUIRE(0.0 == hist.b[i]);
    }
}

}