aboutsummaryrefslogtreecommitdiff
path: root/test/tsupport.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/tsupport.h')
-rw-r--r--test/tsupport.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/tsupport.h b/test/tsupport.h
index 40d4b1c..a7842cc 100644
--- a/test/tsupport.h
+++ b/test/tsupport.h
@@ -23,32 +23,32 @@
///
/// Used as a block:
///
-/// LS_TEST_CATCH(ctx, evar) {
+/// LS_TEST_CATCH(ls, evar) {
/// handle_error(evar);
/// }
///
-/// @param ctx - context
+/// @param ls
/// @param evar - name of variable to create in the block
-#define LS_TEST_CATCH(ctx) if (setjmp((ctx).error_jmp_buf))
+#define LS_TEST_CATCH(ls) if (setjmp((ls).error_jmp_buf))
/// Execute some code, expecting an error and asserting on it.
///
-/// @param ctx - context
+/// @param ls
/// @param e - error expected
/// @param code - code body to execute
-#define LS_EXPECT_ERR(ctx, e, code) \
+#define LS_EXPECT_ERR(ls, e, code) \
do { \
jmp_buf _holdbuf; \
- memcpy(&_holdbuf, &(ctx).error_jmp_buf, sizeof(jmp_buf)); \
+ memcpy(&_holdbuf, &(ls).error_jmp_buf, sizeof(jmp_buf)); \
bool got_error = false; \
- if (setjmp((ctx).error_jmp_buf)) { \
- munit_assert_int((ctx).error, ==, (e)); \
+ if (setjmp((ls).error_jmp_buf)) { \
+ munit_assert_int((ls).error, ==, (e)); \
got_error = true; \
} else { \
code ; \
} \
munit_assert_true(got_error); \
- memcpy(&(ctx).error_jmp_buf, &_holdbuf, sizeof(jmp_buf)); \
+ memcpy(&(ls).error_jmp_buf, &_holdbuf, sizeof(jmp_buf)); \
} while (0)
// --- PRIVATE DATATYPES -------------------------------------------------------
@@ -61,17 +61,17 @@
// --- PUBLIC VARIABLES --------------------------------------------------------
// --- PUBLIC FUNCTIONS --------------------------------------------------------
-/// Set up a new context with a string as its source. You must also set up the
+/// Set up a new ls_t with a string as its source. You must also set up the
/// jump buffer, for which you can use LS_TEST_CATCH().
///
/// An internal static pool of LS_TEST_NPOOL will be initialized.
///
-/// @param ctx - context to set up
+/// @param ls
/// @param text - the source text
-void ls_test_setup(ls_context_t * ctx, char const * text);
+void ls_test_setup(ls_t * ls, char const * text);
-/// Set up the context's fetcher to return from a string, but don't initialize
-/// anything else. Mainly for use with ls_run().
-void ls_setup_run(ls_context_t * ctx, char const * text);
+/// Set up the fetcher to return from a string, but don't initialize anything
+/// else. Mainly for use with ls_run().
+void ls_setup_run(ls_t * ls, char const * text);
#endif // !defined(TSUPPORT_H)