ADTF  3.18.3
adtf_require.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #define ADTF_REQUIRE(__exp) \
10 if (!(__exp)) \
11 {\
12  THROW_ERROR_DESC(ERR_FAILED, "test failed at %s:%d: %s", __FILE__, __LINE__, #__exp);\
13 }
14 
15 #define ADTF_REQUIRE_OK(__exp) \
16 {\
17  const auto __result = (__exp); \
18  if (IS_FAILED(__result)) \
19  {\
20  THROW_ERROR_DESC(ERR_FAILED, "test failed at %s:%d: %s %s", __FILE__, __LINE__, #__exp, adtf::util::to_string(__result).GetPtr());\
21  }\
22 }