File: defs_gtest.cpp

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (44 lines) | stat: -rw-r--r-- 911 bytes parent folder | download | duplicates (4)
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
41
42
43
44
/*
 * =====================================================================================
 *
 *       Filename:  defs_gtest.cpp
 *
 *    Description:  Test pbdata/defs.h
 *
 *        Version:  1.0
 *        Created:  10/29/2012 05:17:49 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Yuan Li (yli), yli@pacificbiosciences.com
 *        Company:  Pacific Biosciences
 *
 * =====================================================================================
 */

#include "gtest/gtest.h"
#include "defs.h"

TEST(DefsTest, MIN) {
    EXPECT_EQ(MIN(1,10000), 1);
    EXPECT_EQ(MIN(-1,10000), -1);
    EXPECT_EQ(MIN(-1,-2), -2);
}

TEST(DefsTest, MAX) {
    EXPECT_EQ(MAX(1,10000), 10000);
    EXPECT_EQ(MAX(-1,10000), 10000);
    EXPECT_EQ(MAX(-1,-2), -1);
}

TEST(DefsTest, SWAP) {
    int x = 10;
    int y = 100;
    SWAP(x, y);

    EXPECT_EQ(x, 100);
    EXPECT_EQ(y, 10);
}