File: histogramtest.cpp

package info (click to toggle)
ffmpegthumbnailer 2.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 904 kB
  • sloc: cpp: 11,154; ansic: 76; sh: 37; makefile: 11
file content (32 lines) | stat: -rw-r--r-- 560 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
#include <iostream>
#include <string>
#include <vector>

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

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]);
    }
}

}