Earthnuker is a user on cybre.space. You can follow them or interact with them if you have an account anywhere in the fediverse.
Earthnuker @Earthnuker

tfw you're doing Programming homework, upload your program to the testing website and get this result in the mess of XML it spat back at you because *something* broke horribly:
"(79) fail: wrong result of strToLowerCase("HELLO"), expected hello but found hello"
... yeah, right makes *perfect* sense

· Web · 0 · 2

@elomatreb don't think so, the string "class" we're supposed to implement is just an int and a pointer to some malloc()'d memory, and it worked fine when i tested it, also the assignment description doesn't mention that it's supposed to be null-terminated :|

@elomatreb no problem, thanks for trying to help :blobpats:

keybase.pub/earthnuker/PMT/ here's my code if anyone feels like taking a look (and we have to code in C90, which i'm not a huge fan of, i even e-mailed my prof, asking if he could change the compiler flags on the online platform to use C99) (and *of course* we don't get to see the tests he runs so we can check our shit locally) T_T

@Earthnuker is this String struct given to you as part of the assignment? also, how are the tests run (sounds like its linking against your code and calling each function with whatever input it wants?)

@chr yeah, the struct is given ( the whole String.h file was given, and parts of the String.c, i wrote the Makefile to make testing easier :P ) and i assume the tests are run by linking against my code (or it's included into another file, you never know ¯\_(ツ)_/¯)

@Earthnuker the to lower, to upper, and map impls look right to me, only possible bug i can see is that the header defines strMap as

String strMap(String this,char f(char));

while your impl is

String strMap(String this,_char f(_char));

i can't imagine why that would be a problem as _char is typedef'd to char and it should compile error if anything, but other than that i can't see anything obviously wrong

@chr maybe there's a problem with how the tests compare the returned result to the expected result, maybe they're using ... strcmp()😱 , i'll just ask one of the tutors during Programming-Lab tomorrow, thanks for your help though :dragnpats:

@chr got it working by poking at my code until it compiled when i uploaded it \:D/