Reordered elements of severity array to make compare more meaningful. This will be helpful in merging inferBO and Quandary commits in QuandaryBO

Reviewed By: ezgicicek

Differential Revision: D9700516

fbshipit-source-id: c96a8240d
master
Julian Sutherland 6 years ago committed by Facebook Github Bot
parent e46bf6a3d9
commit a3753885bb

@ -29,7 +29,7 @@ type err_class = Checker | Prover | Nocat | Linters [@@deriving compare]
let equal_err_class = [%compare.equal: err_class]
(** severity of the report *)
type severity = Advice | Error | Info | Like | Warning [@@deriving compare]
type severity = Like | Info | Advice | Warning | Error [@@deriving compare]
let equal_severity = [%compare.equal: severity]

@ -22,7 +22,7 @@ val equal_visibility : visibility -> visibility -> bool
val string_of_visibility : visibility -> string
(** severity of the report *)
type severity = Advice | Error | Info | Like | Warning [@@deriving compare]
type severity = Like | Info | Advice | Warning | Error [@@deriving compare]
val equal_severity : severity -> severity -> bool

@ -0,0 +1,18 @@
(*
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
open! IStd
open OUnit2
let order_tests _ =
assert_equal (-1) ([%compare: Exceptions.severity] Exceptions.Like Exceptions.Info) ;
assert_equal (-1) ([%compare: Exceptions.severity] Exceptions.Info Exceptions.Advice) ;
assert_equal (-1) ([%compare: Exceptions.severity] Exceptions.Advice Exceptions.Warning) ;
assert_equal (-1) ([%compare: Exceptions.severity] Exceptions.Warning Exceptions.Error)
let tests = "severity_test_suite" >::: ["severity_order_tests" >:: order_tests]

@ -41,7 +41,8 @@ let () =
; SchedulerTests.tests
; StacktraceTests.tests
; TaintTests.tests
; TraceTests.tests ]
; TraceTests.tests
; SeverityTests.tests ]
@ ClangTests.tests )
in
let test_suite = "all" >::: tests in

Loading…
Cancel
Save