chiark / gitweb /
@@@ tty mess
[mLib] / test / tvec-types.h
index 5076482ea5d0ef25a1157bd341c9de290e0c5cbd..a56a7fe410bd172c66fb2d9a5847a32726f639af 100644 (file)
@@ -438,7 +438,7 @@ TVEC_MISCSLOTS(DEFINFO)
 extern const struct tvec_ienuminfo tvenum_bool;
 extern const struct tvec_ienuminfo tvenum_cmp;
 
-/* --- @tvec_claimeq_tenum@, @TVEC_CLAIMEQ_TENUM@ --- *
+/* --- @tvec_claimeq_tenum@, @TVEC_CLAIMEQ_TENUM@, @TVEC_CLAIMEQ_PTR@ --- *
  *
  * Arguments:  @struct tvec_state *tv@ = test-vector state
  *             @const struct tvec_typeenuminfo *ei@ = enumeration type info
@@ -455,10 +455,16 @@ extern const struct tvec_ienuminfo tvenum_cmp;
  *             mismatched values are dumped: @t0@ is printed as the output
  *             value and @t1@ is printed as the input reference.
  *
+ *             The @ei@ argument to @tvec_claimeq_penum@ (but not the other
+ *             functions) may be null, as a hack for comparing two plain
+ *             pointers.
+ *
  *             The @TVEC_CLAIM_TENUM@ macro is similar, only it (a)
  *             identifies the file and line number of the call site
  *             automatically, and (b) implicitly quotes the source text of
- *             the @t0@ and @t1@ arguments in the failure message.
+ *             the @t0@ and @t1@ arguments in the failure message.  The
+ *             @TVEC_CLAIMEQ_PTR@ macro simply compares two pointers in the
+ *             same way.
  */
 
 #define DECLCLAIM(tag, ty, slot)                                       \
@@ -481,6 +487,9 @@ TVEC_MISCSLOTS(DECLCLAIM)
 #define TVEC_CLAIMEQ_PENUM(tv, ei, p0, p1)                             \
        (tvec_claimeq_penum(tv, ei, p0, p1,                             \
                            __FILE__, __LINE__, #p0 " /= " #p1))
+#define TVEC_CLAIMEQ_PTR(tv, p0, p1)                                   \
+       (tvec_claimeq_penum(tv, 0, p0, p1,                              \
+                           __FILE__, __LINE__, #p0 " /= " #p1))
 
 /*----- Flags type --------------------------------------------------------*/