SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / tests / unit / test_utils_parse_size_suffix.c
index 45a87b06ce3641a89cc881afb145cb52c6c613f2..4340a69ec639266d96d0bdf1655a9db077d903c5 100644 (file)
@@ -1,18 +1,8 @@
 /*
 /*
- * Copyright (C) 2013 Simon Marchi <simon.marchi@polymtl.ca>
+ * Copyright (C) 2013 Simon Marchi <simon.marchi@polymtl.ca>
  *
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by as
- * published by the Free Software Foundation; only version 2 of the License.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <assert.h>
  */
 
 #include <assert.h>
 
 #include <tap/tap.h>
 
 
 #include <tap/tap.h>
 
-#include <src/common/utils.h>
+#include <common/utils.h>
 
 /* For error.h */
 int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 3;
 
 /* For error.h */
 int lttng_opt_quiet = 1;
 int lttng_opt_verbose = 3;
+int lttng_opt_mi;
 
 struct valid_test_input {
 
 struct valid_test_input {
-       char *input;
+       const char *input;
        uint64_t expected_result;
 };
 
        uint64_t expected_result;
 };
 
@@ -42,7 +33,7 @@ static struct valid_test_input valid_tests_inputs[] = {
                { "128K", 131072 },
                { "0x1234k", 4771840 },
                { "32M", 33554432 },
                { "128K", 131072 },
                { "0x1234k", 4771840 },
                { "32M", 33554432 },
-               { "1024G", 1099511627776 },
+               { "1024G", 1099511627776ULL },
                { "0X400", 1024 },
                { "0x40a", 1034 },
                { "0X40b", 1035 },
                { "0X400", 1024 },
                { "0x40a", 1034 },
                { "0X40b", 1035 },
@@ -65,20 +56,20 @@ static struct valid_test_input valid_tests_inputs[] = {
                { "0X0K", 0 },
                { "0x0M", 0 },
                { "0X0G", 0 },
                { "0X0K", 0 },
                { "0x0M", 0 },
                { "0X0G", 0 },
-               { "0X40G", 68719476736 },
+               { "0X40G", 68719476736ULL },
                { "0300k", 196608 },
                { "0300K", 196608 },
                { "030M", 25165824 },
                { "0300k", 196608 },
                { "0300K", 196608 },
                { "030M", 25165824 },
-               { "020G", 17179869184 },
+               { "020G", 17179869184ULL },
                { "0xa0k", 163840 },
                { "0xa0K", 163840 },
                { "0XA0M", 167772160 },
                { "0xa0k", 163840 },
                { "0xa0K", 163840 },
                { "0XA0M", 167772160 },
-               { "0xA0G", 171798691840 },
+               { "0xA0G", 171798691840ULL },
 };
 static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
 
 /* Invalid test cases */
 };
 static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]);
 
 /* Invalid test cases */
-static char *invalid_tests_inputs[] = {
+static const char *invalid_tests_inputs[] = {
                "",
                " ",
                "-1",
                "",
                " ",
                "-1",
This page took 0.025715 seconds and 5 git commands to generate.