Skip to content

Commit

Permalink
Added const.
Browse files Browse the repository at this point in the history
  • Loading branch information
glumb committed Nov 16, 2015
1 parent 6c70089 commit e7f84e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/fann_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void FannTest::AssertWeights(neural_net &net, fann_type min, fann_type max, fann

TEST_F(FannTest, CreateStandardThreeLayers) {
neural_net net(LAYER, 3, 2, 3, 4);
AssertCreateAndCopy(net, 3, (unsigned int[]) {2, 3, 4}, 11, 25);
AssertCreateAndCopy(net, 3, (const unsigned int[]) {2, 3, 4}, 11, 25);
}

TEST_F(FannTest, CreateStandardThreeLayersUsingCreateMethod) {
Expand Down Expand Up @@ -90,12 +90,12 @@ TEST_F(FannTest, CreateStandardFourLayersVector) {

TEST_F(FannTest, CreateSparseFourLayers) {
neural_net net(0.5, 4, 2, 3, 4, 5);
AssertCreateAndCopy(net, 4, (unsigned int[]){2, 3, 4, 5}, 17, 31);
AssertCreateAndCopy(net, 4, (const unsigned int[]){2, 3, 4, 5}, 17, 31);
}

TEST_F(FannTest, CreateSparseFourLayersUsingCreateMethod) {
ASSERT_TRUE(net.create_sparse(0.5f, 4, 2, 3, 4, 5));
AssertCreateAndCopy(net, 4, (unsigned int[]){2, 3, 4, 5}, 17, 31);
AssertCreateAndCopy(net, 4, (const unsigned int[]){2, 3, 4, 5}, 17, 31);
}

TEST_F(FannTest, CreateSparseArrayFourLayers) {
Expand All @@ -118,13 +118,13 @@ TEST_F(FannTest, CreateSparseArrayWithMinimalConnectivity) {

TEST_F(FannTest, CreateShortcutFourLayers) {
neural_net net(SHORTCUT, 4, 2, 3, 4, 5);
AssertCreateAndCopy(net, 4, (unsigned int[]){2, 3, 4, 5}, 15, 83);
AssertCreateAndCopy(net, 4, (const unsigned int[]){2, 3, 4, 5}, 15, 83);
EXPECT_EQ(SHORTCUT, net.get_network_type());
}

TEST_F(FannTest, CreateShortcutFourLayersUsingCreateMethod) {
ASSERT_TRUE(net.create_shortcut(4, 2, 3, 4, 5));
AssertCreateAndCopy(net, 4, (unsigned int[]){2, 3, 4, 5}, 15, 83);
AssertCreateAndCopy(net, 4, (const unsigned int[]){2, 3, 4, 5}, 15, 83);
EXPECT_EQ(SHORTCUT, net.get_network_type());
}

Expand All @@ -148,7 +148,7 @@ TEST_F(FannTest, CreateFromFile) {
ASSERT_TRUE(netToBeSaved.save("tmpfile"));

neural_net netToBeLoaded("tmpfile");
AssertCreateAndCopy(netToBeLoaded, 3, (unsigned int[]){2, 3, 4}, 11, 25);
AssertCreateAndCopy(netToBeLoaded, 3, (const unsigned int[]){2, 3, 4}, 11, 25);
}

TEST_F(FannTest, CreateFromFileUsingCreateMethod) {
Expand All @@ -158,7 +158,7 @@ TEST_F(FannTest, CreateFromFileUsingCreateMethod) {

ASSERT_TRUE(net.create_from_file("tmpfile"));

AssertCreateAndCopy(net, 3, (unsigned int[]){2, 3, 4}, 11, 25);
AssertCreateAndCopy(net, 3, (const unsigned int[]){2, 3, 4}, 11, 25);
}

TEST_F(FannTest, RandomizeWeights) {
Expand Down

0 comments on commit e7f84e8

Please sign in to comment.