Skip to content

Commit c3d0c89

Browse files
committed
add stub for the API test
1 parent efeb9a4 commit c3d0c89

4 files changed

Lines changed: 71 additions & 1 deletion

File tree

tests/api.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* api.c
2+
*
3+
* Copyright (C) 2014-2017 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSH.
6+
*
7+
* wolfSSH is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSH is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
22+
#include <tests/unit.h>
23+
24+
25+
int ApiTest(void)
26+
{
27+
return 0;
28+
}

tests/include.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
check_PROGRAMS += tests/unit.test
66
noinst_PROGRAMS += tests/unit.test
77

8-
tests_unit_test_SOURCES = tests/unit.c
8+
tests_unit_test_SOURCES = tests/unit.c tests/api.c
99

1010
tests_unit_test_CFLAGS = -DNO_MAIN_DRIVER $(AM_CFLAGS)
1111
tests_unit_test_LDADD = src/libwolfssh.la $(LIB_STATIC_ADD)

tests/unit.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <wolfssh/ssh.h>
2424
#include <wolfssh/keygen.h>
2525
#include <wolfssh/internal.h>
26+
#include <tests/unit.h>
2627

2728

2829
/* Utility functions */
@@ -393,6 +394,10 @@ int main(void)
393394
testResult = testResult || unitResult;
394395
#endif
395396

397+
unitResult = ApiTest();
398+
printf("API: %s\n", (unitResult == 0 ? "SUCCESS" : "FAILED"));
399+
testResult = testResult || unitResult;
400+
396401
return (testResult ? 1 : 0);
397402
}
398403

tests/unit.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* unit.h
2+
*
3+
* Copyright (C) 2014-2016 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSH.
6+
*
7+
* wolfSSH is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSH is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
22+
/*
23+
* The unit module contains the main driver for the wolfSSH unit tests.
24+
*/
25+
26+
27+
#pragma once
28+
29+
#ifdef __cplusplus
30+
extern "C" {
31+
#endif
32+
33+
int ApiTest(void);
34+
35+
#ifdef __cplusplus
36+
}
37+
#endif

0 commit comments

Comments
 (0)