mirror of
https://github.com/dart-lang/sdk
synced 2024-10-05 05:17:31 +00:00
8da46d35f5
Remove some dead includes. Change-Id: I31f3e739e5ee46dcbba5d6a2f091491b46402943 Reviewed-on: https://dart-review.googlesource.com/60146 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
54 lines
1.8 KiB
C++
54 lines
1.8 KiB
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/flags.h"
|
|
#include "platform/assert.h"
|
|
#include "vm/heap/heap.h"
|
|
#include "vm/unit_test.h"
|
|
|
|
namespace dart {
|
|
|
|
DEFINE_FLAG(bool, basic_flag, true, "Testing of a basic boolean flag.");
|
|
|
|
DECLARE_FLAG(bool, print_flags);
|
|
|
|
VM_UNIT_TEST_CASE(BasicFlags) {
|
|
EXPECT_EQ(true, FLAG_basic_flag);
|
|
EXPECT_EQ(false, FLAG_verbose_gc);
|
|
EXPECT_EQ(false, FLAG_print_flags);
|
|
}
|
|
|
|
DEFINE_FLAG(bool, parse_flag_bool_test, true, "Flags::Parse (bool) testing");
|
|
DEFINE_FLAG(charp, string_opt_test, NULL, "Testing: string option.");
|
|
DEFINE_FLAG(charp, entrypoint_test, "main", "Testing: entrypoint");
|
|
DEFINE_FLAG(int, counter, 100, "Testing: int flag");
|
|
|
|
VM_UNIT_TEST_CASE(ParseFlags) {
|
|
EXPECT_EQ(true, FLAG_parse_flag_bool_test);
|
|
Flags::Parse("no_parse_flag_bool_test");
|
|
EXPECT_EQ(false, FLAG_parse_flag_bool_test);
|
|
Flags::Parse("parse_flag_bool_test");
|
|
EXPECT_EQ(true, FLAG_parse_flag_bool_test);
|
|
Flags::Parse("parse_flag_bool_test=false");
|
|
EXPECT_EQ(false, FLAG_parse_flag_bool_test);
|
|
Flags::Parse("parse_flag_bool_test=true");
|
|
EXPECT_EQ(true, FLAG_parse_flag_bool_test);
|
|
|
|
EXPECT_EQ(true, FLAG_string_opt_test == NULL);
|
|
Flags::Parse("string_opt_test=doobidoo");
|
|
EXPECT_EQ(true, FLAG_string_opt_test != NULL);
|
|
EXPECT_EQ(0, strcmp(FLAG_string_opt_test, "doobidoo"));
|
|
|
|
EXPECT_EQ(true, FLAG_entrypoint_test != NULL);
|
|
EXPECT_EQ(0, strcmp(FLAG_entrypoint_test, "main"));
|
|
|
|
EXPECT_EQ(100, FLAG_counter);
|
|
Flags::Parse("counter=-300");
|
|
EXPECT_EQ(-300, FLAG_counter);
|
|
Flags::Parse("counter=$300");
|
|
EXPECT_EQ(-300, FLAG_counter);
|
|
}
|
|
|
|
} // namespace dart
|