g2gps commented on code in PR #2150:
URL: https://github.com/apache/nuttx-apps/pull/2150#discussion_r1371006872


##########
testing/sd_stress/sd_stress_main.c:
##########
@@ -0,0 +1,404 @@
+/****************************************************************************
+ * apps/testing/sd_stress/sd_stress_main.c
+ *
+ * Original Licence:
+ *
+ *   Copyright (c) 2016-2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/* Originally ported from PX4 https://github.com/PX4/PX4-Autopilot,
+ * with the following additions:
+ *
+ * - The number of files can be specified from the command line.
+ * - Bytes are written and read back from created files to verify integrity.
+ * - The bytes written are obtained from a static set,
+ *   rather than a constant 0xAA
+ * - The results are reported as a floating point, millisecond value.
+ */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include <nuttx/clock.h>
+
+static const size_t MAX_PATH_LEN = 52;
+
+static const char *TEMPDIR = CONFIG_TESTING_SD_STRESS_DEVICE"/stress";
+static const char *TEMPDIR2 = CONFIG_TESTING_SD_STRESS_DEVICE"/moved";
+static const char *TEMPFILE = "tmp";
+
+const size_t max_runs = 10000;
+const size_t min_runs = 1;
+const size_t default_runs = 32;
+
+const size_t max_bytes = 10000;
+const size_t min_bytes = 1;
+const size_t default_bytes = 4096;
+
+const size_t max_files = 999;
+const size_t min_files = 1;
+const size_t default_files = 64;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static void usage(void)
+{
+  printf("Stress test on a mount point\n");
+  printf(CONFIG_TESTING_SD_STRESS_PROGNAME ": [-r] [-b] [-f]\n");
+  printf("  -r   Number of runs (%u-%u), default %u\n",
+                              min_runs, max_runs, default_runs);

Review Comment:
   @xiaoxiang781216 These stylistic changes aren't picked up by 
`tools/checkpatch.sh`. Is there an additional tool you're using to pick up 
these discrepancies? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to