summaryrefslogtreecommitdiff
path: root/test/test.hpp
diff options
context:
space:
mode:
authorVasile Vilvoiu <vasi@vilvoiu.ro>2021-07-21 18:43:02 +0300
committerVasile Vilvoiu <vasi@vilvoiu.ro>2021-07-21 18:43:02 +0300
commita7c430fa81c9e22dbce74869a0a27304da78855b (patch)
tree8a9f91f64131f404f61ba33bd92082996ca13c1c /test/test.hpp
parent270dfd60cde3a7b65a2654eef0f299f32ca704c4 (diff)
Implement unit tests.
ColorMap, FFT, InputParser, InputReader, ValueMap, WindowFunction. Closes #11.
Diffstat (limited to 'test/test.hpp')
-rw-r--r--test/test.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test.hpp b/test/test.hpp
new file mode 100644
index 0000000..9e85ea2
--- /dev/null
+++ b/test/test.hpp
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2020-2021 Vasile Vilvoiu <vasi@vilvoiu.ro>
+ *
+ * specgram is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See LICENSE for details.
+ */
+#include "gtest/gtest.h"
+
+/* EXPECT_THROW but with a match to the exception string */
+#define EXPECT_THROW_MATCH(code, type, str) \
+EXPECT_THROW({ \
+try { \
+ code; \
+} catch (type& e) { \
+ EXPECT_STREQ(str, e.what()); \
+ throw e; \
+} \
+}, type)