Browse Source

refactoring : Genauer defefinierter bezeichner(eindeutiger bezeichner)

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
7af65b97ce
  1. BIN
      build/test/out/c/duellist-spielesammlung-projekt.o
  2. BIN
      build/test/out/test_duellist_spielesammlung_projekt.out
  3. 118
      build/test/results/test_duellist_spielesammlung_projekt.pass
  4. 8
      src/main/duellist-spielesammlung-projekt.c

BIN
build/test/out/c/duellist-spielesammlung-projekt.o

BIN
build/test/out/test_duellist_spielesammlung_projekt.out

118
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -1,118 +0,0 @@
---
:source:
:path: src/test
:file: test_duellist_spielesammlung_projekt.c
:successes:
- :test: test_coinflip_x_starts
:line: 11
:message: ''
:unity_test_time: 0
- :test: test_coinflip_o_starts
:line: 23
:message: ''
:unity_test_time: 0
- :test: test_vertical_win
:line: 35
:message: ''
:unity_test_time: 0
- :test: test_horizontal_win
:line: 49
:message: ''
:unity_test_time: 0
- :test: test_diagonal_win
:line: 62
:message: ''
:unity_test_time: 0
- :test: test_valid_move_and_switch
:line: 76
:message: ''
:unity_test_time: 0
- :test: test_invalid_input
:line: 92
:message: ''
:unity_test_time: 0
- :test: test_valid_input
:line: 106
:message: ''
:unity_test_time: 0
- :test: test_invalid_input_negative_row
:line: 121
:message: ''
:unity_test_time: 0
- :test: test_invalid_input_overflow_column
:line: 135
:message: ''
:unity_test_time: 0
- :test: test_NumberOfMoves_returns_correct_number_of_moves
:line: 149
:message: ''
:unity_test_time: 0
- :test: test_BoardFull_returns_false_when_board_is_not_full
:line: 163
:message: ''
:unity_test_time: 0
- :test: test_BoardFull_returns_true_when_board_is_full
:line: 176
:message: ''
:unity_test_time: 0
- :test: test_CurrentPlayer_returns_correct_player
:line: 189
:message: ''
:unity_test_time: 0
- :test: test_FieldEmpty_returns_true_for_empty_field
:line: 202
:message: ''
:unity_test_time: 0
- :test: test_FieldEmpty_returns_false_for_nonempty_field
:line: 215
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthOne
:line: 228
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_WidthOne
:line: 242
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_NormalCase
:line: 256
:message: ''
:unity_test_time: 0
- :test: test_end_check_AllUncovered_NoMines
:line: 270
:message: ''
:unity_test_time: 0
- :test: test_create_minefield_ValidDimensions
:line: 289
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
:line: 314
:message: ''
:unity_test_time: 0
- :test: test_create_minefield_NegativeDimensions
:line: 328
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightZero
:line: 342
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthNumber
:line: 356
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthAgan
:line: 370
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 26
:passed: 26
:failed: 0
:ignored: 0
:stdout: []
:time: 0.05033430000003136

8
src/main/duellist-spielesammlung-projekt.c

@ -8,6 +8,7 @@
#define unknown_character 'x' #define unknown_character 'x'
#define mine_character '@' #define mine_character '@'
int checkAge(int age) { int checkAge(int age) {
return age >= MIN_AGE ? 1 : 0; return age >= MIN_AGE ? 1 : 0;
} }
@ -138,16 +139,17 @@ GameResult checkGameResult(const TicTacToeGame* game) {
return draw ? GAME_DRAW : SUCCESS; return draw ? GAME_DRAW : SUCCESS;
} }
//Nach eingabe zurberechnung der Minen anzahl //Nach eingabe zurberechnung der Minen anzahl
int calculate_mines(int height, int width) { int calculate_mines(int height, int width) {
int num_mines;
int number_mines;
if (height <= 1 || width <= 1) { if (height <= 1 || width <= 1) {
return 0; return 0;
} }
else { else {
num_mines = ((height * width) / 4);
number_mines = ((height * width) / 4);
} }
return num_mines;
return number_mines;
} }
//Zum erstellen des Spielfeldes //Zum erstellen des Spielfeldes

Loading…
Cancel
Save