-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathcheckValidWave.cpp
More file actions
27 lines (22 loc) · 1011 Bytes
/
checkValidWave.cpp
File metadata and controls
27 lines (22 loc) · 1011 Bytes
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
#include <gtest/gtest.h>
#include "../../src/lib_ccaligner/read_wav_file.h"
// Empty fileData
TEST(checkValidWave, EmptyVector){
ASSERT_NE(checkValidWave([]), true);
}
// Not enough fileData
TEST(checkValidWave, NotFullVector){
ASSERT_NE(checkValidWave(['R']), true);
ASSERT_NE(checkValidWave(['R', 'I']), true);
ASSERT_NE(checkValidWave(['R', 'I', 'F']), true);
ASSERT_NE(checkValidWave(['R', 'I', 'F', 'F']), true);
ASSERT_NE(checkValidWave(['W']), true);
ASSERT_NE(checkValidWave(['W', 'A']), true);
ASSERT_NE(checkValidWave(['W', 'A', 'V']), true);
ASSERT_NE(checkValidWave(['W', 'A', 'V', 'E']), true);
}
// Normal fileData
TEST(checkValidWave, FullVector){
ASSERT_EQ(checkValidWave(['R','I','F','F','l','/','',' ','W','A','V','E','f','m','t',' ','',' ',' ',' ','',' ']), true);
ASSERT_EQ(checkValidWave(['R','I','F','F','l','/','',' ','W','A','V','E','f','m','t',' ','',' ',' ',' ','',' ','',' ','Ђ','>',' ',' ',' ','}',' ',' ','',' ']), true);
}