Skip to content

Commit

Permalink
Small change
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Jul 11, 2023
1 parent 1efda33 commit 0c5d67a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
3 changes: 2 additions & 1 deletion example/example-build/jni/cpp/src/NormalClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ NormalClass::NormalClass()

int NormalClass::addIntValue(int a, int b)
{
return (a + b) * hiddenInt * hiddenParentInt;
// return (a + b) * hiddenInt * hiddenParentInt;
return a + b;
}
6 changes: 4 additions & 2 deletions example/example-build/jni/cpp/src/ParentClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ ParentClass::ParentClass()

float ParentClass::addFloatValue(float a, float b)
{
return (a + b) * hiddenParentInt;
// return (a + b) * hiddenParentInt;
return (a + b);
}

bool ParentClass::invertBoolean(bool value)
{
return !(bool)(value * hiddenParentInt);
// return !(bool)(value * hiddenParentInt);
return !value;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ public void test_add_int() {
assertEquals(20, ret);
}

// @Test
// public void test_add_float() {
// NormalClass normalClass = new NormalClass();
// float ret = normalClass.addFloatValue(10.3f, 10.3f);
// assertEquals(20.6, ret, 1.0f);
// }
//
// @Test
// public void test_invert_boolean_should_be_false() {
// NormalClass normalClass = new NormalClass();
// boolean ret = normalClass.invertBoolean(true);
// assertFalse(ret);
// }
//
// @Test
// public void test_invert_boolean_should_be_true() {
// NormalClass normalClass = new NormalClass();
// boolean ret = normalClass.invertBoolean(false);
// assertTrue(ret);
// }
@Test
public void test_add_float() {
NormalClass normalClass = new NormalClass();
float ret = normalClass.addFloatValue(10.3f, 10.3f);
assertEquals(20.6, ret, 1.0f);
}

@Test
public void test_invert_boolean_should_be_false() {
NormalClass normalClass = new NormalClass();
boolean ret = normalClass.invertBoolean(true);
assertFalse(ret);
}

@Test
public void test_invert_boolean_should_be_true() {
NormalClass normalClass = new NormalClass();
boolean ret = normalClass.invertBoolean(false);
assertTrue(ret);
}

}

0 comments on commit 0c5d67a

Please sign in to comment.