summaryrefslogtreecommitdiffstats
path: root/nserver/tests/protocol_tests.c
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-11-02 10:43:43 -0400
committerrsiddharth <s@ricketyspace.net>2020-04-17 20:56:34 -0400
commit64ab0153238cd3d06296cd31bd9bc09ba8545f33 (patch)
tree73ccdd6ca99c39800e48f5904292f8490999a63b /nserver/tests/protocol_tests.c
parent71768c6233d8249425e2a3ae34993be84f245e0a (diff)
nserver: protocol: Define ssmean.
* nserver/src/protocol.c (ssmean): New function. * nserver/tests/protocol_tests.c (test_ssmean): New test. (all_tests): ADd test_ssmean.
Diffstat (limited to 'nserver/tests/protocol_tests.c')
-rw-r--r--nserver/tests/protocol_tests.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/nserver/tests/protocol_tests.c b/nserver/tests/protocol_tests.c
index 75bf614..6fc2831 100644
--- a/nserver/tests/protocol_tests.c
+++ b/nserver/tests/protocol_tests.c
@@ -42,12 +42,29 @@ char *test_sssample()
return NULL;
}
+char *test_ssmean()
+{
+ double m = 0;
+
+ m = ssmean("crimson");
+ mu_assert(m == 8, "ssmean failed 0");
+
+ m = ssmean("/vermilion");
+ mu_assert(m == 17, "ssmean failed 1");
+
+ m = ssmean("/ruby");
+ mu_assert(m == -1, "ssmean failed 2");
+
+ return NULL;
+}
+
char *all_tests()
{
mu_suite_start();
mu_run_test(test_sscreate);
mu_run_test(test_sssample);
+ mu_run_test(test_ssmean);
return NULL;
}