Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
update test
change `--all` to be in ascending order by default
  • Loading branch information
ManojTGN committed Apr 11, 2024
1 parent 59afb70 commit 558a186
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/ascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ asciiParams parseParameter(int argv, char** args){
params.onlyChar = 1; //hardcoded;
params._onlyAll = !(params.onlyDec || params.onlyHex || params.onlyOct);

// params.content = params.content == NULL?(uint8_t*)calloc(1,sizeof(uint8_t)):params.content;
// params.contentSize = strlen(params.content);
if(params.showAll && params.order == 0) params.order = 1;

return params;
}
Expand Down
15 changes: 13 additions & 2 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,19 @@ int main(){
assert( isOct("8") == false);

// isBin()
assert( isBin("") == false);
assert( isBin("b") == false);
assert( isBin("") == false );
assert( isBin("b") == false );
assert( isBin("2b") == false );
assert( isBin("3b") == false );
assert( isBin("4b") == false );
assert( isBin("5b") == false );
assert( isBin("6b") == false );
assert( isBin("7b") == false );
assert( isBin("8b") == false );
assert( isBin("9b") == false );
assert( isBin("0b") == BINARY);
assert( isBin("1b") == BINARY);
assert( isBin("10001b") == BINARY);

return 0;
}

0 comments on commit 558a186

Please sign in to comment.