2014-04-13 12:26:32 -04:00
|
|
|
/*
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
2014-06-21 09:37:47 -04:00
|
|
|
#ifndef OCARINA_TESTS_TEST_H
|
|
|
|
#define OCARINA_TESTS_TEST_H
|
2014-04-13 12:26:32 -04:00
|
|
|
|
2015-08-19 17:15:46 -04:00
|
|
|
#include <glib.h>
|
2014-04-13 12:26:32 -04:00
|
|
|
|
2015-01-04 17:56:54 -05:00
|
|
|
|
2016-09-28 15:15:15 -04:00
|
|
|
/*
|
|
|
|
* Compares two strings, and frees lhs before returning.
|
|
|
|
* NOTE: We store lhs in a temporary string so that "lhs" only gets
|
|
|
|
* evaluated once in the case that it is a function.
|
|
|
|
*/
|
2016-03-03 10:09:01 -05:00
|
|
|
#define g_assert_cmpstr_free(lhs, cmp, rhs) \
|
|
|
|
do { \
|
2016-09-28 15:15:15 -04:00
|
|
|
gchar *__tmp_str = lhs; \
|
|
|
|
g_assert_cmpstr(__tmp_str, cmp, rhs); \
|
|
|
|
g_free(__tmp_str); \
|
2016-03-03 10:09:01 -05:00
|
|
|
} while (0)
|
|
|
|
|
2014-06-21 09:37:47 -04:00
|
|
|
#endif /* OCARINA_TESTS_TEST_H */
|