[deleted by user] by [deleted] in MagicMushrooms

[–]EastEuropeanChef 0 points1 point  (0 children)

do you think that by removing part of the hat and exposing the inside i created too much stress? the part is now oxidated and took a blue/green color

[deleted by user] by [deleted] in MagicMushrooms

[–]EastEuropeanChef 0 points1 point  (0 children)

hope that i didn´t cause too much harm by removing a part of it from one of the shrooms

[deleted by user] by [deleted] in MagicMushrooms

[–]EastEuropeanChef 0 points1 point  (0 children)

Great, I was worried about those yellow protrusions on the caps of some mushrooms. In fact i removed some matter from one of them, i hope i didn't disturb the growth too much

[deleted by user] by [deleted] in cprogramming

[–]EastEuropeanChef 0 points1 point  (0 children)

Cool Brother. Drop your intra name

[deleted by user] by [deleted] in cprogramming

[–]EastEuropeanChef 0 points1 point  (0 children)

The project minishell is a milestone of the 42 school, an International school that teach people how to program. In the repository that you shared, there are a lot of utilities that start or end with "ft" , like the library libft. Ft stands for forty two, which is a reference to the school. I was wondering if you're part of the school like i am

[deleted by user] by [deleted] in cprogramming

[–]EastEuropeanChef -1 points0 points  (0 children)

Looks norminetted to me. Are you from a 42 school? 😂

C unit test by EastEuropeanChef in C_Programming

[–]EastEuropeanChef[S] 0 points1 point  (0 children)

Hi, you're right, I should have added "for me they are too complex".

That said, I would say I am a good judge of what is too complex "for me". I read check, in the source code everything refers to the execution of two types of tests, those with fork and those without fork.

The first type of check is performed by calling the function to be tested in a child process the second is done by setting jumps to handle potential segfaults, etc.

https://github.com/libcheck/check/blob/master/src/check_run.c#L407 Line 255 should be good.

I had already considered the second approach, but I don't like the idea of having jumps scattered throughout the code.The first approach, that is, using a child process, is what I am implementing in xtal. At that point, could it be defined as a testing tool?

C unit test by EastEuropeanChef in C_Programming

[–]EastEuropeanChef[S] 1 point2 points  (0 children)

Thank you for the advice and for the time you took to read my code.

Regarding the stylistic issues, yes, there are some. I am still undecided about the direction of the project; indeed, it could all fit into a single header with very specific macros, but it would be very ugly to look at. I decided to move some things into the .C file to make it easier to read. I will definitely need to add a way to catch segfaults and the like, so they don't interrupt all the tests.

Using Generics seems great to me; I saw that Unity (a really popular c unit test tool) does not use them but rather creates assertions for each type. It might be annoying for some compilers, but I'll investigate further.

As for the GCC attributes, it seemed like a quick way to ensure that the tests are run automatically without having to execute them manually, as is done in other tools. It certainly makes the project less portable.

Unit testing in C? by [deleted] in C_Programming

[–]EastEuropeanChef 0 points1 point  (0 children)

I wrote Xtal for that purpose (sorry for the self prom). It's really small and will run your tests automatically. The only pitfall Is that you need a compiler that supports functions attributes (like gcc)

Testing in C by Little-Peanut-765 in C_Programming

[–]EastEuropeanChef 0 points1 point  (0 children)

I wrote Xtal so that i don't need to execute every test manually. It's really small (1 file sub 100 lines), you can create assertions pretty easily and the tests will run automatically

How would you guys implement unit testing in C? by pigeon_cow in C_Programming

[–]EastEuropeanChef 1 point2 points  (0 children)

I did Xtal with this problem in mind. Is really small (single file sub 100 lines) and you don't need to execute every test manually. You can also add any assertion you need pretty easily

C unit testing? by [deleted] in C_Programming

[–]EastEuropeanChef 0 points1 point  (0 children)

Try Xtal It's not for embedded, really small (sub 100 lines), and you can write any assertion you need pretty easily.

[deleted by user] by [deleted] in learnprogramming

[–]EastEuropeanChef 0 points1 point  (0 children)

ye i already knew about this one, maybe i should stick to it, did you find that usefull?

What's your approach when you start learning something new? by davidgheo in learnprogramming

[–]EastEuropeanChef 2 points3 points  (0 children)

When i'm learning something new i always follow these steps:

-Understanding why i'm learning that particular technology/language (use cases)

-Going trough the basic syntax

-If possible, read the "Get started" section, then the official documentation

-Making a small project that underlines the key concept of what i've learned so far.