From a7c430fa81c9e22dbce74869a0a27304da78855b Mon Sep 17 00:00:00 2001 From: Vasile Vilvoiu Date: Wed, 21 Jul 2021 18:43:02 +0300 Subject: Implement unit tests. ColorMap, FFT, InputParser, InputReader, ValueMap, WindowFunction. Closes #11. --- test/test.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test.hpp (limited to 'test/test.hpp') 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 + * + * 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) -- cgit v1.2.3