lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202010280748.WUyq8OoJ-lkp@intel.com>
Date:   Wed, 28 Oct 2020 07:49:42 +0800
From:   kernel test robot <lkp@...el.com>
To:     Arpitha Raghunandan <98.arpi@...il.com>, brendanhiggins@...gle.com,
        skhan@...uxfoundation.org, elver@...gle.com, yzaikin@...gle.com,
        tytso@....edu, adilger.kernel@...ger.ca
Cc:     kbuild-all@...ts.01.org, Arpitha Raghunandan <98.arpi@...il.com>,
        linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] fs: ext4: Modify inode-test.c to use KUnit
 parameterized testing feature

Hi Arpitha,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on linus/master v5.10-rc1 next-20201027]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Arpitha-Raghunandan/kunit-Support-for-Parameterized-Testing/20201028-015018
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: mips-randconfig-r016-20201027 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2de1e52708cd83d1dc4c718876683f6809045a98
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arpitha-Raghunandan/kunit-Support-for-Parameterized-Testing/20201028-015018
        git checkout 2de1e52708cd83d1dc4c718876683f6809045a98
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   In file included from fs/ext4/inode-test.c:7:
   fs/ext4/inode-test.c: In function 'ext4_inode_gen_params':
>> include/kunit/test.h:1735:58: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    1735 |   return __next - (array) < ARRAY_SIZE((array)) ? __next : NULL;   \
   fs/ext4/inode-test.c:214:1: note: in expansion of macro 'KUNIT_ARRAY_PARAM'
     214 | KUNIT_ARRAY_PARAM(ext4_inode, test_data);
         | ^~~~~~~~~~~~~~~~~

vim +/const +1735 include/kunit/test.h

