Skip to content

jsonlogic: add IsOperation helper | cmake: add so-versioning#9

Open
hansbinderup wants to merge 2 commits intogabrielkim13:mainfrom
hansbinderup:habi/add-is-operation-handle
Open

jsonlogic: add IsOperation helper | cmake: add so-versioning#9
hansbinderup wants to merge 2 commits intogabrielkim13:mainfrom
hansbinderup:habi/add-is-operation-handle

Conversation

@hansbinderup
Copy link
Contributor

@gabrielkim13 I had a few more patches lying around that I thought could be upstreamed. Let me know if they're of interest :)
The core is not tested so I didn't add a unit test for this method :)

Test and build results:

[habi@archlinux json-logic-cpp]$ cmake --build . --clean-first -j32
[  1%] Building CXX object test/lib/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[  2%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/in.cpp.o
[  3%] Building CXX object CMakeFiles/jsonlogic.dir/src/json_logic.cpp.o
[  5%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/all.cpp.o
[  6%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/filter.cpp.o
[  7%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/map.cpp.o
[  9%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/none.cpp.o
[ 10%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/merge.cpp.o
[ 13%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/reduce.cpp.o
[ 13%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/array/some.cpp.o
[ 14%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/data/missing.cpp.o
[ 15%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/if.cpp.o
[ 17%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/and.cpp.o
[ 18%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/data/var.cpp.o
[ 19%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/data/missing_some.cpp.o
[ 21%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/equal.cpp.o
[ 22%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/different.cpp.o
[ 25%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/not.cpp.o
[ 25%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/or.cpp.o
[ 27%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/misc/log.cpp.o
[ 27%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/logic/truthy.cpp.o
[ 28%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/addition.cpp.o
[ 30%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/division.cpp.o
[ 31%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/gt.cpp.o
[ 32%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/gte.cpp.o
[ 34%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/lt.cpp.o
[ 35%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/min.cpp.o
[ 36%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/lte.cpp.o
[ 38%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/max.cpp.o
[ 39%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/modulo.cpp.o
[ 40%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/multiplication.cpp.o
[ 42%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/numeric/subtraction.cpp.o
[ 43%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/string/cat.cpp.o
[ 44%] Building CXX object CMakeFiles/jsonlogic.dir/src/operations/string/substr.cpp.o
[ 46%] Linking CXX static library libjsonlogic.a
[ 46%] Built target jsonlogic
[ 47%] Linking CXX static library ../../../../lib/libgtest.a
[ 47%] Built target gtest
[ 48%] Building CXX object test/lib/googletest/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 50%] Building CXX object test/lib/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
[ 51%] Linking CXX static library ../../../../lib/libgtest_main.a
[ 51%] Built target gtest_main
[ 52%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/filter.cpp.o
[ 53%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/add_rm_operation.cpp.o
[ 57%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/all.cpp.o
[ 57%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/map.cpp.o
[ 57%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/in.cpp.o
[ 59%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/merge.cpp.o
[ 60%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/reduce.cpp.o
[ 61%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/data/missing.cpp.o
[ 63%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/none.cpp.o
[ 64%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/array/some.cpp.o
[ 65%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/data/missing_some.cpp.o
[ 68%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/different.cpp.o
[ 68%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/and.cpp.o
[ 69%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/if.cpp.o
[ 72%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/equal.cpp.o
[ 71%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/data/var.cpp.o
[ 73%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/or.cpp.o
[ 75%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/not.cpp.o
[ 76%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/misc/log.cpp.o
[ 78%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/division.cpp.o
[ 78%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/addition.cpp.o
[ 80%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/logic/truthy.cpp.o
[ 81%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/gt.cpp.o
[ 82%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/gte.cpp.o
[ 84%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/lt.cpp.o
[ 86%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/lte.cpp.o
[ 86%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/min.cpp.o
[ 89%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/modulo.cpp.o
[ 89%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/subtraction.cpp.o
[ 90%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/max.cpp.o
[ 92%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/numeric/multiplication.cpp.o
[ 93%] Linking CXX static library ../../../../lib/libgmock.a
[ 93%] Built target gmock
[ 94%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/string/cat.cpp.o
[ 96%] Building CXX object test/CMakeFiles/jsonlogic_test.dir/operations/string/substr.cpp.o
[ 97%] Building CXX object test/lib/googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o
[ 98%] Linking CXX static library ../../../../lib/libgmock_main.a
[ 98%] Built target gmock_main
[100%] Linking CXX executable jsonlogic_test
[100%] Built target jsonlogic_test
[habi@archlinux json-logic-cpp]$ ./test/jsonlogic_test
Running main() from /home/habi/repos/json-logic-cpp/test/lib/googletest/googletest/src/gtest_main.cc
[==========] Running 197 tests from 33 test suites.
[----------] Global test environment set-up.
[----------] 3 tests from AddRmOperation
[ RUN      ] AddRmOperation.AddOperationPrimitive
[       OK ] AddRmOperation.AddOperationPrimitive (0 ms)
[ RUN      ] AddRmOperation.AddOperationData
[       OK ] AddRmOperation.AddOperationData (0 ms)
[ RUN      ] AddRmOperation.RmOperation
[       OK ] AddRmOperation.RmOperation (0 ms)
[----------] 3 tests from AddRmOperation (0 ms total)

[----------] 4 tests from OperationArrayAll
[ RUN      ] OperationArrayAll.PrimitiveTrue
[       OK ] OperationArrayAll.PrimitiveTrue (0 ms)
[ RUN      ] OperationArrayAll.PrimitiveFalse
[       OK ] OperationArrayAll.PrimitiveFalse (0 ms)
[ RUN      ] OperationArrayAll.DataTrue
[       OK ] OperationArrayAll.DataTrue (0 ms)
[ RUN      ] OperationArrayAll.DataFalse
[       OK ] OperationArrayAll.DataFalse (0 ms)
[----------] 4 tests from OperationArrayAll (0 ms total)

[----------] 4 tests from OperationArrayFilter
[ RUN      ] OperationArrayFilter.PrimitiveSimpleOperation
[       OK ] OperationArrayFilter.PrimitiveSimpleOperation (0 ms)
[ RUN      ] OperationArrayFilter.PrimitiveComposedOperation
[       OK ] OperationArrayFilter.PrimitiveComposedOperation (0 ms)
[ RUN      ] OperationArrayFilter.VariableSimpleOperation
[       OK ] OperationArrayFilter.VariableSimpleOperation (0 ms)
[ RUN      ] OperationArrayFilter.VariableComposedOperation
[       OK ] OperationArrayFilter.VariableComposedOperation (0 ms)
[----------] 4 tests from OperationArrayFilter (0 ms total)

[----------] 8 tests from OperationArrayStringIn
[ RUN      ] OperationArrayStringIn.PrimitiveArrayTrue
[       OK ] OperationArrayStringIn.PrimitiveArrayTrue (0 ms)
[ RUN      ] OperationArrayStringIn.PrimitiveArrayFalse
[       OK ] OperationArrayStringIn.PrimitiveArrayFalse (0 ms)
[ RUN      ] OperationArrayStringIn.VariableArrayTrue
[       OK ] OperationArrayStringIn.VariableArrayTrue (0 ms)
[ RUN      ] OperationArrayStringIn.VariableArrayFalse
[       OK ] OperationArrayStringIn.VariableArrayFalse (0 ms)
[ RUN      ] OperationArrayStringIn.PrimitiveStringTrue
[       OK ] OperationArrayStringIn.PrimitiveStringTrue (0 ms)
[ RUN      ] OperationArrayStringIn.PrimitiveStringFalse
[       OK ] OperationArrayStringIn.PrimitiveStringFalse (0 ms)
[ RUN      ] OperationArrayStringIn.VariableStringTrue
[       OK ] OperationArrayStringIn.VariableStringTrue (0 ms)
[ RUN      ] OperationArrayStringIn.VariableStringFalse
[       OK ] OperationArrayStringIn.VariableStringFalse (0 ms)
[----------] 8 tests from OperationArrayStringIn (0 ms total)

[----------] 4 tests from OperationArrayMap
[ RUN      ] OperationArrayMap.PrimitiveSimpleOperation
[       OK ] OperationArrayMap.PrimitiveSimpleOperation (0 ms)
[ RUN      ] OperationArrayMap.PrimitiveComposedOperation
[       OK ] OperationArrayMap.PrimitiveComposedOperation (0 ms)
[ RUN      ] OperationArrayMap.VariableSimpleOperation
[       OK ] OperationArrayMap.VariableSimpleOperation (0 ms)
[ RUN      ] OperationArrayMap.VariableComposedOperation
[       OK ] OperationArrayMap.VariableComposedOperation (0 ms)
[----------] 4 tests from OperationArrayMap (0 ms total)

[----------] 4 tests from OperationArrayMerge
[ RUN      ] OperationArrayMerge.PrimitiveArrays
[       OK ] OperationArrayMerge.PrimitiveArrays (0 ms)
[ RUN      ] OperationArrayMerge.PrimitiveMixed
[       OK ] OperationArrayMerge.PrimitiveMixed (0 ms)
[ RUN      ] OperationArrayMerge.VariableArrays
[       OK ] OperationArrayMerge.VariableArrays (0 ms)
[ RUN      ] OperationArrayMerge.VariableMixed
[       OK ] OperationArrayMerge.VariableMixed (0 ms)
[----------] 4 tests from OperationArrayMerge (0 ms total)

[----------] 4 tests from OperationArrayNone
[ RUN      ] OperationArrayNone.PrimitiveTrue
[       OK ] OperationArrayNone.PrimitiveTrue (0 ms)
[ RUN      ] OperationArrayNone.PrimitiveFalse
[       OK ] OperationArrayNone.PrimitiveFalse (0 ms)
[ RUN      ] OperationArrayNone.DataTrue
[       OK ] OperationArrayNone.DataTrue (0 ms)
[ RUN      ] OperationArrayNone.DataFalse
[       OK ] OperationArrayNone.DataFalse (0 ms)
[----------] 4 tests from OperationArrayNone (0 ms total)

[----------] 4 tests from OperationArrayReduce
[ RUN      ] OperationArrayReduce.PrimitiveSimpleOperation
[       OK ] OperationArrayReduce.PrimitiveSimpleOperation (0 ms)
[ RUN      ] OperationArrayReduce.PrimitiveComposedOperation
[       OK ] OperationArrayReduce.PrimitiveComposedOperation (0 ms)
[ RUN      ] OperationArrayReduce.VariableSimpleOperation
[       OK ] OperationArrayReduce.VariableSimpleOperation (0 ms)
[ RUN      ] OperationArrayReduce.VariableComposedOperation
[       OK ] OperationArrayReduce.VariableComposedOperation (0 ms)
[----------] 4 tests from OperationArrayReduce (0 ms total)

[----------] 4 tests from OperationArraySome
[ RUN      ] OperationArraySome.PrimitiveTrue
[       OK ] OperationArraySome.PrimitiveTrue (0 ms)
[ RUN      ] OperationArraySome.PrimitiveFalse
[       OK ] OperationArraySome.PrimitiveFalse (0 ms)
[ RUN      ] OperationArraySome.DataTrue
[       OK ] OperationArraySome.DataTrue (0 ms)
[ RUN      ] OperationArraySome.DataFalse
[       OK ] OperationArraySome.DataFalse (0 ms)
[----------] 4 tests from OperationArraySome (0 ms total)

[----------] 4 tests from OperationDataMissing
[ RUN      ] OperationDataMissing.SimpleKeys
[       OK ] OperationDataMissing.SimpleKeys (0 ms)
[ RUN      ] OperationDataMissing.SimpleKeysAllPresent
[       OK ] OperationDataMissing.SimpleKeysAllPresent (0 ms)
[ RUN      ] OperationDataMissing.SimpleKeysRepeatedKeys
[       OK ] OperationDataMissing.SimpleKeysRepeatedKeys (0 ms)
[ RUN      ] OperationDataMissing.NestedKeys
[       OK ] OperationDataMissing.NestedKeys (0 ms)
[----------] 4 tests from OperationDataMissing (0 ms total)

[----------] 6 tests from OperationDataMissingSome
[ RUN      ] OperationDataMissingSome.SimpleKeysFoundMinimum
[       OK ] OperationDataMissingSome.SimpleKeysFoundMinimum (0 ms)
[ RUN      ] OperationDataMissingSome.SimpleKeysNotFoundMinimum
[       OK ] OperationDataMissingSome.SimpleKeysNotFoundMinimum (0 ms)
[ RUN      ] OperationDataMissingSome.SimpleRepeatedKeysFoundMinimum
[       OK ] OperationDataMissingSome.SimpleRepeatedKeysFoundMinimum (0 ms)
[ RUN      ] OperationDataMissingSome.SimpleRepeatedKeysNotFoundMinimum
[       OK ] OperationDataMissingSome.SimpleRepeatedKeysNotFoundMinimum (0 ms)
[ RUN      ] OperationDataMissingSome.NestedKeysFoundMinimum
[       OK ] OperationDataMissingSome.NestedKeysFoundMinimum (0 ms)
[ RUN      ] OperationDataMissingSome.NestedKeysNotFoundMinimum
[       OK ] OperationDataMissingSome.NestedKeysNotFoundMinimum (0 ms)
[----------] 6 tests from OperationDataMissingSome (0 ms total)

[----------] 12 tests from OperationDataVar
[ RUN      ] OperationDataVar.SimpleMemberAccessNumber
[       OK ] OperationDataVar.SimpleMemberAccessNumber (0 ms)
[ RUN      ] OperationDataVar.SimpleMemberAccessString
[       OK ] OperationDataVar.SimpleMemberAccessString (0 ms)
[ RUN      ] OperationDataVar.SimpleMemberAccessObject
[       OK ] OperationDataVar.SimpleMemberAccessObject (0 ms)
[ RUN      ] OperationDataVar.SimpleMemberAccessArray
[       OK ] OperationDataVar.SimpleMemberAccessArray (0 ms)
[ RUN      ] OperationDataVar.SimpleMemberAccessNestedOperationOrTrue
[       OK ] OperationDataVar.SimpleMemberAccessNestedOperationOrTrue (0 ms)
[ RUN      ] OperationDataVar.SimpleMemberAccessNestedOperationOrFalse
[       OK ] OperationDataVar.SimpleMemberAccessNestedOperationOrFalse (0 ms)
[ RUN      ] OperationDataVar.NestedMemberAccessObject
[       OK ] OperationDataVar.NestedMemberAccessObject (0 ms)
[ RUN      ] OperationDataVar.NestedMemberAccessArray
[       OK ] OperationDataVar.NestedMemberAccessArray (0 ms)
[ RUN      ] OperationDataVar.ThrowExceptionWhenMemberNotFound
[       OK ] OperationDataVar.ThrowExceptionWhenMemberNotFound (0 ms)
[ RUN      ] OperationDataVar.ThrowExceptionWhenArrayIndexNotFound
[       OK ] OperationDataVar.ThrowExceptionWhenArrayIndexNotFound (0 ms)
[ RUN      ] OperationDataVar.DefaultValueWhenMemberNotFound
[       OK ] OperationDataVar.DefaultValueWhenMemberNotFound (0 ms)
[ RUN      ] OperationDataVar.DefaultValueWhenArrayIndexNotFound
[       OK ] OperationDataVar.DefaultValueWhenArrayIndexNotFound (0 ms)
[----------] 12 tests from OperationDataVar (0 ms total)

[----------] 4 tests from OperationLogicAnd
[ RUN      ] OperationLogicAnd.PrimitiveTrue
[       OK ] OperationLogicAnd.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicAnd.PrimitiveFalse
[       OK ] OperationLogicAnd.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicAnd.NestedTrue
[       OK ] OperationLogicAnd.NestedTrue (0 ms)
[ RUN      ] OperationLogicAnd.NestedFalse
[       OK ] OperationLogicAnd.NestedFalse (0 ms)
[----------] 4 tests from OperationLogicAnd (0 ms total)

[----------] 7 tests from OperationLogicDifferent
[ RUN      ] OperationLogicDifferent.PrimitiveTrue
[       OK ] OperationLogicDifferent.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicDifferent.PrimitiveFalse
[       OK ] OperationLogicDifferent.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicDifferent.NestedTrue
[       OK ] OperationLogicDifferent.NestedTrue (0 ms)
[ RUN      ] OperationLogicDifferent.NestedFalse
[       OK ] OperationLogicDifferent.NestedFalse (0 ms)
[ RUN      ] OperationLogicDifferent.NestedOperandsTrue
[       OK ] OperationLogicDifferent.NestedOperandsTrue (0 ms)
[ RUN      ] OperationLogicDifferent.NestedOperandsFalse
[       OK ] OperationLogicDifferent.NestedOperandsFalse (0 ms)
[ RUN      ] OperationLogicDifferent.AbstractStrictDifferent
[       OK ] OperationLogicDifferent.AbstractStrictDifferent (0 ms)
[----------] 7 tests from OperationLogicDifferent (0 ms total)

[----------] 7 tests from OperationLogicEqual
[ RUN      ] OperationLogicEqual.PrimitiveTrue
[       OK ] OperationLogicEqual.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicEqual.PrimitiveFalse
[       OK ] OperationLogicEqual.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicEqual.NestedTrue
[       OK ] OperationLogicEqual.NestedTrue (0 ms)
[ RUN      ] OperationLogicEqual.NestedFalse
[       OK ] OperationLogicEqual.NestedFalse (0 ms)
[ RUN      ] OperationLogicEqual.NestedOperandsTrue
[       OK ] OperationLogicEqual.NestedOperandsTrue (0 ms)
[ RUN      ] OperationLogicEqual.NestedOperandsFalse
[       OK ] OperationLogicEqual.NestedOperandsFalse (0 ms)
[ RUN      ] OperationLogicEqual.AbstractStrictEqual
[       OK ] OperationLogicEqual.AbstractStrictEqual (0 ms)
[----------] 7 tests from OperationLogicEqual (0 ms total)

[----------] 10 tests from OperationLogicIf
[ RUN      ] OperationLogicIf.PrimitiveTrue
[       OK ] OperationLogicIf.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicIf.PrimitiveFalse
[       OK ] OperationLogicIf.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicIf.SuboperationTrue
[       OK ] OperationLogicIf.SuboperationTrue (0 ms)
[ RUN      ] OperationLogicIf.SuboperationFalse
[       OK ] OperationLogicIf.SuboperationFalse (0 ms)
[ RUN      ] OperationLogicIf.SuboperationWithVariablesTrue
[       OK ] OperationLogicIf.SuboperationWithVariablesTrue (0 ms)
[ RUN      ] OperationLogicIf.SuboperationWithVariablesFalse
[       OK ] OperationLogicIf.SuboperationWithVariablesFalse (0 ms)
[ RUN      ] OperationLogicIf.MultipleElseIf1
[       OK ] OperationLogicIf.MultipleElseIf1 (0 ms)
[ RUN      ] OperationLogicIf.MultipleElseIf2
[       OK ] OperationLogicIf.MultipleElseIf2 (0 ms)
[ RUN      ] OperationLogicIf.MultipleElseIf3
[       OK ] OperationLogicIf.MultipleElseIf3 (0 ms)
[ RUN      ] OperationLogicIf.MultipleElseIf0
[       OK ] OperationLogicIf.MultipleElseIf0 (0 ms)
[----------] 10 tests from OperationLogicIf (0 ms total)

[----------] 10 tests from OperationLogicNot
[ RUN      ] OperationLogicNot.PrimitiveTrue
[       OK ] OperationLogicNot.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicNot.PrimitiveFalse
[       OK ] OperationLogicNot.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicNot.NumberTrue
[       OK ] OperationLogicNot.NumberTrue (0 ms)
[ RUN      ] OperationLogicNot.NumberFalse
[       OK ] OperationLogicNot.NumberFalse (0 ms)
[ RUN      ] OperationLogicNot.ArrayTrue
[       OK ] OperationLogicNot.ArrayTrue (0 ms)
[ RUN      ] OperationLogicNot.ArrayFalse
[       OK ] OperationLogicNot.ArrayFalse (0 ms)
[ RUN      ] OperationLogicNot.StringTrue
[       OK ] OperationLogicNot.StringTrue (0 ms)
[ RUN      ] OperationLogicNot.StringFalse
[       OK ] OperationLogicNot.StringFalse (0 ms)
[ RUN      ] OperationLogicNot.NestedTrue
[       OK ] OperationLogicNot.NestedTrue (0 ms)
[ RUN      ] OperationLogicNot.NestedFalse
[       OK ] OperationLogicNot.NestedFalse (0 ms)
[----------] 10 tests from OperationLogicNot (0 ms total)

[----------] 4 tests from OperationLogicOr
[ RUN      ] OperationLogicOr.PrimitiveTrue
[       OK ] OperationLogicOr.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicOr.PrimitiveFalse
[       OK ] OperationLogicOr.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicOr.NestedTrue
[       OK ] OperationLogicOr.NestedTrue (0 ms)
[ RUN      ] OperationLogicOr.NestedFalse
[       OK ] OperationLogicOr.NestedFalse (0 ms)
[----------] 4 tests from OperationLogicOr (0 ms total)

[----------] 10 tests from OperationLogicTruthy
[ RUN      ] OperationLogicTruthy.PrimitiveTrue
[       OK ] OperationLogicTruthy.PrimitiveTrue (0 ms)
[ RUN      ] OperationLogicTruthy.PrimitiveFalse
[       OK ] OperationLogicTruthy.PrimitiveFalse (0 ms)
[ RUN      ] OperationLogicTruthy.NumberTrue
[       OK ] OperationLogicTruthy.NumberTrue (0 ms)
[ RUN      ] OperationLogicTruthy.NumberFalse
[       OK ] OperationLogicTruthy.NumberFalse (0 ms)
[ RUN      ] OperationLogicTruthy.ArrayTrue
[       OK ] OperationLogicTruthy.ArrayTrue (0 ms)
[ RUN      ] OperationLogicTruthy.ArrayFalse
[       OK ] OperationLogicTruthy.ArrayFalse (0 ms)
[ RUN      ] OperationLogicTruthy.StringTrue
[       OK ] OperationLogicTruthy.StringTrue (0 ms)
[ RUN      ] OperationLogicTruthy.StringFalse
[       OK ] OperationLogicTruthy.StringFalse (0 ms)
[ RUN      ] OperationLogicTruthy.NestedTrue
[       OK ] OperationLogicTruthy.NestedTrue (0 ms)
[ RUN      ] OperationLogicTruthy.NestedFalse
[       OK ] OperationLogicTruthy.NestedFalse (0 ms)
[----------] 10 tests from OperationLogicTruthy (0 ms total)

[----------] 3 tests from OperationMiscLog
[ RUN      ] OperationMiscLog.Primitive
[       OK ] OperationMiscLog.Primitive (0 ms)
[ RUN      ] OperationMiscLog.Variable
[       OK ] OperationMiscLog.Variable (0 ms)
[ RUN      ] OperationMiscLog.Operation
[       OK ] OperationMiscLog.Operation (0 ms)
[----------] 3 tests from OperationMiscLog (0 ms total)

[----------] 11 tests from OperationNumericAddition
[ RUN      ] OperationNumericAddition.Primitive2Operands
[       OK ] OperationNumericAddition.Primitive2Operands (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveManyOperands
[       OK ] OperationNumericAddition.PrimitiveManyOperands (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveNumberCastToNumber
[       OK ] OperationNumericAddition.PrimitiveNumberCastToNumber (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveBooleanFalseCastToNumber
[       OK ] OperationNumericAddition.PrimitiveBooleanFalseCastToNumber (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveBooleanTrueCastToNumber
[       OK ] OperationNumericAddition.PrimitiveBooleanTrueCastToNumber (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveArrayEmptyCastToNumber
[       OK ] OperationNumericAddition.PrimitiveArrayEmptyCastToNumber (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveArrayNotEmptyCastToNumber
[       OK ] OperationNumericAddition.PrimitiveArrayNotEmptyCastToNumber (0 ms)
[ RUN      ] OperationNumericAddition.PrimitiveStringCastToNumber
[       OK ] OperationNumericAddition.PrimitiveStringCastToNumber (0 ms)
[ RUN      ] OperationNumericAddition.Variable2Operands
[       OK ] OperationNumericAddition.Variable2Operands (0 ms)
[ RUN      ] OperationNumericAddition.VariableManyOperands
[       OK ] OperationNumericAddition.VariableManyOperands (0 ms)
[ RUN      ] OperationNumericAddition.VariableStringCastToNumber
[       OK ] OperationNumericAddition.VariableStringCastToNumber (0 ms)
[----------] 11 tests from OperationNumericAddition (0 ms total)

[----------] 2 tests from OperationNumericDivision
[ RUN      ] OperationNumericDivision.Primitive2Operands
[       OK ] OperationNumericDivision.Primitive2Operands (0 ms)
[ RUN      ] OperationNumericDivision.Variable2Operands
[       OK ] OperationNumericDivision.Variable2Operands (0 ms)
[----------] 2 tests from OperationNumericDivision (0 ms total)

[----------] 6 tests from OperationNumericGt
[ RUN      ] OperationNumericGt.PrimitiveGtTrue
[       OK ] OperationNumericGt.PrimitiveGtTrue (0 ms)
[ RUN      ] OperationNumericGt.PrimitiveEqualFalse
[       OK ] OperationNumericGt.PrimitiveEqualFalse (0 ms)
[ RUN      ] OperationNumericGt.PrimitiveFalse
[       OK ] OperationNumericGt.PrimitiveFalse (0 ms)
[ RUN      ] OperationNumericGt.VariablesGtTrue
[       OK ] OperationNumericGt.VariablesGtTrue (0 ms)
[ RUN      ] OperationNumericGt.VariablesEqualFalse
[       OK ] OperationNumericGt.VariablesEqualFalse (0 ms)
[ RUN      ] OperationNumericGt.VariablesFalse
[       OK ] OperationNumericGt.VariablesFalse (0 ms)
[----------] 6 tests from OperationNumericGt (0 ms total)

[----------] 6 tests from OperationNumericGte
[ RUN      ] OperationNumericGte.PrimitiveGtTrue
[       OK ] OperationNumericGte.PrimitiveGtTrue (0 ms)
[ RUN      ] OperationNumericGte.PrimitiveEqualTrue
[       OK ] OperationNumericGte.PrimitiveEqualTrue (0 ms)
[ RUN      ] OperationNumericGte.PrimitiveFalse
[       OK ] OperationNumericGte.PrimitiveFalse (0 ms)
[ RUN      ] OperationNumericGte.VariablesGtTrue
[       OK ] OperationNumericGte.VariablesGtTrue (0 ms)
[ RUN      ] OperationNumericGte.VariablesEqualTrue
[       OK ] OperationNumericGte.VariablesEqualTrue (0 ms)
[ RUN      ] OperationNumericGte.VariablesFalse
[       OK ] OperationNumericGte.VariablesFalse (0 ms)
[----------] 6 tests from OperationNumericGte (0 ms total)

[----------] 12 tests from OperationNumericLt
[ RUN      ] OperationNumericLt.PrimitiveLtTrue
[       OK ] OperationNumericLt.PrimitiveLtTrue (0 ms)
[ RUN      ] OperationNumericLt.PrimitiveEqualFalse
[       OK ] OperationNumericLt.PrimitiveEqualFalse (0 ms)
[ RUN      ] OperationNumericLt.PrimitiveFalse
[       OK ] OperationNumericLt.PrimitiveFalse (0 ms)
[ RUN      ] OperationNumericLt.PrimitiveBetweenTrue
[       OK ] OperationNumericLt.PrimitiveBetweenTrue (0 ms)
[ RUN      ] OperationNumericLt.PrimitiveBetweenFalse1
[       OK ] OperationNumericLt.PrimitiveBetweenFalse1 (0 ms)
[ RUN      ] OperationNumericLt.PrimitiveBetweenFalse2
[       OK ] OperationNumericLt.PrimitiveBetweenFalse2 (0 ms)
[ RUN      ] OperationNumericLt.VariablesLtTrue
[       OK ] OperationNumericLt.VariablesLtTrue (0 ms)
[ RUN      ] OperationNumericLt.VariablesEqualFalse
[       OK ] OperationNumericLt.VariablesEqualFalse (0 ms)
[ RUN      ] OperationNumericLt.VariablesFalse
[       OK ] OperationNumericLt.VariablesFalse (0 ms)
[ RUN      ] OperationNumericLt.VariablesBetweenTrue
[       OK ] OperationNumericLt.VariablesBetweenTrue (0 ms)
[ RUN      ] OperationNumericLt.VariablesBetweenFalse1
[       OK ] OperationNumericLt.VariablesBetweenFalse1 (0 ms)
[ RUN      ] OperationNumericLt.VariablesBetweenFalse2
[       OK ] OperationNumericLt.VariablesBetweenFalse2 (0 ms)
[----------] 12 tests from OperationNumericLt (0 ms total)

[----------] 16 tests from OperationNumericLte
[ RUN      ] OperationNumericLte.PrimitiveLtTrue
[       OK ] OperationNumericLte.PrimitiveLtTrue (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveEqualTrue
[       OK ] OperationNumericLte.PrimitiveEqualTrue (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveFalse
[       OK ] OperationNumericLte.PrimitiveFalse (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveBetweenTrue1
[       OK ] OperationNumericLte.PrimitiveBetweenTrue1 (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveBetweenTrue2
[       OK ] OperationNumericLte.PrimitiveBetweenTrue2 (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveBetweenTrue3
[       OK ] OperationNumericLte.PrimitiveBetweenTrue3 (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveBetweenFalse1
[       OK ] OperationNumericLte.PrimitiveBetweenFalse1 (0 ms)
[ RUN      ] OperationNumericLte.PrimitiveBetweenFalse2
[       OK ] OperationNumericLte.PrimitiveBetweenFalse2 (0 ms)
[ RUN      ] OperationNumericLte.VariablesLtTrue
[       OK ] OperationNumericLte.VariablesLtTrue (0 ms)
[ RUN      ] OperationNumericLte.VariablesEqualTrue
[       OK ] OperationNumericLte.VariablesEqualTrue (0 ms)
[ RUN      ] OperationNumericLte.VariablesFalse
[       OK ] OperationNumericLte.VariablesFalse (0 ms)
[ RUN      ] OperationNumericLte.VariablesBetweenTrue1
[       OK ] OperationNumericLte.VariablesBetweenTrue1 (0 ms)
[ RUN      ] OperationNumericLte.VariablesBetweenTrue2
[       OK ] OperationNumericLte.VariablesBetweenTrue2 (0 ms)
[ RUN      ] OperationNumericLte.VariablesBetweenTrue3
[       OK ] OperationNumericLte.VariablesBetweenTrue3 (0 ms)
[ RUN      ] OperationNumericLte.VariablesBetweenFalse1
[       OK ] OperationNumericLte.VariablesBetweenFalse1 (0 ms)
[ RUN      ] OperationNumericLte.VariablesBetweenFalse2
[       OK ] OperationNumericLte.VariablesBetweenFalse2 (0 ms)
[----------] 16 tests from OperationNumericLte (0 ms total)

[----------] 4 tests from OperationNumericMax
[ RUN      ] OperationNumericMax.Primitive
[       OK ] OperationNumericMax.Primitive (0 ms)
[ RUN      ] OperationNumericMax.IgnoreNonNumbers
[       OK ] OperationNumericMax.IgnoreNonNumbers (0 ms)
[ RUN      ] OperationNumericMax.Nested
[       OK ] OperationNumericMax.Nested (0 ms)
[ RUN      ] OperationNumericMax.NestedOperands
[       OK ] OperationNumericMax.NestedOperands (0 ms)
[----------] 4 tests from OperationNumericMax (0 ms total)

[----------] 4 tests from OperationNumericMin
[ RUN      ] OperationNumericMin.Primitive
[       OK ] OperationNumericMin.Primitive (0 ms)
[ RUN      ] OperationNumericMin.IgnoreNonNumbers
[       OK ] OperationNumericMin.IgnoreNonNumbers (0 ms)
[ RUN      ] OperationNumericMin.Nested
[       OK ] OperationNumericMin.Nested (0 ms)
[ RUN      ] OperationNumericMin.NestedOperands
[       OK ] OperationNumericMin.NestedOperands (0 ms)
[----------] 4 tests from OperationNumericMin (0 ms total)

[----------] 2 tests from OperationNumericModulo
[ RUN      ] OperationNumericModulo.Primitive2Operands
[       OK ] OperationNumericModulo.Primitive2Operands (0 ms)
[ RUN      ] OperationNumericModulo.Variable2Operands
[       OK ] OperationNumericModulo.Variable2Operands (0 ms)
[----------] 2 tests from OperationNumericModulo (0 ms total)

[----------] 4 tests from OperationNumericMultiplication
[ RUN      ] OperationNumericMultiplication.Primitive2Operands
[       OK ] OperationNumericMultiplication.Primitive2Operands (0 ms)
[ RUN      ] OperationNumericMultiplication.PrimitiveManyOperands
[       OK ] OperationNumericMultiplication.PrimitiveManyOperands (0 ms)
[ RUN      ] OperationNumericMultiplication.Variable2Operands
[       OK ] OperationNumericMultiplication.Variable2Operands (0 ms)
[ RUN      ] OperationNumericMultiplication.VariableManyOperands
[       OK ] OperationNumericMultiplication.VariableManyOperands (0 ms)
[----------] 4 tests from OperationNumericMultiplication (0 ms total)

[----------] 4 tests from OperationNumericSubtraction
[ RUN      ] OperationNumericSubtraction.Primitive2Operands
[       OK ] OperationNumericSubtraction.Primitive2Operands (0 ms)
[ RUN      ] OperationNumericSubtraction.PrimitiveNumberToNegative
[       OK ] OperationNumericSubtraction.PrimitiveNumberToNegative (0 ms)
[ RUN      ] OperationNumericSubtraction.Variable2Operands
[       OK ] OperationNumericSubtraction.Variable2Operands (0 ms)
[ RUN      ] OperationNumericSubtraction.VariableNumberToNegative
[       OK ] OperationNumericSubtraction.VariableNumberToNegative (0 ms)
[----------] 4 tests from OperationNumericSubtraction (0 ms total)

[----------] 2 tests from OperationStringCat
[ RUN      ] OperationStringCat.Primitive
[       OK ] OperationStringCat.Primitive (0 ms)
[ RUN      ] OperationStringCat.Variable
[       OK ] OperationStringCat.Variable (0 ms)
[----------] 2 tests from OperationStringCat (0 ms total)

[----------] 8 tests from OperationStringSubstr
[ RUN      ] OperationStringSubstr.PrimitiveStartIndexPositiveNoSubstrLength
[       OK ] OperationStringSubstr.PrimitiveStartIndexPositiveNoSubstrLength (0 ms)
[ RUN      ] OperationStringSubstr.PrimitiveStartIndexNegativeNoSubstrLength
[       OK ] OperationStringSubstr.PrimitiveStartIndexNegativeNoSubstrLength (0 ms)
[ RUN      ] OperationStringSubstr.PrimitiveStartIndexPositiveSubstrLengthPositive
[       OK ] OperationStringSubstr.PrimitiveStartIndexPositiveSubstrLengthPositive (0 ms)
[ RUN      ] OperationStringSubstr.PrimitiveStartIndexPositiveSubstrLengthNegative
[       OK ] OperationStringSubstr.PrimitiveStartIndexPositiveSubstrLengthNegative (0 ms)
[ RUN      ] OperationStringSubstr.VariableStartIndexPositiveNoSubstrLength
[       OK ] OperationStringSubstr.VariableStartIndexPositiveNoSubstrLength (0 ms)
[ RUN      ] OperationStringSubstr.VariableStartIndexNegativeNoSubstrLength
[       OK ] OperationStringSubstr.VariableStartIndexNegativeNoSubstrLength (0 ms)
[ RUN      ] OperationStringSubstr.VariableStartIndexPositiveSubstrLengthPositive
[       OK ] OperationStringSubstr.VariableStartIndexPositiveSubstrLengthPositive (0 ms)
[ RUN      ] OperationStringSubstr.VariableStartIndexPositiveSubstrLengthNegative
[       OK ] OperationStringSubstr.VariableStartIndexPositiveSubstrLengthNegative (0 ms)
[----------] 8 tests from OperationStringSubstr (0 ms total)

[----------] Global test environment tear-down
[==========] 197 tests from 33 test suites ran. (9 ms total)
[  PASSED  ] 197 tests.

When implementing more complex logic it might be beneficial to know if
the current entry is an operation.

Example would be:

if (IsOperation(j)) return Apply(j) else return CustomOperation(j)

This allows traversing the tree and perform the "CustomOperation" on all
but operations and otherwise handle the operations when finding such.

Signed-off-by: Hans Binderup <habi@bang-olufsen.dk>
Versioning shared libraries is standard practice. This improves
compatibility with most common packing systems.

Signed-off-by: Hans Binderup <habi@bang-olufsen.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments