Compare commits

...

4 Commits
v0.1 ... main

Author SHA1 Message Date
732624c429
Added is_equal_arr and not functions 2021-02-20 20:25:54 +05:00
7c262a29e4
Removed object files added by mistake 2021-02-15 15:06:21 +05:00
36d285f351
Improved README.md documentation 2021-02-15 15:04:33 +05:00
a4ece9c014
Added LICENCE 2021-02-15 07:51:15 +05:00
6 changed files with 64 additions and 0 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 dm1sh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -13,3 +13,29 @@ run_tests();
...
```
# Currently builtin matchers
You can use the following functions or just pass boolean value as first argument of `test()`
- `int is_equal(void *res, void *correct)`
- `int is_true(void *res)`
- `int is_false(void *res)`
- `int is_equal_array(void **res, int size, void **correct)`
- `int not(void *res)`
# Installation:
```bash
make clean
make CT_VERSION=1
sudo make install CT_VERSION=1
```
# Uninstall:
It is also required for update
```bash
sudo make uninstall CT_VERSION=1
```

View File

@ -4,5 +4,7 @@
int is_equal(void *res, void *correct);
int is_true(void *res);
int is_false(void *res);
int is_equal_array(void **res, int size, void **correct);
int not(void *res);
#endif

Binary file not shown.

Binary file not shown.

View File

@ -11,6 +11,21 @@ int is_true(void *res)
}
int is_false(void *res)
{
return !res;
}
int is_equal_array(void **res, int size, void **correct)
{
for (int i = 0; i < size; i++)
if (res[i])
if (res[i] != correct[i])
return 0;
return 1;
}
int not(void *res)
{
return !res;
}