mirror of
https://github.com/caperren/school_archives.git
synced 2025-11-09 21:51:15 +00:00
Added Software Engineering II code
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
#include "dominion.h"
|
||||
#include "dominion_helpers.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "rngs.h"
|
||||
|
||||
#define DEBUG 0
|
||||
#define NOISY_TEST 1
|
||||
|
||||
int checkDrawCard(int p, struct gameState *post) {
|
||||
int r;
|
||||
|
||||
r = drawCard (p, post);
|
||||
}
|
||||
|
||||
int main () {
|
||||
|
||||
int i, n, r, p, deckCount, discardCount, handCount;
|
||||
|
||||
int k[10] = {adventurer, council_room, feast, gardens, mine,
|
||||
remodel, smithy, village, baron, great_hall};
|
||||
|
||||
struct gameState G;
|
||||
|
||||
printf ("Testing drawCard.\n");
|
||||
|
||||
printf ("RANDOM TESTS.\n");
|
||||
|
||||
SelectStream(2);
|
||||
PutSeed(3);
|
||||
|
||||
for (n = 0; n < 2000; n++) {
|
||||
for (i = 0; i < sizeof(struct gameState); i++) {
|
||||
((char*)&G)[i] = floor(Random() * 256);
|
||||
}
|
||||
p = floor(Random() * 1000);
|
||||
checkDrawCard(p, &G);
|
||||
}
|
||||
|
||||
printf ("ALL TESTS OK\n");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
Reference in New Issue
Block a user