73cda7bb8bfb1d Brendan Higgins     2019-09-23  1154  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1155  #define KUNIT_PTR_NOT_ERR_OR_NULL_ASSERTION(test, assert_type, ptr)	       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1156  	KUNIT_PTR_NOT_ERR_OR_NULL_MSG_ASSERTION(test,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1157  						assert_type,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1158  						ptr,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1159  						NULL)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1160  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1161  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1162   * KUNIT_EXPECT_TRUE() - Causes a test failure when the expression is not true.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1163   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1164   * @condition: an arbitrary boolean expression. The test fails when this does
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1165   * not evaluate to true.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1166   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1167   * This and expectations of the form `KUNIT_EXPECT_*` will cause the test case
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1168   * to fail when the specified condition is not met; however, it will not prevent
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1169   * the test case from continuing to run; this is otherwise known as an
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1170   * *expectation failure*.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1171   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1172  #define KUNIT_EXPECT_TRUE(test, condition) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1173  	KUNIT_TRUE_ASSERTION(test, KUNIT_EXPECTATION, condition)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1174  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1175  #define KUNIT_EXPECT_TRUE_MSG(test, condition, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1176  	KUNIT_TRUE_MSG_ASSERTION(test,					       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1177  				 KUNIT_EXPECTATION,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1178  				 condition,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1179  				 fmt,					       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1180  				 ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1181  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1182  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1183   * KUNIT_EXPECT_FALSE() - Makes a test failure when the expression is not false.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1184   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1185   * @condition: an arbitrary boolean expression. The test fails when this does
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1186   * not evaluate to false.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1187   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1188   * Sets an expectation that @condition evaluates to false. See
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1189   * KUNIT_EXPECT_TRUE() for more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1190   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1191  #define KUNIT_EXPECT_FALSE(test, condition) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1192  	KUNIT_FALSE_ASSERTION(test, KUNIT_EXPECTATION, condition)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1193  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1194  #define KUNIT_EXPECT_FALSE_MSG(test, condition, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1195  	KUNIT_FALSE_MSG_ASSERTION(test,					       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1196  				  KUNIT_EXPECTATION,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1197  				  condition,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1198  				  fmt,					       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1199  				  ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1200  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1201  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1202   * KUNIT_EXPECT_EQ() - Sets an expectation that @left and @right are equal.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1203   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1204   * @left: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1205   * @right: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1206   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1207   * Sets an expectation that the values that @left and @right evaluate to are
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1208   * equal. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1209   * KUNIT_EXPECT_TRUE(@test, (@left) == (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1210   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1211   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1212  #define KUNIT_EXPECT_EQ(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1213  	KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1214  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1215  #define KUNIT_EXPECT_EQ_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1216  	KUNIT_BINARY_EQ_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1217  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1218  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1219  				      right,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1220  				      fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1221  				      ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1222  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1223  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1224   * KUNIT_EXPECT_PTR_EQ() - Expects that pointers @left and @right are equal.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1225   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1226   * @left: an arbitrary expression that evaluates to a pointer.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1227   * @right: an arbitrary expression that evaluates to a pointer.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1228   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1229   * Sets an expectation that the values that @left and @right evaluate to are
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1230   * equal. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1231   * KUNIT_EXPECT_TRUE(@test, (@left) == (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1232   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1233   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1234  #define KUNIT_EXPECT_PTR_EQ(test, left, right)				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1235  	KUNIT_BINARY_PTR_EQ_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1236  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1237  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1238  				      right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1239  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1240  #define KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1241  	KUNIT_BINARY_PTR_EQ_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1242  					  KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1243  					  left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1244  					  right,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1245  					  fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1246  					  ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1247  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1248  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1249   * KUNIT_EXPECT_NE() - An expectation that @left and @right are not equal.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1250   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1251   * @left: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1252   * @right: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1253   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1254   * Sets an expectation that the values that @left and @right evaluate to are not
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1255   * equal. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1256   * KUNIT_EXPECT_TRUE(@test, (@left) != (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1257   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1258   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1259  #define KUNIT_EXPECT_NE(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1260  	KUNIT_BINARY_NE_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1261  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1262  #define KUNIT_EXPECT_NE_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1263  	KUNIT_BINARY_NE_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1264  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1265  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1266  				      right,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1267  				      fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1268  				      ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1269  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1270  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1271   * KUNIT_EXPECT_PTR_NE() - Expects that pointers @left and @right are not equal.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1272   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1273   * @left: an arbitrary expression that evaluates to a pointer.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1274   * @right: an arbitrary expression that evaluates to a pointer.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1275   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1276   * Sets an expectation that the values that @left and @right evaluate to are not
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1277   * equal. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1278   * KUNIT_EXPECT_TRUE(@test, (@left) != (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1279   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1280   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1281  #define KUNIT_EXPECT_PTR_NE(test, left, right)				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1282  	KUNIT_BINARY_PTR_NE_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1283  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1284  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1285  				      right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1286  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1287  #define KUNIT_EXPECT_PTR_NE_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1288  	KUNIT_BINARY_PTR_NE_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1289  					  KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1290  					  left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1291  					  right,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1292  					  fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1293  					  ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1294  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1295  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1296   * KUNIT_EXPECT_LT() - An expectation that @left is less than @right.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1297   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1298   * @left: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1299   * @right: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1300   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1301   * Sets an expectation that the value that @left evaluates to is less than the
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1302   * value that @right evaluates to. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1303   * KUNIT_EXPECT_TRUE(@test, (@left) < (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1304   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1305   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1306  #define KUNIT_EXPECT_LT(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1307  	KUNIT_BINARY_LT_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1308  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1309  #define KUNIT_EXPECT_LT_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1310  	KUNIT_BINARY_LT_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1311  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1312  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1313  				      right,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1314  				      fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1315  				      ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1316  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1317  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1318   * KUNIT_EXPECT_LE() - Expects that @left is less than or equal to @right.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1319   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1320   * @left: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1321   * @right: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1322   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1323   * Sets an expectation that the value that @left evaluates to is less than or
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1324   * equal to the value that @right evaluates to. Semantically this is equivalent
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1325   * to KUNIT_EXPECT_TRUE(@test, (@left) <= (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1326   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1327   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1328  #define KUNIT_EXPECT_LE(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1329  	KUNIT_BINARY_LE_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1330  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1331  #define KUNIT_EXPECT_LE_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1332  	KUNIT_BINARY_LE_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1333  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1334  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1335  				      right,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1336  				      fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1337  				      ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1338  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1339  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1340   * KUNIT_EXPECT_GT() - An expectation that @left is greater than @right.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1341   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1342   * @left: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1343   * @right: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1344   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1345   * Sets an expectation that the value that @left evaluates to is greater than
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1346   * the value that @right evaluates to. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1347   * KUNIT_EXPECT_TRUE(@test, (@left) > (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1348   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1349   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1350  #define KUNIT_EXPECT_GT(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1351  	KUNIT_BINARY_GT_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1352  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1353  #define KUNIT_EXPECT_GT_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1354  	KUNIT_BINARY_GT_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1355  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1356  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1357  				      right,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1358  				      fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1359  				      ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1360  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1361  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1362   * KUNIT_EXPECT_GE() - Expects that @left is greater than or equal to @right.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1363   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1364   * @left: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1365   * @right: an arbitrary expression that evaluates to a primitive C type.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1366   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1367   * Sets an expectation that the value that @left evaluates to is greater than
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1368   * the value that @right evaluates to. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1369   * KUNIT_EXPECT_TRUE(@test, (@left) >= (@right)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1370   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1371   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1372  #define KUNIT_EXPECT_GE(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1373  	KUNIT_BINARY_GE_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1374  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1375  #define KUNIT_EXPECT_GE_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1376  	KUNIT_BINARY_GE_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1377  				      KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1378  				      left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1379  				      right,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1380  				      fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1381  				      ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1382  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1383  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1384   * KUNIT_EXPECT_STREQ() - Expects that strings @left and @right are equal.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1385   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1386   * @left: an arbitrary expression that evaluates to a null terminated string.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1387   * @right: an arbitrary expression that evaluates to a null terminated string.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1388   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1389   * Sets an expectation that the values that @left and @right evaluate to are
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1390   * equal. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1391   * KUNIT_EXPECT_TRUE(@test, !strcmp((@left), (@right))). See KUNIT_EXPECT_TRUE()
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1392   * for more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1393   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1394  #define KUNIT_EXPECT_STREQ(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1395  	KUNIT_BINARY_STR_EQ_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1396  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1397  #define KUNIT_EXPECT_STREQ_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1398  	KUNIT_BINARY_STR_EQ_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1399  					  KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1400  					  left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1401  					  right,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1402  					  fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1403  					  ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1404  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1405  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1406   * KUNIT_EXPECT_STRNEQ() - Expects that strings @left and @right are not equal.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1407   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1408   * @left: an arbitrary expression that evaluates to a null terminated string.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1409   * @right: an arbitrary expression that evaluates to a null terminated string.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1410   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1411   * Sets an expectation that the values that @left and @right evaluate to are
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1412   * not equal. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1413   * KUNIT_EXPECT_TRUE(@test, strcmp((@left), (@right))). See KUNIT_EXPECT_TRUE()
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1414   * for more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1415   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1416  #define KUNIT_EXPECT_STRNEQ(test, left, right) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1417  	KUNIT_BINARY_STR_NE_ASSERTION(test, KUNIT_EXPECTATION, left, right)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1418  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1419  #define KUNIT_EXPECT_STRNEQ_MSG(test, left, right, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1420  	KUNIT_BINARY_STR_NE_MSG_ASSERTION(test,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1421  					  KUNIT_EXPECTATION,		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1422  					  left,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1423  					  right,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1424  					  fmt,				       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1425  					  ##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1426  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1427  /**
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1428   * KUNIT_EXPECT_NOT_ERR_OR_NULL() - Expects that @ptr is not null and not err.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1429   * @test: The test context object.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1430   * @ptr: an arbitrary pointer.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1431   *
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1432   * Sets an expectation that the value that @ptr evaluates to is not null and not
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1433   * an errno stored in a pointer. This is semantically equivalent to
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1434   * KUNIT_EXPECT_TRUE(@test, !IS_ERR_OR_NULL(@ptr)). See KUNIT_EXPECT_TRUE() for
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1435   * more information.
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1436   */
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1437  #define KUNIT_EXPECT_NOT_ERR_OR_NULL(test, ptr) \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1438  	KUNIT_PTR_NOT_ERR_OR_NULL_ASSERTION(test, KUNIT_EXPECTATION, ptr)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1439  
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1440  #define KUNIT_EXPECT_NOT_ERR_OR_NULL_MSG(test, ptr, fmt, ...)		       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1441  	KUNIT_PTR_NOT_ERR_OR_NULL_MSG_ASSERTION(test,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1442  						KUNIT_EXPECTATION,	       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1443  						ptr,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1444  						fmt,			       \
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1445  						##__VA_ARGS__)
73cda7bb8bfb1d Brendan Higgins     2019-09-23  1446  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1447  #define KUNIT_ASSERT_FAILURE(test, fmt, ...) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1448  	KUNIT_FAIL_ASSERTION(test, KUNIT_ASSERTION, fmt, ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1449  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1450  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1451   * KUNIT_ASSERT_TRUE() - Sets an assertion that @condition is true.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1452   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1453   * @condition: an arbitrary boolean expression. The test fails and aborts when
e4aea8f8532b55 Brendan Higgins     2019-09-23  1454   * this does not evaluate to true.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1455   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1456   * This and assertions of the form `KUNIT_ASSERT_*` will cause the test case to
e4aea8f8532b55 Brendan Higgins     2019-09-23  1457   * fail *and immediately abort* when the specified condition is not met. Unlike
e4aea8f8532b55 Brendan Higgins     2019-09-23  1458   * an expectation failure, it will prevent the test case from continuing to run;
e4aea8f8532b55 Brendan Higgins     2019-09-23  1459   * this is otherwise known as an *assertion failure*.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1460   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1461  #define KUNIT_ASSERT_TRUE(test, condition) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1462  	KUNIT_TRUE_ASSERTION(test, KUNIT_ASSERTION, condition)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1463  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1464  #define KUNIT_ASSERT_TRUE_MSG(test, condition, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1465  	KUNIT_TRUE_MSG_ASSERTION(test,					       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1466  				 KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1467  				 condition,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1468  				 fmt,					       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1469  				 ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1470  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1471  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1472   * KUNIT_ASSERT_FALSE() - Sets an assertion that @condition is false.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1473   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1474   * @condition: an arbitrary boolean expression.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1475   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1476   * Sets an assertion that the value that @condition evaluates to is false. This
e4aea8f8532b55 Brendan Higgins     2019-09-23  1477   * is the same as KUNIT_EXPECT_FALSE(), except it causes an assertion failure
e4aea8f8532b55 Brendan Higgins     2019-09-23  1478   * (see KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1479   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1480  #define KUNIT_ASSERT_FALSE(test, condition) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1481  	KUNIT_FALSE_ASSERTION(test, KUNIT_ASSERTION, condition)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1482  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1483  #define KUNIT_ASSERT_FALSE_MSG(test, condition, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1484  	KUNIT_FALSE_MSG_ASSERTION(test,					       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1485  				  KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1486  				  condition,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1487  				  fmt,					       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1488  				  ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1489  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1490  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1491   * KUNIT_ASSERT_EQ() - Sets an assertion that @left and @right are equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1492   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1493   * @left: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1494   * @right: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1495   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1496   * Sets an assertion that the values that @left and @right evaluate to are
e4aea8f8532b55 Brendan Higgins     2019-09-23  1497   * equal. This is the same as KUNIT_EXPECT_EQ(), except it causes an assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1498   * failure (see KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1499   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1500  #define KUNIT_ASSERT_EQ(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1501  	KUNIT_BINARY_EQ_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1502  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1503  #define KUNIT_ASSERT_EQ_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1504  	KUNIT_BINARY_EQ_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1505  				      KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1506  				      left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1507  				      right,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1508  				      fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1509  				      ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1510  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1511  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1512   * KUNIT_ASSERT_PTR_EQ() - Asserts that pointers @left and @right are equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1513   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1514   * @left: an arbitrary expression that evaluates to a pointer.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1515   * @right: an arbitrary expression that evaluates to a pointer.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1516   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1517   * Sets an assertion that the values that @left and @right evaluate to are
e4aea8f8532b55 Brendan Higgins     2019-09-23  1518   * equal. This is the same as KUNIT_EXPECT_EQ(), except it causes an assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1519   * failure (see KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1520   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1521  #define KUNIT_ASSERT_PTR_EQ(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1522  	KUNIT_BINARY_PTR_EQ_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1523  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1524  #define KUNIT_ASSERT_PTR_EQ_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1525  	KUNIT_BINARY_PTR_EQ_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1526  					  KUNIT_ASSERTION,		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1527  					  left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1528  					  right,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1529  					  fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1530  					  ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1531  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1532  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1533   * KUNIT_ASSERT_NE() - An assertion that @left and @right are not equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1534   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1535   * @left: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1536   * @right: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1537   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1538   * Sets an assertion that the values that @left and @right evaluate to are not
e4aea8f8532b55 Brendan Higgins     2019-09-23  1539   * equal. This is the same as KUNIT_EXPECT_NE(), except it causes an assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1540   * failure (see KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1541   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1542  #define KUNIT_ASSERT_NE(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1543  	KUNIT_BINARY_NE_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1544  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1545  #define KUNIT_ASSERT_NE_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1546  	KUNIT_BINARY_NE_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1547  				      KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1548  				      left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1549  				      right,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1550  				      fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1551  				      ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1552  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1553  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1554   * KUNIT_ASSERT_PTR_NE() - Asserts that pointers @left and @right are not equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1555   * KUNIT_ASSERT_PTR_EQ() - Asserts that pointers @left and @right are equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1556   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1557   * @left: an arbitrary expression that evaluates to a pointer.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1558   * @right: an arbitrary expression that evaluates to a pointer.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1559   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1560   * Sets an assertion that the values that @left and @right evaluate to are not
e4aea8f8532b55 Brendan Higgins     2019-09-23  1561   * equal. This is the same as KUNIT_EXPECT_NE(), except it causes an assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1562   * failure (see KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1563   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1564  #define KUNIT_ASSERT_PTR_NE(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1565  	KUNIT_BINARY_PTR_NE_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1566  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1567  #define KUNIT_ASSERT_PTR_NE_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1568  	KUNIT_BINARY_PTR_NE_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1569  					  KUNIT_ASSERTION,		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1570  					  left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1571  					  right,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1572  					  fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1573  					  ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1574  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1575   * KUNIT_ASSERT_LT() - An assertion that @left is less than @right.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1576   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1577   * @left: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1578   * @right: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1579   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1580   * Sets an assertion that the value that @left evaluates to is less than the
e4aea8f8532b55 Brendan Higgins     2019-09-23  1581   * value that @right evaluates to. This is the same as KUNIT_EXPECT_LT(), except
e4aea8f8532b55 Brendan Higgins     2019-09-23  1582   * it causes an assertion failure (see KUNIT_ASSERT_TRUE()) when the assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1583   * is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1584   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1585  #define KUNIT_ASSERT_LT(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1586  	KUNIT_BINARY_LT_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1587  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1588  #define KUNIT_ASSERT_LT_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1589  	KUNIT_BINARY_LT_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1590  				      KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1591  				      left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1592  				      right,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1593  				      fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1594  				      ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1595  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1596   * KUNIT_ASSERT_LE() - An assertion that @left is less than or equal to @right.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1597   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1598   * @left: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1599   * @right: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1600   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1601   * Sets an assertion that the value that @left evaluates to is less than or
e4aea8f8532b55 Brendan Higgins     2019-09-23  1602   * equal to the value that @right evaluates to. This is the same as
e4aea8f8532b55 Brendan Higgins     2019-09-23  1603   * KUNIT_EXPECT_LE(), except it causes an assertion failure (see
e4aea8f8532b55 Brendan Higgins     2019-09-23  1604   * KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1605   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1606  #define KUNIT_ASSERT_LE(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1607  	KUNIT_BINARY_LE_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1608  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1609  #define KUNIT_ASSERT_LE_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1610  	KUNIT_BINARY_LE_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1611  				      KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1612  				      left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1613  				      right,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1614  				      fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1615  				      ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1616  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1617  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1618   * KUNIT_ASSERT_GT() - An assertion that @left is greater than @right.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1619   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1620   * @left: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1621   * @right: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1622   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1623   * Sets an assertion that the value that @left evaluates to is greater than the
e4aea8f8532b55 Brendan Higgins     2019-09-23  1624   * value that @right evaluates to. This is the same as KUNIT_EXPECT_GT(), except
e4aea8f8532b55 Brendan Higgins     2019-09-23  1625   * it causes an assertion failure (see KUNIT_ASSERT_TRUE()) when the assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1626   * is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1627   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1628  #define KUNIT_ASSERT_GT(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1629  	KUNIT_BINARY_GT_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1630  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1631  #define KUNIT_ASSERT_GT_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1632  	KUNIT_BINARY_GT_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1633  				      KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1634  				      left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1635  				      right,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1636  				      fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1637  				      ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1638  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1639  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1640   * KUNIT_ASSERT_GE() - Assertion that @left is greater than or equal to @right.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1641   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1642   * @left: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1643   * @right: an arbitrary expression that evaluates to a primitive C type.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1644   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1645   * Sets an assertion that the value that @left evaluates to is greater than the
e4aea8f8532b55 Brendan Higgins     2019-09-23  1646   * value that @right evaluates to. This is the same as KUNIT_EXPECT_GE(), except
e4aea8f8532b55 Brendan Higgins     2019-09-23  1647   * it causes an assertion failure (see KUNIT_ASSERT_TRUE()) when the assertion
e4aea8f8532b55 Brendan Higgins     2019-09-23  1648   * is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1649   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1650  #define KUNIT_ASSERT_GE(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1651  	KUNIT_BINARY_GE_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1652  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1653  #define KUNIT_ASSERT_GE_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1654  	KUNIT_BINARY_GE_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1655  				      KUNIT_ASSERTION,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1656  				      left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1657  				      right,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1658  				      fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1659  				      ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1660  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1661  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1662   * KUNIT_ASSERT_STREQ() - An assertion that strings @left and @right are equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1663   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1664   * @left: an arbitrary expression that evaluates to a null terminated string.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1665   * @right: an arbitrary expression that evaluates to a null terminated string.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1666   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1667   * Sets an assertion that the values that @left and @right evaluate to are
e4aea8f8532b55 Brendan Higgins     2019-09-23  1668   * equal. This is the same as KUNIT_EXPECT_STREQ(), except it causes an
e4aea8f8532b55 Brendan Higgins     2019-09-23  1669   * assertion failure (see KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1670   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1671  #define KUNIT_ASSERT_STREQ(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1672  	KUNIT_BINARY_STR_EQ_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1673  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1674  #define KUNIT_ASSERT_STREQ_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1675  	KUNIT_BINARY_STR_EQ_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1676  					  KUNIT_ASSERTION,		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1677  					  left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1678  					  right,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1679  					  fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1680  					  ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1681  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1682  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1683   * KUNIT_ASSERT_STRNEQ() - Expects that strings @left and @right are not equal.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1684   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1685   * @left: an arbitrary expression that evaluates to a null terminated string.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1686   * @right: an arbitrary expression that evaluates to a null terminated string.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1687   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1688   * Sets an expectation that the values that @left and @right evaluate to are
e4aea8f8532b55 Brendan Higgins     2019-09-23  1689   * not equal. This is semantically equivalent to
e4aea8f8532b55 Brendan Higgins     2019-09-23  1690   * KUNIT_ASSERT_TRUE(@test, strcmp((@left), (@right))). See KUNIT_ASSERT_TRUE()
e4aea8f8532b55 Brendan Higgins     2019-09-23  1691   * for more information.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1692   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1693  #define KUNIT_ASSERT_STRNEQ(test, left, right) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1694  	KUNIT_BINARY_STR_NE_ASSERTION(test, KUNIT_ASSERTION, left, right)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1695  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1696  #define KUNIT_ASSERT_STRNEQ_MSG(test, left, right, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1697  	KUNIT_BINARY_STR_NE_MSG_ASSERTION(test,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1698  					  KUNIT_ASSERTION,		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1699  					  left,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1700  					  right,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1701  					  fmt,				       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1702  					  ##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1703  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1704  /**
e4aea8f8532b55 Brendan Higgins     2019-09-23  1705   * KUNIT_ASSERT_NOT_ERR_OR_NULL() - Assertion that @ptr is not null and not err.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1706   * @test: The test context object.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1707   * @ptr: an arbitrary pointer.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1708   *
e4aea8f8532b55 Brendan Higgins     2019-09-23  1709   * Sets an assertion that the value that @ptr evaluates to is not null and not
e4aea8f8532b55 Brendan Higgins     2019-09-23  1710   * an errno stored in a pointer. This is the same as
e4aea8f8532b55 Brendan Higgins     2019-09-23  1711   * KUNIT_EXPECT_NOT_ERR_OR_NULL(), except it causes an assertion failure (see
e4aea8f8532b55 Brendan Higgins     2019-09-23  1712   * KUNIT_ASSERT_TRUE()) when the assertion is not met.
e4aea8f8532b55 Brendan Higgins     2019-09-23  1713   */
e4aea8f8532b55 Brendan Higgins     2019-09-23  1714  #define KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr) \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1715  	KUNIT_PTR_NOT_ERR_OR_NULL_ASSERTION(test, KUNIT_ASSERTION, ptr)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1716  
e4aea8f8532b55 Brendan Higgins     2019-09-23  1717  #define KUNIT_ASSERT_NOT_ERR_OR_NULL_MSG(test, ptr, fmt, ...)		       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1718  	KUNIT_PTR_NOT_ERR_OR_NULL_MSG_ASSERTION(test,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1719  						KUNIT_ASSERTION,	       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1720  						ptr,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1721  						fmt,			       \
e4aea8f8532b55 Brendan Higgins     2019-09-23  1722  						##__VA_ARGS__)
e4aea8f8532b55 Brendan Higgins     2019-09-23  1723  
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1724  /**
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1725   * KUNIT_ARRAY_PARAM() - Helper method for test parameter generators
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1726   * 			 required in parameterized tests.
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1727   * @name:  prefix of the name for the test parameter generator function.
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1728   *	   It will be suffixed by "_gen_params".
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1729   * @array: a user-supplied pointer to an array of test parameters.
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1730   */
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1731  #define KUNIT_ARRAY_PARAM(name, array)								\
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1732  	static void *name##_gen_params(void *prev)						\
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1733  	{											\
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1734  		typeof((array)[0]) * __next = prev ? ((typeof(__next)) prev) + 1 : (array);	\
ae68283f3e666a Arpitha Raghunandan 2020-10-27 @1735  		return __next - (array) < ARRAY_SIZE((array)) ? __next : NULL;			\
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1736  	}
ae68283f3e666a Arpitha Raghunandan 2020-10-27  1737  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (31654 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