Matthieu Bessat
a62dd411aa
feat(Evaluator): add minus sign reducing fix(Evaluator): trim spaces test: add base for unit testing
60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
#include <stdio.h>
|
|
#include "./src/types.h"
|
|
#include "./src/list.h"
|
|
#include "./src/number_parsing.h"
|
|
#include "./src/funcs.h"
|
|
#include "./src/utils.h"
|
|
|
|
int some_computation(int a, int b, int* resPtr)
|
|
{
|
|
*resPtr = a+b;
|
|
return 0;
|
|
}
|
|
|
|
float test_func(float x)
|
|
{
|
|
return m_float_pow(x,2)-2;
|
|
}
|
|
|
|
int main () {
|
|
// test of euler
|
|
printf("lel : %f \n", m_sqrt(64));
|
|
|
|
|
|
// struct List l1;
|
|
|
|
// list_append_int(&l1, 4);
|
|
// list_append_char(&l1, '*');
|
|
// list_append_int(&l1, 5);
|
|
|
|
// list_print(&l1);
|
|
|
|
// list_delete(&l1, 0);
|
|
|
|
// list_print(&l1);
|
|
|
|
// list_delete(&l1, 0);
|
|
|
|
// list_print(&l1);
|
|
|
|
// float res = 0;
|
|
|
|
// void* ptr = &res;
|
|
|
|
// printf("%d\n", sizeof(ptr));
|
|
// int found = identify_func_name("ABS");
|
|
// printf("found: %d \n", found);
|
|
|
|
// unsigned char argsType[1] = { TYPE_FLOAT };
|
|
// int argsVals[1] = { get_int_rep_from_float(-3.145) };
|
|
// int resVal = 0;
|
|
// unsigned char resType = 0;
|
|
// execute_func(found, 1, argsType, argsVals, &resVal, &resType);
|
|
// printf("func res type: %d \n", resType);
|
|
// printf("func res: %f \n", get_float_from_int_rep(resVal));
|
|
|
|
// int stat = parse_float("1052.254", &res);
|
|
// printf("float parsing stat: %d \n", stat);
|
|
// printf("final float: %f \n", res);
|
|
}
|
|
|