Laurence Lundblade | 624405d | 2018-09-18 20:10:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | cmd_line_mainc.c -- basic tests for qcbor encoder / decoder |
| 3 | |
| 4 | This is governed by the MIT license. |
| 5 | |
| 6 | Copyright 2018 Laurence Lundblade |
| 7 | |
| 8 | Permission is hereby granted, free of charge, to any person obtaining |
| 9 | a copy of this software and associated documentation files (the |
| 10 | "Software"), to deal in the Software without restriction, including |
| 11 | without limitation the rights to use, copy, modify, merge, publish, |
| 12 | distribute, sublicense, and/or sell copies of the Software, and to |
| 13 | permit persons to whom the Software is furnished to do so, subject to |
| 14 | the following conditions: |
| 15 | |
| 16 | The above copyright notice and this permission notice shall be included |
| 17 | in all copies or substantial portions of the Software. |
| 18 | |
| 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 23 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 24 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 25 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 26 | SOFTWARE. |
| 27 | */ |
Laurence Lundblade | 74f6841 | 2018-09-13 12:18:49 -0700 | [diff] [blame] | 28 | // Created by Laurence Lundblade on 9/13/18. |
Laurence Lundblade | 74f6841 | 2018-09-13 12:18:49 -0700 | [diff] [blame] | 29 | |
| 30 | #include <stdio.h> |
| 31 | |
Laurence Lundblade | 781fd82 | 2018-10-01 09:37:52 -0700 | [diff] [blame] | 32 | #include "run_tests.h" |
Laurence Lundblade | 74f6841 | 2018-09-13 12:18:49 -0700 | [diff] [blame] | 33 | |
Laurence Lundblade | a954db9 | 2018-09-28 19:27:31 -0700 | [diff] [blame] | 34 | |
Laurence Lundblade | cc2ed34 | 2018-09-22 17:29:55 -0700 | [diff] [blame] | 35 | int fputs_wrapper(const char *szString, void *ctx) |
| 36 | { |
| 37 | return fputs(szString, (FILE *)ctx); |
| 38 | } |
Laurence Lundblade | 2300b56 | 2018-09-29 20:00:09 -0700 | [diff] [blame] | 39 | |
Laurence Lundblade | 2300b56 | 2018-09-29 20:00:09 -0700 | [diff] [blame] | 40 | |
Laurence Lundblade | 570fab5 | 2018-10-13 18:28:27 +0800 | [diff] [blame^] | 41 | int main(int argc, const char * argv[]) |
| 42 | { |
| 43 | (void)argc; // Suppress unused warning |
| 44 | (void)argv; // Supress unused warning |
Laurence Lundblade | 68a1335 | 2018-09-23 02:19:54 -0700 | [diff] [blame] | 45 | |
Laurence Lundblade | cc2ed34 | 2018-09-22 17:29:55 -0700 | [diff] [blame] | 46 | int nNumTestsFailed = run_tests(&fputs_wrapper, stdout, NULL); |
| 47 | |
| 48 | return nNumTestsFailed; |
Laurence Lundblade | 74f6841 | 2018-09-13 12:18:49 -0700 | [diff] [blame] | 49 | } |