From 12017db0bfe62e7777e1ab6ba5b14729dcd4c351 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 24 Apr 2019 09:24:38 -0400 Subject: [PATCH] Move test code around --- src/test-algs.cc | 8 ++++++++ src/test-iter.cc | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/test-algs.cc b/src/test-algs.cc index 42a9538dc..8ec93f009 100644 --- a/src/test-algs.cc +++ b/src/test-algs.cc @@ -28,6 +28,12 @@ #include "hb-algs.hh" +static char * +test_func (int a, char **b) +{ + return b ? b[a] : nullptr; +} + int main (int argc, char **argv) { @@ -46,5 +52,7 @@ main (int argc, char **argv) q.second = 4; assert (i == 4); + hb_invoke (test_func, 0, nullptr); + return 0; } diff --git a/src/test-iter.cc b/src/test-iter.cc index cf1e6d670..9ce8b0ca2 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -99,12 +99,6 @@ test_iterable (const Iterable &lst = Null(Iterable)) test_iterator (lst.iter ()); } -static char * -test_func (int a, char **b) -{ - return b[a]; -} - int main (int argc, char **argv) { @@ -203,8 +197,5 @@ main (int argc, char **argv) long vl; s >> vl; - if (0) - hb_invoke (test_func, 0, nullptr); - return 0; }