<commit_before>#include "foundation/math/ipolygon.h"

SP_SUIT(ipolygon);

SP_CASE(ipolygon, end) {
    SP_TRUE(1);
}<commit_msg>test for :ipolygon2d<commit_after>#include "foundation/math/ipolygon.h"

SP_SUIT(ipolygon);

SP_CASE(ipolygon, end) {
    SP_TRUE(1);
}

SP_SUIT(ipolygon2d);

SP_CASE(ipolygon2d, ipolygon2dmake) {
    ipolygon2d *poly = ipolygon2dmake(10);
    SP_TRUE(poly->pos != NULL);
    SP_TRUE(ipolygon2dsize(poly) == 0);
    SP_TRUE(islicecapacity(poly->pos) == 10);
    irefdelete(poly);
}

SP_CASE(ipolygon2d, ipolygon2dadd) {
    ipolygon2d *poly = ipolygon2dmake(10);
    ipos2 pos[]={{0,0},{0, 1},{1, 1},{1,0}};
    ipolygon2dadd(poly, pos, 4);
    SP_TRUE(ipolygon2dsize(poly) == 4);
    
    irefdelete(poly);
    SP_TRUE(1);
}

SP_CASE(ipolygon2d, ipolygon2dcontains) {
    ipolygon2d *poly = ipolygon2dmake(10);
    ipos2 pos[]={{0,0},{0, 1},{1, 1},{1,0}};
    ipolygon2dadd(poly, pos, 4);
    SP_TRUE(ipolygon2dsize(poly) == 4);
    
    SP_TRUE(ipolygon2dcontains(poly, pos));
    //SP_TRUE(ipolygon2dcontains(poly, pos+1));
    //SP_TRUE(ipolygon2dcontains(poly, pos+2));
    //SP_TRUE(ipolygon2dcontains(poly, pos+3));
    
    SP_TRUE(ipolygon2dcontains(poly, &poly->center));
    
    ipos2 xpos[]={{-1,-1},{2,2},{0,4}};
    SP_FALSE(ipolygon2dcontains(poly, xpos));
    SP_FALSE(ipolygon2dcontains(poly, xpos+1));
    SP_FALSE(ipolygon2dcontains(poly, xpos+2));
    
    irefdelete(poly);
    SP_TRUE(1);
}

SP_CASE(ipolygon2d, end) {
    SP_TRUE(1);
}
{'fraction_non_alphanumeric': 0.17955615332885003, 'fraction_numerical': 0.05110961667787491, 'mean_word_length': 4.593984962406015, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5028240', 'n_tokens_mistral': 686, 'n_tokens_neox': 673, 'n_words': 80}