@ -1,7 +1,8 @@
clear
ceedling test:all
rm -r build
cd src/
gcc stringManipulation.c error.c loginCustomer.c createCustomer.c mainMenu.c program.c -lm -o program.out
gcc helperFunctions.c error.c loginCustomer.c createCustomer.c mainMenu.c program.c -lm -o program.out
./program.out
rm program.out
cd ..
@ -36,7 +36,7 @@
:source:
- src/createCustomer.*
- src/customerLogin.*
- src/stringManipulation.*
- src/helperFunctions.*
- src/error.*
:support:
- test/support
@ -5,7 +5,7 @@
#include <stdbool.h>
#include <time.h>
#include "customerProperties.h"
#include "stringManipulation.h"
#include "helperFunctions.h"
#include "error.h"
int generateID();
void collectCustomerProperties();
@ -1,4 +1,4 @@
/*Code written by Julius Philipp Engel, fdai7057*/
char *stringConcatenation(char *string_1, char *string_2)
@ -116,3 +116,24 @@ char *generateCheckString(unsigned int customerID, char *customerPassword)
*(checkString+checkStringLength) = '\0';
return checkString;
}
double stod(char *s)
{
double result, power;
int i=0, sign;
sign = (*(s) == '-') ? -1 : 1;
if(*(s)=='+'||*(s)=='-'){
++i;
for(result = 0.0; *(s+i)!='.';++i){
result = 10.0 * result + (*(s+i) - '0');
if(*(s+i)=='.'){
for(power = 1.0;*(s+i)!='\0';++i){
result = 10.0 * result + (*(s+i)- '0');
power *= 10.0;
return sign * result / power;
@ -11,4 +11,5 @@ unsigned int toUnsignedInteger(char *);
unsigned int power(unsigned int, unsigned int);
bool everyCharacterIsDigit(char *);
bool isLetterOfAlphabet(char *);
double stod(char *);
#endif
@ -4,7 +4,6 @@
#include <stdlib.h>
#include <string.h>
/*#include "stringManipulation.h"*/
#include "createCustomer.h"
#define MAX_LOGIN_ATTEMPTS 3
@ -1,7 +1,7 @@
#include <unity.h>
#include <limits.h>
#include <math.h>
#include "../src/stringManipulation.c"
#include "../src/helperFunctions.c"
#include "../src/error.c"
#include "../src/createCustomer.c"
@ -1,6 +1,6 @@
#include "../src/loginCustomer.c"
void setUp(){};
void tearDown(){};
@ -2,7 +2,7 @@
void test_isLetterOfAlphabet()