forked from ChicoState/UnitTestPractice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPassword.cpp.gcov
More file actions
51 lines (51 loc) · 1.94 KB
/
Password.cpp.gcov
File metadata and controls
51 lines (51 loc) · 1.94 KB
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
45
46
47
48
49
50
51
-: 0:Source:Password.cpp
-: 0:Graph:Password.gcno
-: 0:Data:Password.gcda
-: 0:Runs:1
-: 1:#include "Password.h"
-: 2:#include <string>
-: 3:#include <cctype>
-: 4:using std::string;
-: 5:
-: 6:/*
-: 7: The function receives a string counts how many times the same character
-: 8: occurs at the beginning of the string, before any other characters (or the
-: 9: end of the string). The function is case-sensitive so 'Z' is different than
-: 10: 'z' and any ASCII characters are allowed.
-: 11:*/
function _ZN8Password24count_leading_charactersENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE called 3 returned 100% blocks executed 100%
3: 12:int Password::count_leading_characters(string phrase){
3: 13: return phrase.length();
call 0 returned 3
-: 14:}
-: 15:
function _ZN8Password14has_mixed_caseENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE called 2 returned 100% blocks executed 93%
2: 16:bool Password::has_mixed_case(string phrase)
-: 17:{
-: 18: bool has_lower;
-: 19: bool has_upper;
31: 20: for (int i = 0; i < phrase.length(); i++)
call 0 returned 31
branch 1 taken 29
branch 2 taken 2 (fallthrough)
-: 21: {
29: 22: if (isupper(phrase[i]))
call 0 returned 29
branch 1 taken 2 (fallthrough)
branch 2 taken 27
2: 23: has_upper = true;
27: 24: else if (islower(phrase[i]))
call 0 returned 27
branch 1 taken 27 (fallthrough)
branch 2 taken 0
27: 25: has_lower = true;
-: 26: }
2: 27: if (has_upper && has_lower)
branch 0 taken 2 (fallthrough)
branch 1 taken 0
branch 2 taken 2 (fallthrough)
branch 3 taken 0
2: 28: return true;
-: 29: else
#####: 30: return false;
-: 31:}