Skip to content

Commit

Permalink
[test] refs fibercrypto#5 Initial test util.coin
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Mar 28, 2020
1 parent b59a03c commit 881a092
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
28 changes: 28 additions & 0 deletions lib/cgo/tests/check_util.coin.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>

#include <check.h>
#include <string.h>
#include <time.h>

#include "fcassert.h"
#include "fcerrors.h"
#include "fcstring.h"
#include "fctest.h"
#include "libfibercrypto.h"

START_TEST(TestNewGenericOutput) {
printf("Load TestNewGenericOutput \n");
core__AltcoinMetadata fakeMeta;
}
END_TEST

Suite *check_util_coin(void) {
Suite *s = suite_create("Load check_util_coin");
TCase *tc;
tc = tcase_create("check_util_coin");
tcase_add_checked_fixture(tc, setup, teardown);
tcase_add_test(tc, TestNewGenericOutput);
suite_add_tcase(s, tc);
return s;
}
6 changes: 2 additions & 4 deletions lib/cgo/tests/check_util.datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include "fctest.h"
#include "libfibercrypto.h"

START_TEST(TestParseDate)
{
START_TEST(TestParseDate) {
printf("Load TestParseDate \n");
GoUint64_ some_date = 1577665665;
GoInt ny, nm, nd, nh, nmin, ns;
Expand All @@ -22,8 +21,7 @@ START_TEST(TestParseDate)
}
END_TEST

Suite *check_util_datetime(void)
{
Suite *check_util_datetime(void) {
Suite *s = suite_create("Load check_util_datetime");
TCase *tc;
tc = tcase_create("check_util_datetime");
Expand Down
4 changes: 2 additions & 2 deletions lib/cgo/tests/test_main.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "test_main.h"
#include <check.h>
// run suite
int main(void)
{
int main(void) {
int number_failed = 0;
SRunner *sr = srunner_create(check_util_cipher());
srunner_add_suite(sr, check_util_datetime());
srunner_add_suite(sr, check_util_coin());
srunner_set_fork_status(sr, CK_NOFORK);
srunner_run_all(sr, CK_VERBOSE);
number_failed = srunner_ntests_failed(sr);
Expand Down
1 change: 1 addition & 0 deletions lib/cgo/tests/test_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

Suite *check_util_cipher(void);
Suite *check_util_datetime(void);
Suite *check_util_coin(void);

#endif

0 comments on commit 881a092

Please sign in to comment.