annotate branches/carfac_cpp/unittest/CARFAC_unittest.cpp @ 564:9c4c3675c3f8
* Added class Ear, and moved the CARFAC members AGC CAR IHC into Ear. CARFAC now holds an array of Ear. TBD what is best.
* Moved the files around, and introduced a makefile that builds unittests using GTest. (Note, GTest path is configured in makefile atm.).
- two moronic tests implemented. :)
author |
Ulf.Hammarqvist@gmail.com |
date |
Sun, 20 May 2012 22:36:47 +0000 |
parents |
|
children |
69c95fbc3634 |
rev |
line source |
Ulf@564
|
1 #include "CARFAC.h"
|
Ulf@564
|
2 #include "CARFAC_common.h"
|
Ulf@564
|
3 #include "gtest/gtest.h"
|
Ulf@564
|
4
|
Ulf@564
|
5 /*
|
Ulf@564
|
6 * CARFACDesignTest - Test suite for constructor related tests.
|
Ulf@564
|
7 */
|
Ulf@564
|
8 TEST(CARFACDesignTest, SampleRate) {
|
Ulf@564
|
9 CAR_parameters * car_params = new CAR_parameters();;
|
Ulf@564
|
10 IHC_parameters * ihc_params = new IHC_parameters();
|
Ulf@564
|
11 AGC_parameters * agc_params = new AGC_parameters();
|
Ulf@564
|
12
|
Ulf@564
|
13 int arbitrary_number = 1347;
|
Ulf@564
|
14
|
Ulf@564
|
15 CARFAC* fooCarfac = new CARFAC(arbitrary_number, car_params, ihc_params, agc_params, 1);
|
Ulf@564
|
16 EXPECT_EQ(fooCarfac->fs_, arbitrary_number);
|
Ulf@564
|
17 }
|
Ulf@564
|
18
|
Ulf@564
|
19 TEST(CARFACDesignTest, NumberOfEars) {
|
Ulf@564
|
20 CAR_parameters * car_params = new CAR_parameters();;
|
Ulf@564
|
21 IHC_parameters * ihc_params = new IHC_parameters();
|
Ulf@564
|
22 AGC_parameters * agc_params = new AGC_parameters();
|
Ulf@564
|
23
|
Ulf@564
|
24 int arbitrary_number = 1347;
|
Ulf@564
|
25
|
Ulf@564
|
26 CARFAC* fooCarfac = new CARFAC(arbitrary_number, car_params, ihc_params, agc_params, 2);
|
Ulf@564
|
27 EXPECT_EQ(fooCarfac->n_ears_, foobadooba->ears_.size());
|
Ulf@564
|
28 }
|