lunch-poll-legacy

Lunch Poll Legacy -- poll colleagues where to have lunch
Log | Files | Refs | README | LICENSE

http_test.c (535B)


      1 /**
      2  * Lunch Poll Legacy
      3  * Copyright 2026 Matthias Balk
      4  */
      5 
      6 #include <assert.h>
      7 #include <stdlib.h>
      8 #include <string.h>
      9 
     10 #include "http.h"
     11 
     12 static void test_split_and_decode_form_params()
     13 {
     14   char query_string[20];
     15   strcpy(query_string, "x=a%2Cb&y=c%20d");
     16 
     17   char* params[MAX_POST_SIZE];
     18   split_and_decode_form_params(query_string, params);
     19 
     20   assert(strcmp(params[0], "x=a,b") == 0);
     21   assert(strcmp(params[1], "y=c d") == 0);
     22 }
     23 
     24 int main(int argc, char **argv)
     25 {
     26   test_split_and_decode_form_params();
     27 
     28   return EXIT_SUCCESS;
     29 }