Closed Bug 1406281 Opened 7 years ago Closed 7 years ago

Restyle CallbackAndVarCacheOrder.cpp

Categories

(Core :: Preferences: Backend, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(2 files)

Following on from bug #1406280

Process:

- Patch 1: Run clang-format to fix whitespace.

- Patch 2: Do manual fix-ups -- braces, rename things, etc. -- and then finish with another clang-format.

- Squash the patches together before landing.
Comment on attachment 8915840 [details]
Bug 1406281 - Restyle CallbackAndVarCacheOrder.cpp (clang-format). .

https://reviewboard.mozilla.org/r/187072/#review192094


C/C++ static analysis found 10 defects in this patch.

You can run this analysis locally with: `./mach static-analysis check path/to/file.cpp`

If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:140
(Diff revision 1)
>    SetFunc(prefName2, value2);
>    ASSERT_EQ(var2, value2);
>    ASSERT_TRUE(closure2.called);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Bool) {
> +TEST(CallbackAndVarCacheOrder, Bool)

Warning: Use '= default' to define a trivial default constructor [clang-tidy: modernize-use-equals-default]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:140
(Diff revision 1)
>    SetFunc(prefName2, value2);
>    ASSERT_EQ(var2, value2);
>    ASSERT_TRUE(closure2.called);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Bool) {
> +TEST(CallbackAndVarCacheOrder, Bool)

Warning: Use '= delete' to prohibit calling of a special member function [clang-tidy: modernize-use-equals-delete]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:145
(Diff revision 1)
> -TEST(CallbackAndVarCacheOrder, Bool) {
> +TEST(CallbackAndVarCacheOrder, Bool)
> +{
>    RunTest<bool>("test_pref.bool.1", "test_pref.bool.2", false, true);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Int) {
> +TEST(CallbackAndVarCacheOrder, Int)

Warning: Use '= default' to define a trivial default constructor [clang-tidy: modernize-use-equals-default]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:145
(Diff revision 1)
> -TEST(CallbackAndVarCacheOrder, Bool) {
> +TEST(CallbackAndVarCacheOrder, Bool)
> +{
>    RunTest<bool>("test_pref.bool.1", "test_pref.bool.2", false, true);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Int) {
> +TEST(CallbackAndVarCacheOrder, Int)

Warning: Use '= delete' to prohibit calling of a special member function [clang-tidy: modernize-use-equals-delete]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:150
(Diff revision 1)
> -TEST(CallbackAndVarCacheOrder, Int) {
> +TEST(CallbackAndVarCacheOrder, Int)
> +{
>    RunTest<int32_t>("test_pref.int.1", "test_pref.int.2", -2, 3);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Uint) {
> +TEST(CallbackAndVarCacheOrder, Uint)

Warning: Use '= default' to define a trivial default constructor [clang-tidy: modernize-use-equals-default]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:150
(Diff revision 1)
> -TEST(CallbackAndVarCacheOrder, Int) {
> +TEST(CallbackAndVarCacheOrder, Int)
> +{
>    RunTest<int32_t>("test_pref.int.1", "test_pref.int.2", -2, 3);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Uint) {
> +TEST(CallbackAndVarCacheOrder, Uint)

Warning: Use '= delete' to prohibit calling of a special member function [clang-tidy: modernize-use-equals-delete]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:155
(Diff revision 1)
> -TEST(CallbackAndVarCacheOrder, Uint) {
> +TEST(CallbackAndVarCacheOrder, Uint)
> +{
>    RunTest<uint32_t>("test_pref.uint.1", "test_pref.uint.2", 4u, 5u);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, AtomicUint) {
> +TEST(CallbackAndVarCacheOrder, AtomicUint)

Warning: Use '= default' to define a trivial default constructor [clang-tidy: modernize-use-equals-default]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:155
(Diff revision 1)
> -TEST(CallbackAndVarCacheOrder, Uint) {
> +TEST(CallbackAndVarCacheOrder, Uint)
> +{
>    RunTest<uint32_t>("test_pref.uint.1", "test_pref.uint.2", 4u, 5u);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, AtomicUint) {
> +TEST(CallbackAndVarCacheOrder, AtomicUint)

Warning: Use '= delete' to prohibit calling of a special member function [clang-tidy: modernize-use-equals-delete]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:161
(Diff revision 1)
> -  RunTest<uint32_t,Atomic<uint32_t,Relaxed>>("test_pref.atomic_uint.1",
> -                                             "test_pref.atomic_uint.2",
> -                                             6u, 7u);
> +{
> +  RunTest<uint32_t, Atomic<uint32_t, Relaxed>>(
> +    "test_pref.atomic_uint.1", "test_pref.atomic_uint.2", 6u, 7u);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Float) {
> +TEST(CallbackAndVarCacheOrder, Float)

Warning: Use '= default' to define a trivial default constructor [clang-tidy: modernize-use-equals-default]

::: modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp:161
(Diff revision 1)
> -  RunTest<uint32_t,Atomic<uint32_t,Relaxed>>("test_pref.atomic_uint.1",
> -                                             "test_pref.atomic_uint.2",
> -                                             6u, 7u);
> +{
> +  RunTest<uint32_t, Atomic<uint32_t, Relaxed>>(
> +    "test_pref.atomic_uint.1", "test_pref.atomic_uint.2", 6u, 7u);
>  }
>  
> -TEST(CallbackAndVarCacheOrder, Float) {
> +TEST(CallbackAndVarCacheOrder, Float)

Warning: Use '= delete' to prohibit calling of a special member function [clang-tidy: modernize-use-equals-delete]
> > -TEST(CallbackAndVarCacheOrder, Float) {
> > +TEST(CallbackAndVarCacheOrder, Float)
> 
> Warning: Use '= delete' to prohibit calling of a special member function
> [clang-tidy: modernize-use-equals-delete]

All these warnings are bogus; the static analysis is handling the TEST macros badly. I filed https://github.com/mozilla-releng/services/issues/658 for this.
Comment on attachment 8915840 [details]
Bug 1406281 - Restyle CallbackAndVarCacheOrder.cpp (clang-format). .

https://reviewboard.mozilla.org/r/187072/#review192912
Attachment #8915840 - Flags: review?(erahm) → review+
Comment on attachment 8915841 [details]
Bug 1406281 - Restyle CallbackAndVarCacheOrder.cpp (manual). .

https://reviewboard.mozilla.org/r/187074/#review192914
Attachment #8915841 - Flags: review?(erahm) → review+
https://hg.mozilla.org/mozilla-central/rev/d16958d3126b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Assignee: nobody → n.nethercote
You need to log in before you can comment on or make changes to this bug.