Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
732624c429 | |||
7c262a29e4 | |||
36d285f351 | |||
a4ece9c014 |
21
LICENSE
Normal file
21
LICENSE
Normal 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.
|
26
README.md
26
README.md
@ -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
|
||||
```
|
||||
|
@ -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
|
BIN
obj/ctest.o
BIN
obj/ctest.o
Binary file not shown.
BIN
obj/funcs.o
BIN
obj/funcs.o
Binary file not shown.
15
src/funcs.c
15
src/funcs.c
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user