Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ex02/src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "test.h"
#include "../include/test.h"

int test_small()
void test_small()
{
assert(my_strcmp("", "") == 0);
assert(my_strcmp("A", "A") == 0);
assert(my_strcmp("AB", "AB") == 0);
assert(my_strcmp("AB", "AC") == -1);
assert(my_strcmp("AB", "AA") == 1);
assert(my_strcmp("AB", "AD") == -1);
assert(my_strcmp("AB", "AD") == -2);
}

int test_long()
void test_long()
{
assert(my_strcmp("HELLO WORLD", "HELLA WORLD") > 0);
assert(my_strcmp("HELLO WORLD", "HELL WORLD") == 1);
assert(my_strcmp("HELLO WORLD", "HELL WORLD") == 47);
}

int main(int argc, char *argv[])
int main()
{
test_small();
test_long();
Expand Down